Jump to content

Migrating Windows 7 or 8 Install from BIOS machine to Native Boot VHD


crashnburn4u

Recommended Posts

Also, lets assume GOP and Windows 7 might not work at all. Then, I dont mind moving to Windows 8/8.1 with Native Boot VHD.

 

In that scenario, what would be the best way to "migrate" the OS Partition/ Disk from Old System to a Native Boot VHD 

Link to comment
Share on other sites


I have a Zalman VE 200 (USB Virtual Optical/ HDD) (ISO Mount & Booter). 

 

I tried one of them WIn7x64 Ultimate SP1 ISOs using both Firmware Modes and selecting Zalman as Boot Device: 

- UEFI Mode: No Win7 at all, Goes to HDD and boots that

Try a real DVD.

 

Do you think a PURE windows 7 install on a Partition or a Hard Drive would work from CSM Mode?

Yes, should work at CSM mode, remember

CSM Mode: Win 7 Installer + SHIFT F10 works

Do you have a fast USB drive? Best a SSD?

Some UEFI firmware offers to select the boot drive, e.g. press F12 at the Thinkpad.

 

Also, lets assume GOP and Windows 7 might not work at all. Then, I dont mind moving to Windows 8/8.1 with Native Boot VHD.

 

In that scenario, what would be the best way to "migrate" the OS Partition/ Disk from Old System to a Native Boot VHD

I don't kown a way to proper "migrate" the applications and data.
Link to comment
Share on other sites

Ok, I am kind of giving up on Windows 7.

 

So, just to test the ability and issues around this new Toshiba Laptop and Native booting,
I ImageX 2 VHDs with fresh install from Win 8 and Win 8.1 each.
Did a simple bcdboot ?:\Windows to added them to Boot Menu. 
They are running fine. 
W8.VHD GPT [Simple Volume]W81.VHD GPT [Simple Volume]

They have a simple single volume structure and no System, EFI or MSR Partitions within

 
For some reason the VHDs I have created from my Source Machine are working with Hyper-V & VMWare.
But not working Native Boot.
 
So, I am wondering if it has something due to the Primary OS Parition and Pre OS partition (Reserved, EFI, System, MSR) structures? 

 

Please don't ignore the following Paragraph: I think this is a key issue where I am making some mistake with the VHDs or its Structure and Inter Partition mapping

 

I need to figure out the following:

X) - STRUCTURES of VHDs that work fine for Native Booting

e.g. Should they have Simple Volume Primary partitions ONLY?

AND/ OR they will be fine with/without Virtual EFI, System, MSR, Reserved etc. Internal to VHD i.e. Virtual Partitions that will work without issues.

 

Y) - Right WAY to IMAGE Existing machine: (Full DIsk w PreOS Partitions or Only OS Partition) and MAP the IMAGE to the correct part of the STRUCTURE of VHDs (as outlined above) 

 

Now, the VHD I have from my source system has gone through following changes:
 
Original & Current Source System
- MBR [1/200 MB Reserved/SystemPartition][Primary Partition Win7x64 SP1]
 
>> Disk2VHD
W7-MBR.VHD
- MBR [1/200 MB Reserved/SystemPartition][Primary Partition Win7x64 SP1]

(Works in Hyper-V + VMWare, NOT Native Boot)

 
>> Converted to GPT VHD with using gptgen and added System + MSR Partition as outlined here - http://www.dertechblog.de/en/2014/01/howto-hyper-v-gen1-vm-convert-gen2-vm/
W7-GPT.VHD 
- GPT [EFI:100,FAT32, "System",S:][MSR:128][][Primary Partition Win7x64 SP1]

>> EFI boot files copied to “System” Partition i.e. Virtual EFI partition

The important UEFI boot files will then use the tool bcdboot copied to the system partition. Where h corresponds: the drive letter of the virtual Windows partition and s: the drive letter of the virtual EFI partition: 
bcdboot h:\windows /s s: /f UEFI
(Works in VMWare with EFI, NOT Native Boot .. Windows 7 issues as pointed out in first post)
 
