How to install Windows 8,10,11 to VHD


  1. Download Windows ISO:

  2. Create a fixed or dynamic VHD file of size 16 GB for 32-bit (or 20 GB for 64-bit) version for Windows 8/10/11. (steps 3+4 detailed below)

  3. Attach created VHD, create a single partition and format as NTFS.

  4. Reboot from created Windows 8 DVD or USB.

  5. Select your language and keyboard layout and proceed to Repair your computer > Troubleshoot > Advanced Options > Command prompt.

  6. Run diskpart. Execute command "list volume" (without quotes) to see mapping of partitions and note drive letter where VHD file is stored.

  7. Now execute following commands to select and attach VHD:

        	select vdisk file="drive_and_full_path_to_vhd_file"  (e.g. "c:\vdisks\win8.vhd" )
    attach vdisk
  8. After exiting diskpart run setup.exe to start installation.

  9. Select language and keyboard layout when prompted.

  10. Select custom installation. Select VHD drive as destination and after confirming you will see "Installing Windows"...

  11. After first iteration of installation is finished. Remove DVD or USB to reboot and continue installation.

  12. Wait for operations "Getting devices ready" and "Getting system ready" and restart to Windows 8.


How to create and prepare VHD for Installation


VHD preparation steps can be executed also after booting from installation DVD/USB just before running setup.


Example file created is win8.vhd in folder \vdisks on drive c: with size 20 GB.

Run diskpart.exe and execute these commands:

	create vdisk file="c:\vdisks\win8.vhd"  maximum=20000 type=fixed
select vdisk file="c:\vdisks\win8.vhd"
attach vdisk
create partition primary
assign letter=v
format fs=ntfs label="Win8" quick



It takes some time and effort to code apps and maintain a website, and liters of coffee ;)