Jump to content











Photo

Test new OS Releases on VHD without affecting Legacy OS

vhd win xp win 7 boot

  • Please log in to reply
5 replies to this topic

#1 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 13 November 2011 - 05:52 PM

TEST NEW OS RELEASES ON VHD WITHOUT AFFECTING LEGACY OS

Do you have an older Win XP system as your trusted workhorse, and want to test new and oncoming Windows releases without uninstalling Win XP first? You can do it easily by installing the new OS onto a VHD, and booting it natively from your existing system drive. How?

Lets say, you downloaded Windows 7 or 8 Setup ISO (which is based on WinPE), and want to test how the new system looks and feels. Fisrt, backup your Win XP system drive with a Backup Tool of your choice. Then boot from the Setup ISO and follow Install and Boot Unsupported OS from VHD Tutorial to add WinVBlock driver to its running WinPE, then mount the ISO and VHD inside it, and install OS online to the VHD as a normal HD volume. If the OS version being installed supports native boot from VHD, you don't need to add WinVBlock driver to it, only add it to WinPE to mount the Setup ISO after boot. Alternatively, install OS to the VHD offline by following alternative method described in Step 4 of that Tutorial.

1. Create a Base VHD Disk:
If you didn't create a VHD beforehand, you can do it inside the running Win Setup PE.
diskpart

create vdisk file=C:VHDSwindows7.VHD maximum=40960 type=expandable

select vdisk file=C:VHDSwindows7.VHD

attach vdisk

create partition primary

assign letter=V

format quick label=Windows 7 VHD

exit
2. Install new OS to the Base VHD:
Click Alt+Tab to switch to Win Installation Menu, click Install and select the attached VHD as your target drive. Ignore "Can't install to VHD" warning. When asked to restart the system, reboot to finish install. If not booted straight to the VHD, use Grub4DOS to boot Win Setup ISO again - it will finish the install. If not proceeded, attach again VHD in Command Prompt, switch to Win Installation Menu, select the VHD and click Install - it will proceed with finishing the installation. Alternatively, you can attach the VHD and add it as a new drive to a Virtual Machine like Hyper-V, VMWare or VirtualBox VM, or attach the VHD inside the VM, connect your Setup ISO to it, and install & test run the new OS inside the VM. Make sure your PC complies with HW and SW requirements of the selected VM for a host and guest OS to be installed. If you installed OS inside a VM, it may need to be generalized with Sysprep before booting from VHD on a real PC.
3. Copy boot environment and configuration files from the VHD to the host system drive:
When installing Win 8 to a VHD, boot environment files will be automatically copied to your host system drive, replacing your Win XP or Win 7 Boot Menu. Don't worry - your legacy Win XP and Win 7 will boot just fine with Win 8 bootloader. If you want to install and test Win 7 on VHD, manually add Win 7 boot environment to the host drive - again, it will boot your Win XP just fine. Or instead, you can add boot environment to the OS on VHD (see Create Native Boot VHDs steps 4-5) and install a Virtual Disk Driver like Firadisk or WinVBlock to it (make sure the drivers support your OS version), and boot the VHD with Grub4DOS added to your host system, thus keeping legacy Win XP Boot Menu intact. Copy bootsect.exe suitable for OS type on the VHD (32 or 64-bit) from the Installation ISO or Win 7 WAIK.
cd v:windowssystem32

bootsect /nt60 c: /force /mbr

bcdboot v:windows /s c:

bcdedit /store c:bootbcd /copy {default} /d "Windows 7 VHD boot (locate)"
Insert below the {new_guid} from the above BCD entry copy:
bcdedit /store c:bootbcd /set {new_guid} device vhd=[locate]windows7.vhd

bcdedit /store c:bootbcd /set {new_guid} osdevice vhd=[locate]windows7.vhd

bcdedit /store c:bootbcd /default {new_guid}

bcdedit /store c:bootbcd /set {new_guid} detecthal on
4. Add your Win XP OS entry to the new Boot Menu:
bcdedit /store c:bootbcd /create {ntldr} /d "Chain Legacy Bootloader"

bcdedit /store c:bootbcd /set {ntldr} device partition=c:

bcdedit /store c:bootbcd /set {ntldr} path ntldr

bcdedit /store c:bootbcd /displayorder {ntldr} -addlast
5. Specialize the new OS on VHD:
Reboot to your system drive - it will present a new Boot Menu. Select Windows 7 (or 8) VHD entry from main or Grub4DOS menu - it will boot straight to your new OS, with installing extra drivers as required. Finally install your apps and start testing the new system. If you want to boot instead to your legacy Win XP - just select its entry from the Boot Menu. When you decide to test another OS release - install it to a new VHD, and add its boot entry to the host Boot Menu.
6. Reset Boot Environment to Legacy Boot (if needed):
When you are done with testing the new OS, proceed with installing it instead of Win XP. If dissatisfied, reboot to Win XP, attach the new VHD and simply delete its boot entry from host's Boot Menu, then detach and delete the VHD file.
diskpart