(So, I figured lets take this VHD to Windows 8)
>> Upgraded to Win8 inside VMWare >> SYSPREP
W7to8-GPT.VHD 
- GPT [EFI:100,FAT32, "System",S:][MSR:128][][Primary Partition Win8x64 Pro]

( Native boot still does not work | VMWare booting works)

 
Error on screen for this Most current error for this Win 7 upgraded to Win 8 VHD 
 
RECOVERYYour PC needs to be repairedThe operating system couldn't be located because the system registry file is missing or contains errors File: \Windows\System32\config\systemError Code: 0xc0000000dYou'll need to use the recovery tools on your installation media. If you dont have any installation media (like a disc or USB device), contact your system administrator or PC manufacturer

I guess the typical reply would be to try and REPAIR this OS. 

But, I think OS is working (in VMWre), but some part of the FLOW of  BOOTING to Native VHD has some issue. i.e from 

Firmware > HDD Host EFI > [VHD > Virtual EFI Partition > VIrtual OS Partition]

On the other VHDs the flow is probably this: 

Firmware > HDD Host EFI > [VHD > VIrtual OS Partition]
Do you get what I am saying here? 
 
So I am wondering of the following.. where is the error coming into the picture:
- While CREATING/ IMAGING the VHD? 
- While converting from MBR to VHD? 
- While/ DUE to INSERTING the Virtual EFI & MSR partitions? - Would it be better not to have these in the VHD? Or something was done wrong with them?
- Would it be better to only IMAGE the OS Partition, and image it to a blank Partition on the GPT VHD? (Avoid conversion)
 
I don't mind doing a FRESH IMAGING of the OLD MACHINE. I will have to do it anyways as the OLD MACHINE has changed in last few weeks of this experiment. 
 
But, I'd like to do it RIGHT this time and Create the Correct VHD structure to support it. 
Use ImageX or DISM instead of Disk2VHD if you guys think thats better. 

 

PS: The last time I ran a recovery disc to try and fix the Win7to8.VHD, it ended up messing up my Host HDD Win8 booting. How can I avoid that if at all you are suggesting some STEPS to REPAIR the Win7to8.VHD

Edited by crashnburn4u
Link to comment
Share on other sites

For some reason the VHDs I have created from my Source Machine are working with Hyper-V & VMWare.
But not working Native Boot.
There are some vitual hardware, especial the graphic card including the VGA BIOS.
Native booting uses native graphic card including the VGA BIOS or firmare.

What about the real DVD Windows 7 UEFI booting? Edited by cdob
Link to comment
Share on other sites

 

For some reason the VHDs I have created from my Source Machine are working with Hyper-V & VMWare.

But not working Native Boot.

There are some vitual hardware, especial the graphic card including the VGA BIOS.

Native booting uses native graphic card including the VGA BIOS or firmare.

What about the real DVD Windows 7 UEFI booting?

 

 

I get that.

With Windows 7 on the VHD it would boot initially and get stuck later at Logo

With Windows 8(upgraded to from win 7), the VHD, it gets gets stuck earlier before boot

 

My biggest question here is this - Do VHD's need to have or follow certain STRUCTURE to Native Boot? Will some structures fail to boot?

I think there's something wrong with the STRUCTURE of my VHD. 

Can/ should VHDs have PreOS 'Special' Partitions or NOT? 

 

Most people are saying they are equivalent of having a PHYSICAL HDD. 

But, has anyone had MULTIPLE PARTITIONS on a VHD and try MULTI BOOTING from them?

Because something is OFF with my VIRTUAL PARTITIONS. 

Link to comment
Share on other sites

( Native boot still does not work | VMWare booting works)

Error on screen for this Most current error for this Win 7 upgraded to Win 8 VHD

There is a different \boot\bcd used. Verify the native \boot\bcd after upgrade again.

 

Do VHD's need to have or follow certain STRUCTURE to Native Boot?

No, no certain requriements. Diffeent partitions are possible.

 

Will some structures fail to boot?

Yes, a expandable VHD will fail given low space at hard disk.

Native VHD Boot: A Walkthrough of Common Scenarios

http://download.microsoft.com/download/A/8/4/A847B017-B2CC-40E0-895A-266D88A43C99/Native-VHD-Boot-A-Walkthrough-of-Common-Scenarios.doc

