Migrating from VMware ESXi to Proxmox

So, news that VMware is going subscription only is not going well with some home labbers however lots of home labbers are already using Proxmox. Since Broadcom’s announcement of their purchase of VMware I’ve been slowly transitioning over to Proxmox and phasing out ESXi at home. There is a touch of sadness as I used to work for VMware and always loved using their products.

Assuming you have a Proxmox host or two up and running – how do you move a VMware VM over to it?

Simplest solution I’ve discovered is to have a common NFS share between an ESXi host and a Proxmox host. In my home lab I have an NFS share called FS02VMs that is mounted in both environments. In vCenter if you are running it, you need to migrate your vm’s storage to the NFS share.

Once the VM is moved to NFS – you can go to your Proxmox web interface and create a new VM with settings that match or are close to those of the VM you want to import. It is important here however that you do not create a hard disk in Proxmox for this VM as we will be importing it from the NFS share. Once the VM is created you need to make a note of the VM ID. You will also need to make a note of the original VMware VMDK name.

My Proxmox host I want to import to has a local LVM storage attached called NVME_LVM and the VM I want to import is an Ubuntu Linux 22.04 VM and is called test.lab.sweetnam.eu.

The fist step involves connecting to your Proxmox host via ssh and change directory to your NFS mount where your ESXi VM is located. The NFS mount will be under /mnt/pve and as mentioned already mine is called FS02VMs so I need to change directory to /mnt/pve/FS02VMs.

Under this directory is the folder with my ESXi VM so change directory into it. The VMDK I want to import is called test.lab.sweetnam.eu.vmdk

There might be other VMDK names or ones with flat.vmdk in the name. We only want the main VMDK which may be just a KB or so in size!

So now you have your Proxmox VM ID and you have the storage you want to import it to and you have the VM ready to import it to on Proxmox and it’s time to begin.

From the directory with the VMDK you just need to type in the following command:

qm importdisk 110 test.lab.sweetnam.eu.vmdk NVME_LVM --format raw

You can see the VM ID is 110 and local storage is NVME_LVM

After a while it will be imported and attached to the VM but not quite ready for use yet.

You need to go to the VM hardware page – you will see that your imported disk is there but it’s unused. Simply double click on it to get your VM to use it. It is usually ok to keep the defaults. If your storage is SSD then you should click on the “Discard” checkbox. If your VM is Windows 10, 11. Server 2019 or newer you need to make a few more changed. More on this further below.

Almost ready now to boot the VM for the first time but first we need to make sure the VM is configured to boot from the disk. Again in the VM settings, click on Options and then “Boot Order”. Remove the checks from all but your hard disk. Now go to the console and start your VM and get ready for some configuration of the guests.

Linux

If your imported disk is Linux – the first thing you will notice is that VM may take a very long time to boot and/or you have no network connectivity. This is because the ethernet device will have changed.

Simply run : dmesg | grep eth to get the new interface. For my test VM the original interface was /dev/ens192 and the new device name was /dev/ens18

For Ubuntu 20.04 and 22.04 you need to edit the netplan config located in /etc/netplan. There is probably only a single file in that directory and I have seen it with a few different names. In my VM is is called 00-installer-config.yaml

All you need to do is use your favourite editor to change the old interface name to the new one.

If you are using Debian or an earlier Ubuntu version then you will need to change the interface name in the file /etc/network/interfaces

Regardless of your distribution you should remove open-vm-tools and also install the QEMU Guest Agent. On Debian/Ubuntu this is a simple apt install qemu-guest-agent.

Once the guest agent is installed you need to power off the VM, edit the Options and make sure “QEMU Guest Agent” is enabled. Be sure to do this after powering off the VM. Once it’s enabled power on your VM and you should be good to go!

Windows

If you are using a recent version of Windows from 10 up or Server 2019 and up you will need to change the BIOS from Proxmox default of SeaBIOS to OVMF (UEFI) in the hardware settings.

As the VM is imported from VMware it should have the required EFI partitions on it already so you can ignore any EFI messages that appear.

Once your Windows VM boots successfully you probably won’t have networking on it. However first things first – you should uninstall VMware tools and remove any VMware devices in Device Manager.

You will also need to install the VirtIO drivers. For this you will need to download the latest ISO from here:

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/?C=M;O=D

You can upload the ISO to your Proxmox host and then add it as a CD-ROM device to your VM.

Run the installer in your VM and shutdown the VM when complete. Next edit the VM Options and make sure “QEMU Guest Agent” is enabled and power on the VM.

Once booted you probably won’t have any network connectivity or a DHCP address if you were using static. In this case simply change the network settings for the VirtIO network adapter.

FreeBSD

Importing a FreeBSD disk is fairly forward however my boot device changed on first boot and it it couldn’t mount the root file system. Thankfully FreeBSD will prompt you to press ? for a list of devices and you can enter the relevant one to get your root filesystem.

MAKE A NOTE of the devices. In my case there were two – the root UFS file system which was now called /dev/ada0s1a and the swap which was now called /dev/ada0s1b

Once booted edit /etc/fstab and change the devices to the new ones.

You wil also probably find like Windows and Linux that you have no networking – in the case you need to get your new network card name with dmesg | grep Ethernet and then edit /etc/rc.conf to change the old name to the new one. Then reboot!

If it boots correctly you can then proceed with removing open-vm-tools if installed and installing the qemu-guest-agent. Like Windows and Linux you will need to shutdown the VM and power it on again for Proxmox to pickup the QEMU Guest agent.

Conclusion

It takes quite some time to import even small 40Gb VMs but this is a network limitation more than anything else.

I completed my migration today and I now have 4 hosts with 14 VMs of which all 14 were imported from ESXi. There are 3 Windows VMs, 2 FreeBSD VMs and 9 Debian and Ubuntu VMs all now performing as good as they were on ESXi.

Leave a Reply

Your e-mail address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.