select vdisk file=C:VHDSwindows7.VHD

attach vdisk

assign letter=V

cd v:windowssystem32

bcdedit /store c:bootbcd /v

bcdedit /store c:bootbcd /delete {current_guid} /cleanup

detach vdisk

exit
Your Win XP will keep working fine with the new Boot environment. If you want to restore Win XP native Boot Menu, there are several ways to do it:
bootsect /nt52 c: /force /mbr
Note, your Win XP Boot.ini file will remain untouched by the above VHD setup, and ready to boot your trusted legacy system. Alternatively, you can boot from Win XP Recovery CD and repair boot, or install EasyBCD Boot Manager, and use its BCD Backup & Repair feature to revert changes.

You just learned, how to use VHDs to install and test new OS releases without uninstalling your existing legacy OS. All code in this and my other VHD Tutorials is given as "example" ONLY, a user might need to modify based on his system config and feedback. :clap:

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 November 2011 - 06:09 PM

Are you sure you want to run:
BOOTSECT /NT52 V: /FORCE /MBR
Isn't V: the drive letter of the VHD? :unsure:

For the record the /MBR switch was added on 7 (it is not there in Vista :ph34r:).

And you need to remember to make a copy of the bootsect.exe file out of the testing environment.

If needed MBRFIX can do the same kind of code replacement:
http://www.sysint.no...ting/mbrfix.htm
http://reboot.pro/4530/


:cheers:
Wonko

#3 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 13 November 2011 - 06:17 PM

Thanks, good suggestions. :)

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 November 2011 - 08:24 PM

Maybe this is useful to expand on the topic:
http://www.markwilso...xp-computer.htm

:cheers:
Wonko

#5 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 20 November 2011 - 08:24 PM

BOOT WIN XP VHD with Grub4DOS WITHOUT EXTRA DRIVERS ?

What's interesting about the described method of testing new OS releases on VHDs, it might also allow us to boot a WinXP from VHD by starting Grub4DOS from Windows Boot Menu, and then chainloading Bootmgr in Grub4DOS:

It might require no installation of extra drivers like FiraDisk or WinVBlock into OS on VHD, and no associated bugs to deal with - lets try it yourself: :dubbio:

- create a VHD in Diskpart or Win7 Disk Management
- install WinXP to it in a VM, OR attach in a P2V Backup package and transfer your existing WinXP system drive to it
- generalize installed OS if required depending on where you want to boot it
- boot from Win7PE, attach the VHD and add Win7 boot environment and WinXP boot entry to it as shown

Type in Command Prompt:

diskpart

select vdisk file c:vhdsWinXP.vhd

attach vdisk

assign letter=v

exit

cd x:windowssystem32

bootsect /nt52 v: /force /mbr

bcdboot x:windows /s v:

bcdedit /store v:bootbcd /create {ntldr} /d "Chain Legacy Bootloader"

bcdedit /store v:bootbcd /set {ntldr} device partition=c:

bcdedit /store v:bootbcd /set {ntldr} path ntldr

bcdedit /store v:bootbcd /displayorder {ntldr} -addlast

Now you're ready to try booting the WinXP VHD with Grub4DOS on your PC from an internal or external SATA / IDE hard drive (or a USB Thumb with some extra effort) - just add this section to Grub4DOS Menu: :)

title Win XP VHD

find --set-root /WinXP.vhd

map /WinXP.vhd (hd0)

root (hd0,0)

chainloader /bootmgr

boot

DONE. Is it? :idea:

Even if it doesn't boot, it gives you better understanding, why WinXP can be started by Win7 Bootloader from a hard drive, but not from a VHD outside of VM without extra drivers allowing OS during boot process to see the VHD disk. In contrast, Win 7 has VHD drivers included, and it makes the VHD available to OS during boot. :huh:

#6 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 10 January 2012 - 02:43 PM

IMHO having BOOTMGR as "additional" or "optional" is safer and provides the user with the same "features" you just listed.

Yep :), that would be the simpler/safer way, see diddy's grub4dos guide:
http://diddy.boot-la...ws.htm#windows1
http://diddy.boot-la.../boot.htm#vista


A menu.lst entry for grub4dos to load BOOTMGR can be as simple as:


title BOOTMGR
chainloader /bootmgr

the root should already be Active partition.
Or, to make sure (first partition of first hard disk):

title BOOTMGR
root (hd0,0)
chinloader /bootmgr

or:

title BOOTMGR
find --set-root /bootmgr
chinloader /bootmgr


The BCD is hardcoded to bootBCD if I recall correctly, so you should have in root:
  • BOOT.INI
  • BOOTMGR
  • grldr
  • menu.lst
  • NTLDR
  • bootBCD

Sounds like a nice alternative method to add Bootmgr for testing new OS releases on VHD without affecting existing legacy OS install. :thumbsup:





Also tagged with one or more of these keywords: vhd, win xp, win 7, boot

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users