Step 12: Prevent the VHD from expanding to its full size

During boot time, a dynamically expanding VHD will expand to its full size to guarantee space on the computer and to prevent data corruption. If the computer cannot allocate sufficient space from the physical disk that the VHD resides on, it will generate a stop error message and prevent the operating system from booting.

It's shown a BSOD 0x136.

You may disable VirtualDiskExpandOnMount.

Which VHD file size, and VHD disk size do you use?

Which free space is at real hard disk?

As jaclaz pointed already: make slow steps.

The true reason is not resolved so far.

Do you remember the question about real DVD Windows 7 UEFI booting?

Next setp: build a new VHD (fixed size) file and apply install.wim.

Given hardare / software request is unlear in detail. Nobody can provide a guaranteed working solution.

It may be possible to resolve the request later, if some small lessons learned.

Link to comment
Share on other sites

crashnburn4u

Do VHD's need to have or follow certain STRUCTURE to UEFI Native Boot?

 

The suggestion made to you to separate multiple tasks and learn step-by-step is the best. I haven't read the entire thread, but the above question appears to be your main one. :sneaky:  You might be missing some insight that UEFI OEM FW Boot Manager (UBM) is not equivalent to Windows Boot Manager - it shouldn't mount VHD or boot Windows itself, its done through a chain via Mobo NVRAM Boot Menu auto updated at each OS install. When UBM transfers control to Windows Bootmgr.efi (WBM) located on EFI HDD partition - then it mounts VHD if needed and calls Windows Boot Loader to boot OS, whether from HDD or VHD. What it means in practice: your HDD is expected to have Fat32 EFI System partition, which contains all files required to chainload WBM and then boot OS from "anywhere". Once you accomplished that, move on: format your VHD as GPT with partition structure too, and add Windows to it with DISM or restore from backup. Then use bcdboot  to add required boot files to it, and also add the VHD to main Windows Boot Menu. You might also need to do other adjustments to convert Windows install from BIOS to EFI and boot from USB drive. And your question about "multiple systems installed on VHD - I guess that's what you mean under "multiple partitions" - YES, its possible via VHD own Boot Menu, but 1st you need to learn booting at least ONE OS from it before adding more. While Secure Boot when active may impose limitations on OS multiboot.    :whistle:

 

Look through some MS docs, in particular:

 

Converting Windows BIOS installation to UEFI

Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart

Boot to VHD (Native Boot): Add a Virtual Hard Disk to the Boot Menu

Securing the Windows 8 Boot Process

 

So your main question can be rephrased: "Can my PC UEFI FW mount a VHD before it starts looking for EFI partition"? If YES, will it be the 1st UEFI partition it finds? If NOT, would EFI partition still be required on that VHD?  What's NVRAM Boot Menu role in this?   :blushing:

 

 

P.S. Sorry for some offtop. As often happens in this estranged world, I'm also lost on some issues just like the topic starter. For example, still trying to find any solution (not questions) on booting a typical PC service UEFI ISO (WinPE or Linux based, example - Acronis) directly (no USB Flash conversion) on UEFI laptop without Legacy mode support, or at least explanation WHY its not possible??? This forum or inet Search gives positively NO conclusive hints. But... given the presence of well known gurus, is anyone able to point to such solution, say Grub2 based or such?

Edited by zamarac
Link to comment
Share on other sites

Thanks guys :) This will be my experiments for the next few days. I will read and follow every step and option.. yeah I know.. too many steps as Wonko also pointed out on Reboot.Pro

 

PS: cdob - I will try to find some DVDs burn Windows 7 on them and see if the boot on UEFI. Any particular MSDN / Digital River ISOs you'd recommend / know of that will WORK? 

 

PPS: I have a spare HDD (cant open laptop).. But I can attach via USB.. DO you think I should try installing and booting Windows 7 off that on a Partition? Just to see whether this Laptop will at all support Windows 7 in ANY mode? 

Edited by crashnburn4u
Link to comment
Share on other sites

 

