Friday, September 16, 2011

Guide to install Windows 8 on a VHD (Virtual Hard Disk)

Yesterday I posted a blog about installing Windows 8 on a virtual machine. Easy to do, but not exactly what I want. This because i think it's better to create a VHD (Virtual Hard Disk) and use the full resources of your device. Today my second install of Windows 8 takes place, this time on a VHD. The following steps are needed to get it done.

1) Download the Windows 7 USB/DVD download tool and install it on your Windows device. Download
2) Start the Windows 7 USB/DVD download tool and follow the steps. Select the Windows 8 ISO and use a empty USB device (4GB min.)

Select the Windows 8 ISO file on the hard disk

Use an empty USB device for installing Windows 8

Select the empty USB device and start/begin copying

Copy job is done and the USB device is ready to use now!

3) Open Disk Management and create a VHD file with Action > Create VHD. I've selected a dynamically expanding 20GB Virtual Hard Disk.

It's also possible to use DISKPART for that, but I'm just a GUI user. The steps needed for this will be then:
  • DISKPART
  • CREATE VDISK FILE="D:\VHD\Win8.vhd" TYPE=Expandable MAXIMUM=20000
  • SELECT VDISK FILE="D:\VHD\Win8.vhd"
  • ATTACH VDISK
  • CREATE PARTITION PRIMARY (optional)
  • EXIT
Just create a VHD file on your hard disk with enough free space

4) Now it's time to start from the bootable USB device. Choose USB when booting in the BIOS boot order menu. Windows 8 installation is starting then from the USB device!
5) Choose for a Custom installation, dont select an existing partition but just press SHIFT-F10 for a command window. Now choose the following commands:
  • DISKPART
  • SELECT VDISK FILE="D:\VHD\Win8.vhd" (Use List Disk in Diskpart to see what's drive the VHD is on. It's different then usual, so see comments for that one)
  • ATTACH VDISK
  • EXIT
6) Select the Windows installation screen again and press Refresh. That way the new created VHD partition becomes available.
7) Just install Windows 8 on the selected VHD partition, and let the magic happen! It will takes some time..

During installation a few reboots are needed. After that Windows 8 will be started. Select your network connection (wired/wireless) and start working immediately. There are default Apps for Twitter and Facebook available, so there's enough to do and see ;)

After the next restart a boot menu becomes available. When choose Options here, there's the choice between Windows 7 (existing OS) and Windows Developer Preview (a.k.a. Windows 8).

Both Operating Systems can be used by now, no need to use a virtual machine (or something like that) anymore. Just experience the full OS on full screen with all hardware resources available! Mine is running on 1680x1050 and wireless connection. That way Windows 8 will let you experience the true functionality.

Update: This guide can also be used for Windows 8 Consumer Preview. Just remember to write down the product key needed.

Update 1-3-2012: When the 0x000000f error is showed on first boot, and no OS can be started at all, just try the following:
  • Boot from USB to be able to select your Windows (7) OS
  • Remove Windows 8 from boot order with BCDEDIT
  • Disable BitLocker (!)
  • Try again…
Thanks to @micmyh for support on this!

Update 1-6-2012: This guide can also be used for Windows 8 Release Preview. Just remember to write down the product key needed.

