Ever wanted to boot Windows 8 from a VHD file on a USB Hard drive? Ever wanted to take Windows To Go for a test drive? Probably not, I’ll admit, it’s kinda obscure. However, with USB 3.0 becoming more prevalent in our new Laptops and Workstations, it makes this kind of thing a lot more viable in today’s environment. What can you do with such an installation? Well, for me, it means not lumping around my laptop everywhere. It also means, I can have a whole environment, ready to go, copied on to a USB hard drive. I can then copy that VHD file and have a backup sitting on a computer somewhere if I ever need it. Plus, it’s just fun to do.
WARNING: - This will break things if not done correctly. Don’t do this on your production machine. I’d highly recommend using a spare workstation or laptop to get this running. I’ve found you can actually just do this on a Hyper-V VM. Just offline the USB DRIVE and mount as an IDE drive in the Hyper-V VM.
Prerequisites
Software
- Windows 7 USB DVD Tool
- Image X – You can also get this from the Windows Automated Installation Kit.
- Windows 8 Enterprise ISO
Hardware
- USB stick 4GB to boot from.
- USB Stick or USB Hard drive (probably 20 gb at least).
Build a bootable USB stick
Install the Windows 7 USB DVD tool and open it. Then choose the Windows 8 Enterprise ISO for the source.
Select USB Device.
Select Begin Copying.
This will then go through and copy the files over.
Create a Windows 8 VHD File
Open up Computer Mangement, and navigate to Disk Management. Right click and Create VHD.
Specify the location of the VHD file, the size and whether you would like it to be a VHD or a VHDX. It’s recommended also that if you’re using this for anything but testing then you should use a Fixed Size disk as you will get a performance boost.
**NOTE**- The VHD file needs to be on a Basic disk. This won’t work with Dynamic Disks.
Once that has been created, go back into Computer Management. Right click Disk Management and select Attach VHD
It may already be attached. If so skip this step.
Intialize the disk and create a New Simple Volume. Take note of the Drive Letter.
Mount the Windows 8 ISO.
Install the OS on the VHD file
Open an elevated Command Prompt and navigate to the location of ImageX. At the command prompt, type the following
imagex /apply M:\sources\install.wim 1 K:
Where M: is the drive letter where you have mounted your Windows 8 ISO and K: is the drive letter of the VHD file.
Boot from the bootable USB Stick
When the OS boots up, hit SHIFT + F10 at the following screen.
Run Diskpart at the command prompt. Type the following italicized text at the command prompt.
X:\Sources>diskpart
Type the following commands
DISKPART> Lis vol
In my case E:\ is my USB Hard Drive.
DISKPART> Select vdisk file=E:\windows.vhdx (E: is the USB DRIVE)
DISKPART> Attach Vdisk
DISKPART> Lis vol
In my case F:\ is the mounted VHD file.
DISKPART> Exit
X:\Sources> Bcdboot F:\Windows /s E: /f ALL /v (E: is the USB DRIVE, F: is the mounted VHD file)
To find out what all those switches mean, have a look at this web page. http://technet.microsoft.com/en-us/library/dd744347(v=ws.10).aspx
X:\Sources> Bootsect /nt60 E: /force (E: is the USB Drive).
To find out what all the switches fot the Bootsect command are have a look at this web page. http://technet.microsoft.com/en-us/library/cc749177(v=ws.10).aspx
X:\Sources> Wpeutil reboot
Now reboot, take out the bootable usb stick that we used to boot up.
You can also use this to install other Operating Systems. 😀
I used the following links to make up this guide. Hope this helps and enjoy!
http://technet.microsoft.com/en-us/library/hh825709.aspx
http://www.rmprepusb.com/tutorials/win8vhdonusb
http://www.rmprepusb.com/tutorials/win8togo
http://scn.sap.com/community/events/innojam/blog/2013/05/07/how-to-install-windows-8-into-a-virtual-harddrive
What I dont understand is how I followed every step to the tee and STILL the vhd I created exactly as you specified does NOT show up at all in disk part when I followed every bit of these instructions exactly without deviating even the slightest (save for my drive lettering). I have tried on two separate machines, and still is the vhd partition not only missing, but when I type in “Select vdisk file=E:\windows.vhdx” or .vhd (I’ve formatted both ways several times over the period of two days), I get this: “DiskPart has encountered an error: The system cannot find the file specified. See the System Event Log file for more information. There is no virtual disk selected”
I think the result is “windows.vhdx” is not real vhdx file that you created, it should be(if you follow all step) “windows8.vhdx”.
I’m so sorry, but I must tell you that your guide is incorrect.
when creating the VHD you have indeed called the file “windows8.vhdx”
then, however, you want a VHD called append “windows.vhdx”
I’m so sorry, but I must tell you that your guide is incorrect.
when creating the VHD you have indeed called the file “windows8.vhdx”
then, however, you want to attach a VHD called “windows.vhdx”
After doing all this will I be able to boot from USB from any computer without doing any of this again
I think that was the original idea but it’s been a long time since I originally posted that. I’m not even sure if that process is compatible with Windows 10. Sorry I couldn’t be of more help, let me know how you go!