ESXi to Proxmox Migration
These are some notes I took while migrating my ESXi VMs over to Proxmox. This was mostly initiated by the Broadcom acquisition, but now that I've used Proxmox, I wouldn't go back to ESXi even if it became homelab-friendly again.
Installation
- Install normally. I didn't run into any major issues other than just needing to learn the UI a bit.
- Some config items are under the root "Datacenter" object, others are on the VM host itself.
Mount ESXi datastore
You need a special FUSE filesystem driver to access the ESXi formatted partition.
wget http://ftp.us.debian.org/debian/pool/main/v/vmfs6-tools/vmfs6-tools_0.1.0-3_amd64.deb
dpkg -i vmfs6-tools_0.1.0-3_amd64.deb
Then you can mount it. Use lsblk to view the attached disks.
vmfs6-fuse /dev/sda1 /mnt/esxi
I received this warning upon re-mounting the volume weeks later, but it doesn't seem to have affected my access:
root@proxmox:~# vmfs6-fuse /dev/sdd1 /mnt/esxi
VMFS version: 6
VMFS: Warning: Lun ID mismatch on /dev/sdd1
Re-create the VM
First, create a new VM in Proxmox. This must happen first as we need the VM ID to migrate the ESXi disk to.
- Use the Q35 chipset for modern VMs.
- You can retain your previous ESXi MAC address by checking the .vmx file in the VMs source directory:
grep Address *.vmx
Copy the VMDK
Navigate to the mounted ESXi datastore.
cd /mnt/esxi/...
qm disk import 102 DiskToMigrate.vmdk vmstore
In this case, 102 is the target VM ID and vmstore is the name of the datastore in PVE.
Note: Specify the VMDK image descriptor file (.vmdk), not the "flat" file (-flat.vmdk). Example:
-rw------- 1 root root 20G Jul 16 10:54 'My VM-flat.vmdk'
-rw------- 1 root root 462 Jul 16 09:15 'My VM_1.vmdk'
If one uses the flat instead of the descriptor:
qemu-img: Could not open 'My VM_1-flat.vmdk': invalid VMDK image descriptor
copy failed: command '/usr/bin/qemu-img convert -p -n -f vmdk -O raw 'My VM_1-flat.vmdk' zeroinit:/mnt/pve/vmstore/images/110/vm-110-disk-1.raw' failed: exit code 1
Convert the VMDK to qcow2
- The default raw format is the highest performance.
- Qcow2 (QEMU Copy On Write) is a little slower but has support for snapshots, compression, thin‑provisioning
Here's how to convert to qcow2:
qemu-img convert -f raw -O qcow2 vm-102-disk-0.raw vm-102-disk-0.qcow2
You can optionally compress the image with -c. Applies zlib compression to the disk image. Loses the ability to use snapshots. Recommended only for slow, mostly-read type disks. Requires decompression/compression during access.
qemu-img convert -f raw -O qcow2 -c vm-102-disk-0.raw vm-102-disk-0.qcow2
Beware: there's no progress bar, try using time.
Lastly, attach the disk image to the VM:
qm set 102 --virtio0 vmstore:102/vm-102-disk-0.qcow2
Or use --scsi0 or --sata0 or --ide0, etc.
Note: Do not use the qm disk import syntax here -- that is for importing foreign disks into Proxmox.
Attach the new disk image
- Access the Proxmox UI
- Select the new VM > Hardware
- Click on the unused disk > Edit
- Make any config changes needed and click Add
- I found IDE and SATA worked best for Windows hosts, no risk of missing drivers at boot time
- SCSI/VirtIO works fine for Linux and OpenBSD
Important: Ensure booting from the disk is enabled and set the correct boot order in VM > Options > Boot order.
Post Boot Configuration
- Disk device changes
- Linux: The devices may change from
sdatovda, which will cause the system to drop to single user mode - If needed, boot into single user mode (
initramfsprompt) lsblkisn't available, so usefdisk -lto view disks- Remount root as read-write:
mount -o remount,rw /root - Edit fstab:
vi /root/etc/fstab - Change
sdatovdawhere applicable - Unmount root:
cd /; umount /root - Reboot or pull power if
rebootdoesn't work
- Linux: The devices may change from
- Interface name changes
- Linux: Adjust your /etc/network/interfaces file to match the new interface found with
ip addr, e.g.ens192-->enp6s18 - OpenBSD: Most likely you can simply
mv /etc/hostname.em0 /etc/hostname.vio0andsh /etc/netstart
- Linux: Adjust your /etc/network/interfaces file to match the new interface found with
- Drivers
- VirtIO driver ISO and files can be found at the Fedora VirtIO archive
- Windows: Once the driver pack is installed via the .msi on the CD, it becomes possible to use the VirtIO network and disk adapters
Physical disk passthrough-to-VM
To passthrough a physical disk, e.g. a SATA SSD acting a NAS disk:
qm set 100 -scsi1 /dev/disk/by-id/ata-MY_DISK_MODEL_SERIAL-1
- Set
100to match the target VM ID. - Use the
by-idfolder to ensure the device doesn't change across reboots, this could occur when using the /dev/sda1 syntax.
Examples I used on a virtual file host:
qm set 104 -virtio1 /dev/disk/by-id/ata-MY_DISK_MODEL_SERIAL-1
qm set 104 -virtio2 /dev/disk/by-id/usb-MY_DISK_MODEL_SERIAL-2-0:0
Remove license message
- Edit
/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js - Look for a condition check ending with
res.data.status.toLowerCase() !== 'active'and delete the line - Or just make it always return false
Setup TLS for web UI
Install private key AND certificate into web UI. Here's where they'd be on an OpenBSD CA server:
cat /etc/ssl/private/proxmox.key.pem
cat /etc/ssl/ca-server/intermediate/certs/proxmox-chain.crt.pem
Setup local NTP server
Set new server:
nano /etc/chrony/chrony.conf
Check logs:
journalctl --since -1h -u chrony
Check status:
chronyc tracking
Add free update repository
- Edit
/etc/apt/sources.list.d/proxmox.sources - Then reload the package repository page
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
Helpful Commands
Disk commands:
lsblk- List block devicesblkid- Show information about a specific block devicefdisk- normal UNIX CLI fdiskcfdisk- DOS-style partition editormkfs.ext4 -L PVEISOSTORE /dev/sde1- Format an ext4 partition with a labelwipefs -a /dev/sde- Clear all the partitions on a device, likediskpart'scleancommandsystemctl daemon-reload- Daemon reload, needed to reload/etc/fstabchangesmount -a- Mount everythingethtool -A eno1 rx off tx off- Disable flow control oneno1pve-firewall status- Check firewall status