This is how I create VHDX files during Windows setup, first formatting a blank disk, creating a VHDX virtual hard disk, and then installing Windows on the disk.
- Insert the Windows Server 2012, 8.1, or 7 DVD or bootable USB key. I always use a USB key as it is so much faster.
- Press SHIFT-F10 to get to a command prompt when setup is loaded.
- Type in diskpart
- list disk (note the disk ID)
- select disk 0 (assuming that it was listed as disk 0)
- create partition primary
- select partition 1
- format fs=ntfs
- create vdisk file=”C:\disk1.vhdx” maximum=50000
- attach vdisk
No go back to setup and click through to the disk selection screen, or refresh if you were already there, and you will see the virtual disk. Windows will say that it cannot be installed onto this disk but just press next and it should install and boot with no issues.