P.S. Sorry for some offtop. As often happens in this estranged world, I'm also lost on some issues just like the topic starter. For example, still trying to find any solution (not questions) on booting UEFI Acronis ISO (WinPE or Linux based) directly (no USB Flash conversion) on UEFI laptop without Legacy mode support, or at least explanation WHY its not possible??? This forum or inet Search gives positively NO conclusive hints. But... given the presence of well known gurus, is anyone able to point to such solution, say Grub2 based or such?

Cannot say if it can be of any help with your issue, but it is possible that "between the lines" of this thread:

http://reboot.pro/topic/19516-hack-bootmgr-to-boot-windows-in-bios-to-gpt/

it can be found something of use. :unsure:

 

jaclaz

Link to comment
Share on other sites

 Just to see whether this Laptop will at all support Windows 7 in ANY mode? 

If your laptop meets minimal Win7 system requirements AND can boot from USB HDD (choose disk in UEFI BIOS) - of course you can experiment with HDD on cheap, using VHDs for convenience. It should, since UEFI support indicates newer laptop model. Or burn a DVD from Install ISO if you have a burner. Don't set chaotic multiple goals though, structure your tasks in stages, try to understand what exactly you do and why...  :)

UEFI Firmware & SpecificationsUEFI Boot Manager

Boot Options in EFI NVRAM

DISM Image Management Command-Line Options

DiskPart Commands Reference

BCDBoot Command-LIne Options

BCDEdit Options Reference

 

 

Install from ISO / Migrate Windows to VHD(X) and Boot it from HDD / USB on Bare Metal UEFI / BIOS PC

 

Prepare VHD(X)

- boot Windows 7SP1U/Pro or 8.1Pro from PC internal disk's C:\ volume, and hook up USB HDD or Flash drive formatted as HDD to the PC

- in Disk Manager initialize USB HDD as GPT or MBR (for BIOS ONLY PC), create & format NTFS partition on it & label & mount to G:\

- create fixed VHD(X) 20Gb on USB HDD, initialize as GPT

- create, format and label 300MB Fat32 EFI System, 128MB MSR (both optional), and large NTFS Windows 7/8 partitions on the VHD(X)

- open Admin Command Prompt

- if exists, mount EFI System partition on internal PC's HDD to S:\ with Diskpart

diskpart

list volume

select volume N

assign letter=S   (or remove)

exit

- mount EFI volume on VHD(X) to V:\ (optional), and NTFS to W:\ , make System volume Active (for MBR-disk)

 

Install new OS to VHD(X)

- mount Win 7/8 Installation ISO to E:\ with ImDisk or Win Explorer

- check available OS versions on the ISO using DISM GUI or DISM

Dism /Get-WimInfo /wimFile:"E:\sources\install.wim"

- mount the WIM to O:\ (optional to add drivers):

Dism /Mount-Image /ImageFile:E:\sources\install.wim /index:1 /MountDir:O:\WIM (/ReadOnly)

- dismount the WIM after adding drivers

Dism /Unmount-Image /MountDir:O:\WIM /commit (or /discard)

- apply WIM image to VHD(X)

Dism /apply-image /imagefile:E:\sources\install.wim /index:1 /ApplyDir:W:\

- dismount Windows Install ISO in Windows Explorer

 

OR: Migrate existing OS with Apps to VHD(X)

- Boot 64-bit WinPE 5.x or Win8.1 Install DVD (Repair-Troubleshoot-Advanced-CommandPrompt) in UEFI mode to X:\

-  create a new folder on USB HDD for OS Migration image

mkdir G:\Migration

- Capture existing EFI, if present, and Windows volumes with installed Apps for Migration using DISM

Dism /Capture-Image /ImageFile:G:\Migration\efisys.wim /CaptureDir:S:\ /Name:"ESP"           (optional)

Dism /Capture-Image /ImageFile:G:\Migration\WinImg.wim /CaptureDir:C:\ /Name:"Windows"

- mount the WinImg.wim to O:\ (optional to add drivers), then dismount once added

-  Apply image(s) of captured for Migration OS with Apps to VHD(X)

Dism /apply-image /imagefile:G:\Migration\efisys.wim /index:1 /ApplyDir:V:\           (optional)

Dism /apply-image /imagefile:G:\Migration\WinImg.wim /index:1 /ApplyDir:W:\

 

