Fun with Windows 7 – VHD Boot and DISM.exe


If, like myself, you need (or want) to work with more than one Operating System on the same piece of hardware, before Windows 7, you could either create a multiboot environment using separate partitions or run a virtualisation solution like VirtualPC. Both have their pro’s and con’s, most notably:



  • Multiboot:

    • Good performance (runs natively on the machine, no extra abstraction layers)

    • Good hardware integration (everything that is built into or attached to the machine is visible to the running OS)

    • Clunky setup (different boot loaders overwriting each other, partitions cannot easily be resized or moved around)

  • Virtualisation

    • Very flexible (only takes up as much hard disk space as the solution requires)

    • Can run virtually any Operating System

    • Non-Optimal performance (running piggyback off another Operating System, consuming resource in both)

    • Marginal hardware integration (all major system components are virtual only; depending on the virtualisation solution, SOME components might be surfaced inside the virtual machine)

Enter Windows 7 with VHD Boot. Like any ingenious change, it seems so mindbogglingly simple that you keep wondering why nobody had thought of it before…


“Simply” add a storage driver that surfaces a VHD file like a physical disk, support that in the boot loader and voilà – you get a multiboot scenario with the flexibility advantages of a virtualisation solution! Amongst other things, this is an ideal scenario to non-intrusively test Windows 7 on any system, even ones currently running Windows Vista (or earlier). I use this to check out how my media centre would look like in Windows 7 before actually upgrading the machine as soon as the release version of Windows 7 comes out.


Now, the walkthrough on TechNet already gets you pretty far, I won’t bother repeating all the steps described in there, however there is one piece that was missing for my machine:


The Notebook I was trying this on (Toshiba Portégé M400) ran it’s disk controller in RAID mode, requiring a mass storage device driver before it could access the VHDs.


However, with the new DISM.exe tool included in Windows 7, this was most easily overcome:



  1. Download the driver and put the driver directory onto a USB memory stick

  2. In the TechNet walkthrough, after attaching the VHD trough diskpart, all you need to do is add the driver(s) to the offline image sitting inside the VHD. Assuming your Driver sits in directory “M:\Drivers”, all you need to do is:


DISM /Image:V:\ /Add-Driver /Driver:M:\Drivers /recurse


This effectively updates the VHD image with the necessary drivers. The rest is stock standard sysprep post-processing and I ended up with a ready-to-use Windows 7 installation.

Comments (4)

  1. Anonymous says:

    NOTE: This is some advanced stuff and you may lose a finger. No warranty express or implied. There's

  2. Anonymous says:

    Hi, I've been having a lot of fun following your guidelines, however... there's always a however....
    OK i have an old dell e520 running win 8 64 bit, I decided to try and get Win7 running from a vhd on a USB. but first I tried a vhd on the C drive to see how things would go. Everything went fine til the win 7 install tried to reboot and of course failed as
    it couldn't attach, i have done this job fine with win 8! ok where I'm at is this. after the failed reboot, Windows 8 then refused to boot sighting BootBCD error, I'm guessing win 7 corrupted the store in some way. so i was left with a useless machine, no
    i didn't back up the Store, *smacks head hard with 2 x 4* after a lot of guessing I reattached the Vdisk with a win 8 install disk, installed win 8 to the Vdisk and finally it boots showing 3 entries now! 1st win 8 on Vdisk boots fine, second ( original win
    8) fails to a black screen and obviously the Win7 just doesn't exist. So my question is, how might i recover the original Win8 install. its there in the boot manager window but fails, I have tried auto repair. It would seem I lost a finger or two here.

  3. jozien says:

    Where can I download dism.exe?

    Please reply via e-mail:

    jozien@comcast.net

    Thanks

Skip to main content