How to Create Windows 8 VHD for Boot to VHD using simple, easy to follow steps

I just finished holding a few Windows 8 / Windows Server 2012 Installfests both with IT Pros in mind and with Developers in mind. Time and time again, I got asked the same questions around how to create the VHD that has the Windows 8 installation in it. There are quite a few blog posts out there and so I didn’t create my own, but it became evident to me that the ones most often referenced are very hard to follow and require lots of command line utilities that make it hard for people to duplicate. For that reason, I have decided to create my own blog post with much simpler steps using mostly GUI based tools. The steps I am outlining below can be used to create a Windows 7, Windows 8, Windows Server 2008 R2 or Windows Server 2012 VHD.

I have placed the imagex.exe in my drop box folder so feel free to grab them:

In order to perform the steps in my blog, there are a couple of things that you will need to have access to – all of which are free. I will use a deployment utility called ImageX.exe from the Windows Automated Installation kit (WAIK). Also, you will need to have some way to either mount an ISO image or have the DVD or thumb drive with the Windows 8 installation media on it. I happen to use a freeware tool called Magic ISO CD/DVD Manager to mount ISO images.

Before I provide the detailed steps, let me just provide an overview of the process.

  1. First, I need to be running Windows 7 or higher or Windows Server 2008 R2 or higher in order to perform these steps and have administrative access.
  2. I then need to create a VHD file and format it.
  3. Mount the ISO of Windows 8 (or have the thumb drive or DVD inserted or just have the source files available).
  4. Open a Command Prompt (run as Administrator).
  5. Use ImageX to “install” Windows 8 into the VHD.
  6. Add the installation of Windows 8 to the boot menu.

Now, for the details behind the above 6 steps. I will be providing screen shots of this process from a Windows 7 machine.

Create and mount VHD

  • A.  To create and mount the VHD, I will use the Computer Management console to access Disk Management. I can start this by running it from the Administrative Tools Group or right click on Computer and choose Manage.


  • B.  Once Computer Management console opens, I will click on Disk Management on left pane and wait for the list of drives to refresh. Once the list of drives appear in the middle pane, I will right click Disk Management and select Create VHD.


  • C.  The Create and Attach VHD Wizard appears. I have to provide a name of the VHD file that I want to create (specify directory location), size and type (dynamic or fixed). You can specify the size and type that meets your needs, but keep in mind that the size of the partition you set is important as you will need that much actual free disk space in order to boot to that VHD. Also the type determines how much disk space will always be in use. Since I use laptops for most of my work and I don’t have 1 TB laptop drives, I try to keep the size of all my VHDs that I use for multi-boot purposes to a minimal size. I find that 20 GB partitions is plenty and that dynamically expanding work just fine for my purposes.


  • D.  Once I click OK, the new VHD file is created and automatically mounted and visible in Disk Management. From there I right click Disk 2 and select Initialize to Initialize the disk as MBR. After the disk is initialized, I create and format a simple volume.


  • E.  After the disk has been formatted, Windows 7 automatically assigns a drive letter to the volume (in my example, it is F:). I have also mounted the ISO of Windows 8 Enterprise 90 Day Eval and it is available as drive E: in my example.


  • F.  I then start a command prompt running as Administrator and go to the directory in which my ImageX.exe is located (makes it simple and in my case it is C:\Source).
  • G.  In the command prompt, I issue the following command:
    imagex /apply e:\sources\install.wim 1 f:\

    I am essentially installing Windows 8 from the install.wim file located in the sources directory of the source files and selecting the 1st OS instance in the WIM file and installing it to drive F:\ (VHD file)


  • H.  Once the process completes, I can dismount the VHD and save a copy off for future use or immediately add it to the boot menu. To dismount the VHD, go to Disk Management and right click Disk 2 and select Detach VHD.


  • I.  Once I make a backup copy of the VHD file for future use, I will go ahead and Mount the VHD again to add that installation to the boot menu. To do this, I will right click Disk Management and select Attach VHD. The Attach VHD Wizard will start. I can either browse to the VHD or just type it in the Location field.



  • J.  The VHD will be mounted and will be assigned a drive letter by the system. In my case, it is drive F: again.
  • K.  Go back to the Administrative Command Prompt and type the following command to add the installation to the Boot Menu:

    bcdboot F:\windows


  • L.  Once the command finishes, you will now have the new Windows 8 entry in your boot menu.