Make VHD(X) Bootable from OS on internal HDD

- add USBBootWatcher to enable Win7/8 native USB boot registry settings

UsbBootWatcher /prepare W:\Windows\System32

- add boot environment to VHD(X) for UEFI, BIOS or both PC types

cd W:\Windows

bootsect /nt60 V: /force /mbr           (works only for MBR-type disk)

bcdboot W:\Windows /s V: /f UEFI  (BIOS, or ALL)     (optional)

- add VHD(X) to the PC's boot menu

cd C:\Windows

bcdboot W:\Windows /d /addlast

- dismount VHD(X) volumes, detach VHD(X) and Shift-Restart your PC from it

- in case of boot error delete VHD(X) from Boot Menu after restart to OS on HDD, then mount and add again

bcdedit /enum

bcdedit /delete {GUID}

 

OR: Boot VHD(X) on Bare Metal PC from empty USB HDD

- Boot 64-bit WinPE 5.x or Win8.1 Install DVD in UEFI mode to X:\, if no OS installed on a new PC's internal HDD

- open Command Prompt as Admin

- clean USB HDD, convert to GPT, create, format and label 300MB Fat32 EFI System, 128MB MSR, and NTFS partitions with Diskpart script

- mount EFI volume on USB HDD to F:\ and NTFS to G:\, make System volume Active (for MBR-disk)

- create VHD(X) with Windows 7/8 applied as above, or copy it to USB HDD from network

net use N: \\server\share\folder /persistent:no

copy N:\VHD\Win8.vhd G:\Win8.vhd

- attach the VHD(X), mount EFI volume on VHD(X) (if present, optional) to V:\ and NTFS Windows to W:\ with Diskpart

diskpart

select vdisk file=Win8.vhd

attach vdisk

list volume

select volume N

assign letter=W

exit

- add boot environment to USB HDD

W:

cd W:\Windows

bootsect /nt60 F: /force /mbr         (works only for MBR-type disk)

bcdboot W:\Windows /s F: /f ALL  (or BIOS, UEFI)

- add VHD(X) to USB HDD boot menu

bcdboot W:\Windows

- reboot the PC to boot VHD(X) from USB HDD

 

 

Notes

- in case of Win7 as PC's main OS, use VHD instead of VHD(X). Install WADK (Deployment Tools & WinPE5.x) or run GetWaikTools to

obtain latest Win8.1 BCD tools, ImageX (or use DISM), add ImDisk for ISO mount. Obtain WinPE on the web or prepare with WADK

- in UEFI mode, installed Windows version must match the PC architecture. Other limitations may apply depending on OS & FW version

- updating UEFI NVRAM Boot Options is auto done at OS install, from Windows via BCD commands, or from UEFI Shell via efibootmgr

- one can Migrate OS with Backup & Restore to HDD or VHD(X) with Windows Backup or package like Acronis instead of DISM

- if transferring OS to a PC with different hardware, one needs to Generalize VHD(X) on old PC before Specializing on the new one

OR: run Sysprep on the VHD(X) booted on old PC, then reboot it on the new one

%WINDIR%\system32\sysprep\sysprep.exe /generalize /oobe /shutdown

- one may need to delete HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices key on attached VHD(X) after migrating OS to it from HDD

- when connecting the USB HDD to another PC, add VHD(X) again to its Boot Menu to boot from it. To view mounted EFI partition content,

kill explorer.exe task in Task Manager, then restart it from Admin Command Prompt

- single OS install requires only Data (Windows) partition imaging, while multiboot install may also need EFI (System) volume imaging

- if using BIOS ONLY PC, don't create & migrate EFI & MSR partitions. Format HDD & VHD(X) as MBR type, add Boot files to NTFS volume

- UEFI & MSR partitions on VHD(X) are optional to allow adding multiple Windows to VHD(X) & boot in UEFI mode, when Secure Boot is Off. One

may install Grub2, rEFInd or similar Boot Manager on UEFI, or Grub4DOS on BIOS PC to boot other OSs from disks & images

- one can test the entire process in VMWare by creating a Win8 64-bit VM Host, then add firmware = "EFI"  to the VM's *.vmx file. Install Win8.1

