Powershell – Convert Hyper-V .vhdx file for import into .vhd file for xenserver import

conversionhyper-vpowershellvhdxenserver

A VM was sent to me as .vhdx instead of .vhd and I need to import it into xenserver which supports .vhd but not .vhdx.

I looked at the following solutions:

The problem with using powershell, is you need to have either Windows2012 or Windows 8.1 but with the Hyper-V role installed to get the proper cmdlets.

I only have access to Windows 2008r2 and Windows 8.1 without the Hyper-V role installed.

My other options would have been to attempt to gain access to a server with Hyper-V and use powershell to run the convert-vhd command on the remote server but I am not even sure if powershell commands can be ran like that. (ie: running hyper-v cmdlets on a remote server which doesn't have hyper-v cmdlets.)

Best Answer

To determine your Windows version, pressWin+x and select "System". Your version will be near the top, under "Windows edition". Only 64-bit versions of Windows 8/8.1 Professional and Enterprise support Hyper-V. You also won't be able to enable Hyper-V if your processor's visualization support is not enabled (AMD-V for AMD and VT-x for Intel)

As an alternative, you could install VirtualBox and use VBoxManage.exe to convert from VHDX to VHD like so:

vboxmanage clonehd filename.vhdx filename.vhd -format vhd

Caveat: I just tested this and it successfully converted however I did not test it beyond that.