How-To Convert Physical Machine to VM


There are a few possible reasons why one may want to do this. If you have already set up a physical machine which is running very well, creating a VM out of it acts as a backup that could be run on newer and more powerful hardware as a virtualised server. Alternatively, you may be consolidating various physical machines into one single machine to save space at home, simply by virtualising everything and running several VMs on one piece of hardware (which is what I did).

For the Virtual Machine

  1. Converting the physical PC to a Hyper-V virtual machine - Just download the Disk2VHD application from Microsoft and run it.

  2. For any existing KVM/QEMU installation, the conversion of KVM's VHDX format into Hyper-V can be done using the qemu-img command e.g.

qemu-img convert -f qcow2 something.qcow2 -O vhdx something.vhdx.
And in case you are trying to do this conversion on a Windows machine instead o
f the usual scenario which is likely a Linux machine, the windows QEMU tool can also be found via this URL https://cloudbase.it/qemu-img-windows/

  1. Converting any Hyper-V over to KVM was also easy enough.

https://www.servethehome.com/converting-a-hyper-v-vhdx-for-use-with-kvm-or-proxmox-ve/


For the Server Host
Options included either using my iMac with KVM/QEMU, an Acer running Ubuntu with KVM/QEMU, or a newer Lenovo running Windows 11 with Hyper-V

  • iMac (OSX) - Whilst the WIndows installation did run on the installed QEMU, the Virtio drivers from Fedora did not work as expected.

  • Acer (Ubuntu) - Already running another Windows VM which leaves only the problem of getting the virtualised VHDX file to boot.

  • Lenovo (Hyper-V)

This was easy enough, simply enabling the Windows feature (only available on Pro versions and not Home versions).

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v


Update (29 Oct 2021)

  1. After running 2 VMs on the same physical machine for two months, my personel conclusion is not to try it with anything below 16GB RAM and 512GB hard drive.

  2. I am trying a compromise, after I had first upgraded from 8GB to 16GB RAM, only to find that I had also run out of storage space because the first VM alone took up >100GB, of using an external hard drive to store the VMs. Will update once I figure out whether there are any performance hits with this approach.