64-bit Guest to a hooked VHD from Win Install ISO in UEFI mode, then migrate the OS to another VHD on USB HDD hooked to the VM

- if problems booting from VHD(X) in UEFI mode, boot to WinPE, mount EFI & Windows volumes, then delete pagefile.sys, hiberfil.sys, swapfile.sys

from involved Windows volumes, and EFI folders from EFI volumes, re-add VHD to Boot Menu. Reset UEFI NVRAM settings, then select bootx64.efi

file on boot disk in UEFI Bootloader Menu. Once booted to Windows 8.1, disable Fast Startup in Power Options.

 

---------------------------------------------------------------------------------------------------------------------------

 

 

 

Is that were "Outside of Asylum" is?  :yes:   I couldn't ask a question there. Some folks posted in June 2014 that "the registration gate" on reboot.pro is closed, and apparently it still is. The site was for sale last year, traffic dropped dramatically before that, so may be they decided to close the gate forever, no new members allowed?   :whistle:

Edited by zamarac
Link to comment
Share on other sites

 

 

Is that were "Outside of Asylum" is?   :yes:   I couldn't ask a question there. Some folks posted in June 2014 that "the registration gate" on reboot.pro is closed, and apparently it still is. The site was for sale last year, traffic dropped dramatically before that, so may be they decided to close the gate forever, no new members allowed?   :whistle:

 

No, that is actually the Asylum.

I reside outside of it.

And my gate to it is closed as there is no way (anymore) to have some meaningful exchange of ideas (apart the strictly technical field) with a number of residents.

 

About site being for sale (or not) and/or increases or decreases of traffic (or Alexa ranking for that matters) those are essentially Nuno's business.

 

Instead of all this (senseless)  suppositions, have you actually tried registering there?

 

No less than three new members registered today, so I believe that there are not any issue of any kind with it.

 

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Sorry, I didn't catch what was that about - Blue Ribbon?  :rolleyes: Thanks for the link.

 

My gate to it is closed as there is no way (anymore) to have some meaningful exchange of ideas (apart the strictly technical field) with a number of residents.

Edited by zamarac
Link to comment
Share on other sites

I will try to find some DVDs burn Windows 7 on them and see if the boot on UEFI. Any particular MSDN / Digital River ISOs you'd recommend / know of that will WORK?

Any x64 ISO supports UEFI boot.

Remember: this is about basic testing still: does machine works at Windows 7 UEFI?

I expect: boot.wim is loaded to RAM and PE is processed:

either hangs next: vga.sys can't connect to VGA bios. Then ignore UEFI Windows 7 at this machine.

or does boot and Shift F10 is possible: UEFI Windows 7 is possible

 

I have a spare HDD (cant open laptop).. But I can attach via USB.. DO you think I should try installing and booting Windows 7 off that on a Partition? Just to see whether this Laptop will at all support Windows 7 in ANY mode?

Yes, this was another idea. Be aware, windows 7 doesn't support USB booting.

There are different approaches to circumvent this: different machines requires different solutions.

Basic testing: clone the Thinkpad HDD.

Boot from USB HDD at Thinkpad. A BSOD 0x7b is a good sign so far.

Connect the USB HDD to the Toshiba. Turn on the machine, press the boot select hotkey.

Do you get a USB HDD twice? One should refer to BIOS mode and antoher to UEFI mode.

Select the non UEFI mode. Again a BSOD 0x7b would be a good sign so far.

Link to comment
Share on other sites

Be aware, windows 7 doesn't support USB booting.

There are different approaches to circumvent this: different machines requires different solutions.

 

Won't that be enough? :o  If NOT, is there a more generic approach described anywhere? May be using USB_W7_Fix from wimb's IMG_XP  will do?

 

Boot ISO in UEFI Mode

 

Grub4dos won't work at UEFI.

Use bootmgr.efi and adjust bcd file.

Or use another bootloader, e.g. grub2.

Rebuild the installation environment: add mount ISO image to boot.wim 

 

Can similar approach be used to boot a UEFI ISO (WinPE or Linux based) in UEFI mode? Any more details & background?

Edited by zamarac
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...