27 comments:

  1. Goed gedaan Henk,

    Waar jij een USB gebruikt, heb ik een DVD gebrand.
    Voor de rest was het een peuleschilletje.

    Nu nog even de aanwijzingen hoe deze VHD-installatie van Windows8 ongedaan te maken, zodat Windows 7 weer het standaard boot systeem wordt.

    MVG
    Mattie

    ReplyDelete
  2. Really good guide. But what then if I want to remove the windows 8 and the vhd too while maintaining the original win7 install?

    ReplyDelete
  3. Hi, thanks for compliments.
    I will write a new blogpost about removing the VHD and keep existing Windows 7 installation later today. Stay tuned for more!

    ReplyDelete
  4. Thanks, this really help a lot, even more than the WAIK Method.

    fr33

    ReplyDelete
  5. Thanks for mention, creating a VHD is really easy and very helpful!

    ReplyDelete
  6. Thanks Henk for such an elaborated guide. I'll surely install my copy of Windows 8 by following these steps only. Thanks for sharing.

    ReplyDelete
  7. when i boot from cd and select vdisk file i get an error file not found. i think when i boot from usb the interface does not see my intarnal hdd

    any sugestions ?

    ReplyDelete
  8. sorry the error is " the athname fpr virtual disk must be fully qualified. There is no virtual disk selected."

    ReplyDelete
  9. Creating a VHD with a path longer than 14 characters fails with “The pathname for a virtual disk must be fully qualified.” error. A workaround is to create a VHD file at root level and move it to desired place afterwards. In my case D:\VHD\Win8.vhd is working fine.

    ReplyDelete
  10. sorry i got an error while installing win8. when i try to attach the vdisk file it shows that path is not found. can u help me pls??

    ReplyDelete
  11. if you're getting errors it's probably a drive letter issue. in diskpart run the command 'list disk'. you'll see the physical drives on the machine with numbers on them. Then type 'select disk x' where x is the number of the disk with the os on it. NOW you can do 'list vol' and you'll see a set of drive letters that is probably different from what you'd expect. Be sure to pick the drive letter of your main os and create a vdisk and attach there. don't just type in c: or d: because you're probably putting .vhd files on some other partitions.

    I got my steps from here:
    http://blog.concurrency.com/infrastructure/dual-boot-windows-8-from-vhd-using-windows-setup/

    ReplyDelete
  12. Got an error on the first boot. 0x000000f and couldn't start either of my OSes.

    Resolution:
    - Boot from usb to be able to select my win7 OS.
    - Remove win8 from boot order with bcedit
    - Disable BitLocker (!)
    - Try again…

    Hope this will help others

    Michael

    ReplyDelete
  13. That's right about the drive letter issue. Yesterday I followed above steps again with a VHD file on my D: drive. In Diskpart it was mapped as F: drive, so you can use List Disk in Diskpart for a overview of drives.

    ReplyDelete
  14. VERY IMPORTANT: You should ADD ....
    under 5) beneath
    diskpart ...type
    list vol

    so people can find out under what drive letter their vhd file is ;)

    ReplyDelete
  15. Booah! What a fast install onto a vhd file within windows 7 on my ssd :)

    ReplyDelete
  16. create vdisk file c:\win7\myothervhd.vhd maximum=20000 [correct format]

    create vdisk file c\win7\myothervhd.vhd maximum=20000 [incorrect format] this can be the reason why

    ReplyDelete
  17. i got an error like you should enable disk controller in bios setup . I search in bios but couldn't find it

    ReplyDelete
  18. same prob as the last person. i was able to install cp to a vhd with no issues. but rp wont let me select the vhd as the installation drive. lame.

    ReplyDelete
  19. Thanks for this detailed post, Henk! Readers might also be interested in the new PowerShell WIN2VHD tool which they may find a bit easier of a scripted process to create Windows 8 VHDs either for Boot-to-VHD or VM scenarios. Details are available here: http://aka.ms/ToolWIM2VHD

    HTH,

    Keith

    ReplyDelete
  20. The post is a guide to install windows 8 on vhd. Good post

    ReplyDelete
  21. This is very easy. Thanks for sharing the updates here

    ReplyDelete
  22. Hi,
    I would like to get your sincere advice on the following scenario.
    I have physical Serve running Server 2012 R2. Hyper-V is installed and have configured few VMs.
    I am able to access the internet on all VMs (VM Network configured with WiFi).
    Everything is fine here, now question is if its possible to connect with these VMs via internet? Without purchasing a dedicated/Public IP?

    Target is to build VMs for our customers and let them manage their VMs remotely.
    I know I can use TeamViewer but seems like not a best option.

    /Naveed

    ReplyDelete
  23. Wonderful article. Thanks for taking the time to discuss this. Your blog provided us valuable information to work on. I like the valuable information you provide in your articles.

    ReplyDelete
  24. Brillian thanks. It works With Windows 10 as the main OS and 8.1 on a VHD too. The only bit of feedback is that it woudl be much more readbale if you were to integrate the comments from 'AnonymousFebruary 29, 2012 at 6:03 PM' into the main article

    ReplyDelete