The first time you boot to this installation, Windows 8 will detect your devices and install the appropriate drives and then reboot. Upon reboot, you will configure the computer name and a user account like you normally would on a new Windows 8 installation.

If you no longer want to have this option in your boot menu, use MSCONFIG (boot tab) to delete the unwanted entry.

Hopefully, this simple and easy to follow guide will help you to successfully create and boot to your own installations of Windows 8 (or Windows Server 2012).

Harold Wong

Comments (38)

  1. Harold Wong says:

    Asmar: Thanks for posting and giving me the update.  I'm glad you were able to get things going finally on your W520!!!  Interesting that you have to use the USB2.0 port on the back to boot to a Windows 7 bootable thumb drive.  I was pretty sure my W510 supported a Windows 7 Bootable Thumb drive in the USB3.0 ports on the side of my laptop.  Now, I'll have to go test that out just so I know.

    JP: It may be best for you to email me at with screenshots and such or even call me at (425) 706-3501.


  2. Harold Wong says:

    If you download each dile individually from dropbox, you are fine.  If you click the Download option from the folder, Dropbox will zip up all the files in the folder and make it available as a single download.  Using this option, you will get a corrupted file due to the overall size of the files.

    Brandon: It looks like your source files might be corrupt.  Have you tried another source?


  3. Harold Wong says:

    Ed, I'm not sure what you mean by offline.  They are live and fully accessible.  There should be 5 files in the folder.


  4. Harold Wong says:

    Serian: I'm not sure what you are trying to tell me regarding the boot menu.

    Peter: When you mount the VHD, it is not persistent.  Upon rebooting, the VHD is dismounted and not automatically remounted. So long as you did things correctly, the entry that is created doesn't really refernve a drive letter (e: in your case) but rather a disk number and partition number.  


  5. Harold Wong says:

    1. Issue with Dropbox and Error 509: I have contacted Dropbox to resolve this issue.  Please be patient while I work through this.

    2. You cannot use the VHD as imaging templates.  You also can't convert a VHD to a WIM.


  6. Harold Wong says:


    Normally, you would be able to use VHDs created in this fashion in Windows 7 Virtual PC.  The reason the ones I created don't work is that I installed 64 bit Operating Systems in these VHDs and Windows 7 Virtual PC does not emulate 64 bit hardware – only 32 bit.  Windows Server 2008 R2 and Windows Server 2012 only come in 64 bit so those cannot be run in Windows 7 Virtual PC.  If you use the Windows 8 VHD to boot from, you can enable Hyper-V and create 64 bit VMs and use the two Server VHDs in your VMs.


  7. Harold Wong says:

    Luigi: Are you sure you mounted the ISO image as drive I:?  Also, do you have enough disk space on your C: Drive to create the VHD?

    Darrell: We don't support running Windows 8 in Virtual PC.

    Dennis: Thanks!  I did get my Dropbox account reset so it should be working now.

    8675309: I'm not sure what you are referring to, but I just mounted the Windows 8 Pro ISO from my TechNet and MSDN subscription and both have the install.wim file and I do not see an install.esd.

    autobulb: Are you sure you are running command prompt as Administrator?  In the upper left of the command window, you should see Administrator: Command Prompt.  Please double check.


  8. Harold Wong says:


    1. In order to perform a Boot to VHD, the VHD file must be stored on a drive that is accessible during the initial boot process (no drivers needed).  USB devices require the OS to install the USB driver before these devices are accessible.  Therefore you CANNOT perform a Boot to VHD with a VHD file stored on a thumb drive.

    2. Depending on how you create the VHD, you can definitely attach it to Hyper-V.


  9. Harold Wong says:


    Sorry about the error.  It seems Dropbox has not fixed the issue with bandwidth utiliziation on my account.  I am working to correct this.  If you are not able to download in th enext few days, I will have the files on a thumb drive at the event.


  10. Thanks, I'll pass on the 8 GB VM's but the knowledge is good to have.

  11. Anonymous says:

    Awesome tutorial. Worked like a Charm.  @Serian, I know what you mean about the "Windows 7 boot options". Windows 8 has a nice new sexy boot options window that comes up if you do the "traditional" dual boot by carving out a 2nd partition and installing Windows 8 manually to that partition.  If you want that boot loader, then make Windows 8 your default OS.  I did that once and it came up then.  If you leave it on 30 sec timer you'll have time to switch to Windows 7 on boot up if Windows 7 is still your primary OS.

    @Harold – I was the guy at your Windows 2012 IT Boot Camp in San Diego last month who couldn't get his Lenovo Thinkpad W520 to boot from VHD. As a FYI, after completely reinstalling Win7 to a new SSD drive, I finally got it to work.  It could have had something to do with the drivers/firmware of the SSD b/c it was a ported over Windows install to that SSD from a standard hard drive.  Ironically, when I decided to try booting to Windows 8 via VHD, I found your blog! P.S. As a funny aside, I also had a heck of a time getting Win7 reinstalled on the W520 via USB stick and thought it had to due with SSD firmware issues.  Turns out I had to use the USB port on the BACK of the laptop (USB2.0) and not on the side of the laptop (USB3.0)! Windows 8 installer supported the USB 3.0 controller but not Windows 7.

    @Mike – Care to elaborate? I thought it was a pretty clever use of ImageX to get a Windows installation onto a VHD.  You got a better method if a premade VHD is not available?

  12. Harold Wong says:

    Mike: Can you please tell me why you think this information is worthless and aweful?  Thanks.


  13. Karl says:

    Harold, thanks again for the 'boot' camp. I liked the .VHD booted 2012 RC so much it turned into a favorite workstation. Oops. Any hack to copy profile from Server 2012 RC off so I can build again with RTM? All research into user profile tools seem focused on Client OS. Maybe if I make my profile roam…

  14. Doug Spindler says:

    Harold – This is great.  Thanks for posting.

  15. Ed says:


    Oh, your files at are offline [or otherwise].

  16. swapnil prajapati says:

    Thanks for post, it is very usefull

  17. Ken says:

    Wouldn't it be possible to take these vhd files and use them as templates for imaging, or do they need to be converted to wim files first?

  18. lama says:


    I am getting an error.

    Error (509)

    This account's public links are generating too much traffic and have been temporarily disabled!


  19. Aaron Perrault says:


    Are these also VHDs that I can mount and use in Windows 7 Virtual PC?  I have created the new VMCX file, mounted the VHD in disk manager, but when i try and power these devices on, I get an error.  It says Encountered an error when attempting to use one of its virtual hard disks.



  20. thomas says:

    files at not available…

  21. Mustafa Hanif says:

    thanks for the tutorial

  22. serian says:

    thanx for the guide but when i use bcdboot to create a start for a vhd image, at restart  the boot menù change to windows 7 style. 🙁

  23. Peter says:

    Everything looks good with the attached VHD and the volume is there but it goes away when I restart.  I get a boot error because it can't find e:windows….  The e volume isn't there.  How do I make the e volume stick so it's there after restarting?

  24. it seems the zip file is corrupt says:

    i downloaded this twice and it tells me the file is invalide

  25. Brendon Bunker says:

    Hello Harold,

    Thanks for this, but I am getting errors when trying to copy the burnt dvd image file to to the virtual drive. Any ideas please?

    Microsoft Windows [Version 6.1.7601]

    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.


    ImageX Tool for Windows

    Copyright (C) Microsoft Corp. All rights reserved.

    Version: 6.1.7600.16385

    [  41% ] Applying progress: 10:47 mins remaining

    [ RETRY ] Restoring K:WindowsWinSxSx86_microsoft-windows-t..predictionengine. again (Error = 23)

    [  43% ] Applying progress: 12:33 mins remaining

    [ RETRY ] Restoring K:WindowsWinSxSx86_microsoft-windows-s..chrecognizerenu.a

    le_31bf3856ad364e35_6.2.8400.0_en-us_575d2f5c80e5c65cl1033.ngr again (Error = 23

    [ RETRY ] Restoring K:WindowsWinSxSx86_microsoft-windows-s..chrecognizerenu.a

    le_31bf3856ad364e35_6.2.8400.0_en-us_575d2f5c80e5c65cl1033.ngr again (Error = 23)

    [ RETRY ] Restoring K:WindowsWinSxSx86_microsoft-windows-s..chrecognizerenu.a

    le_31bf3856ad364e35_6.2.8400.0_en-us_575d2f5c80e5c65cl1033.ngr again (Error = 23)

    [ RETRY ] Restoring K:WindowsWinSxSx86_microsoft-windows-s..chrecognizerenu.a

    le_31bf3856ad364e35_6.2.8400.0_en-us_575d2f5c80e5c65cl1033.ngr again (Error = 23)

    [  44% ] Applying progress: 13:29 mins remaining

    [ ERROR ] K:WindowsWinSxSx86_microsoft-windows-s..chrecognizerenu.ale_31bf385

    6ad364e35_6.2.8400.0_en-us_575d2f5c80e5c65cl1033.ngr (Error = 23)

    Error restoring image.

    Data error (cyclic redundancy check).


  26. mike says:

    Worthless info this was awful

  27. Brendon Bunker. says:

    Harold, thank you for your reply. You were right, some files on the dvd I burnt from the Windows 8 image file were corrupt. I burnt another dvd on another disc using Windows image burner & all is now OK.

    Thanks again, Brendon.  

  28. DotNetWise says:

    Some questions

    #1 If my vhd is on a usb stick, Can I boot to different computers that only have installed Windows 7 on their HDD?

    #2 Is it possible if I will attach it later to Hyper-V and run it from there?

  29. JP says:

    I followed your article and everything went fine but I didn't find any entry in the MSCONFIG (boot tab) please help?

  30. Luigi says:

    Hi Harold,

    by default AIK install in Program FilesAIK|Tools… so I have execute by these path (x86 subdir) and with my big surprise I have received (also to performing vkd at 25Gb):

    C:Program FilesWindows AIKToolsx86>imagex /apply i:sourcesinstall.wim 1 g:

    ImageX Tool for Windows

    Copyright (C) Microsoft Corp. All rights reserved.

    Version: 6.1.7600.16385

    Error loading image [i:sourcesinstall.wim, 1].

    There is not enough space on the disk.

    Error restoring image.

    There is not enough space on the disk.

    Where I wrong?


  31. darrell says:

    I have mounted and created a windows 8 32bit vhd for virtual pc, but it just spins at DHCP… and later says Reboot and Select proper Boot device or Insert Boot Media in selected Boot device. What am I doing wrong?

  32. Dennis says:

    Why anyone would say "Worthless info this was awful" is beyond me.  They probably aren't very technically savvy because I followed the guide to the T and I am up and running with Windows 8 on an attached VHD.  The bonus with this method is that it essentially allows you to dual boot Win 7 and Win 8 on the same system.  HUGE!  Thanks for the great info Harold!  FYI – your Dropbox link doesn't work but I didn't really need it anyway.  Thanks again!

  33. 8675309 says:

    install wim on pro iso seems to have been replaced with an esd changing ext. to wim does nothing it does not recognise it. guess i have to wait for install media to arrive to do this.

  34. autobulb says:

    I get an error when I try to run the bcdboot command: Failure when attempting to copy boot files.

    I run cmd.exe as administrator as instructed but I can't seem to shake that error. Any ideas?

  35. 8675309 says:

    my guess is its because its an upgrade( from 7. i looked @ it with both 7 zip & WinCDEmu(with hidden files enabled) but still nothing guess us consumers
    are sol if we want to do this kind of stuff.

    i do have a copy of the trial iso will try it for the time being since the dvd shipped a week & a day ago by standard mail could be a while.(they gave vista opk 7 upgrade users dhl(canada post express post/usps) level service but now their cheaping out)

  36. autobulb says:

    I tried it again and made sure I was administrator, same results:

  37. 8675309 says:

    @autobulb are you using the 64bit iso?if so then that could be why as from what your screenshot shows your using a 32bit version of 7 enterprise/ultimate which means it wont work this way only other way to do this is to boot the windows 8 installer & setup the vhd from there…/4847

    pg.3 of that totorial has the necessary commands to do it from there. it may take longer to do it this way but its known to work for situations where people dont have the correct matching architecture(eg. 64bit compatible cpu 64bit version OS)

  38. Anonymous says:

    Pingback from Rapid setup and deployment | Some Things Are Obvious