· Windows

Natively boot Windows with a virtual HDD

A few days ago Microsoft released a new build for Windows 10 and I wanted to give it a try. However, I didn’t want to resize my partitions or overwrite my Windows 8.1 partition.

Well, then install it in a VM!

Then I wouldn’t have access to all of my RAM and CPU, so that wasn’t a solution either. However, I found the ideal solution.

Apparently you can install Windows in a virtual hard drive. Let me guide you through:

  1. Create a new VHD-file and remember the path to it. You can use Disk Management (run diskmgmt.msc) and click Action and Create VHD. I made it about 70 GB big with a dynamic size.
  2. Boot into the Windows installation (use Rufus or something similar to create a bootable USB stick).
  3. Select Custom: Install Windows only (Advanced), not an Upgrade.
  4. Now you have to select the partition on which you want to install Windows. Press SHIFT+F10 to open a command prompt instead.
  5. Enter diskpart to open the DiskPart utility.
  6. In DiskPart enter select vdisk file=C:\Windows10.vhd with the correct path to your VHD to select the VHD.
  7. Now enter attach vdisk and close the command prompt.
  8. If you now press Refresh you will see unallocated space on a newly added disk station, that is your virtual hard drive. Select it.
  9. You can now continue installing Windows as usual.

I was surprised to find out about this possibility. This way you can try the new Windows in full without compromising your production environment.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pocket

In case you have any further questions, remarks or suggestions about this post, feel free to drop me a tweet or an email! You can also find me on Slack on the Xamarin Chat. I go by the username sam_d.

About the author

Sam is a C# developer who builds mobile (cross platform) apps with Xamarin. He's been a certified Xamarin mobile developer since 2016. Sam likes to experiment with all kinds of programming languages and software frameworks. More info