Proxmox VE is a free virtualization environment that is gaining popularity and is strongly competing with VMware (and rightly so, given the high cost of its licenses). In my case, where I use “home-made” virtualization with VirtualBox, I have sometimes needed to migrate my virtual machines to my new Proxmox virtualization environment. Here are the steps to follow (in this case, I migrated an Ubuntu machine):
1. Export the virtual machine from VirtualBox
- Open VirtualBox and select the virtual machine you want to migrate.
- Go to File > Export Appliance.
- Follow the wizard instructions and select a destination for the OVF file.
- This process will generate an OVF file and a VMDK or VDI file that contains the virtual machine’s disk. If you get a single .ova file, this is a compressed file containing the rest of the files mentioned. Simply unzip it with tar, 7zip, etc.
2. Convert the virtual disk to a format compatible with Proxmox (QCOW2)
- Transfer the disk file (VMDK or VDI) to the Proxmox server.
- Use the
qemu-imgtool to convert the disk:qemu-img convert -f vmdk -O qcow2 /path/to/disk.vmdk /destination/path/disk.qcow2Change
-f vmdkto-f vdiif you are using a VDI file instead of VMDK.
3. Create a new virtual machine in Proxmox
- Access the Proxmox web interface.
- Go to Datacenter > Node > Create VM.
- Configure the virtual machine similarly to the configuration you had in VirtualBox (number of CPUs, RAM, etc.).
- In the step to add the disk, select any temporary size, as you will replace it later.
4. Replace the new VM’s disk with the converted disk
- Stop the newly created virtual machine in Proxmox.
- Access the Proxmox console via SSH or from the web interface.
-
Move the converted QCOW2 file to the virtual machine’s disk directory in Proxmox. Normally, this directory is located at:
/var/lib/vz/images/<ID_VM>/
Where
<ID_VM>is the number of the virtual machine you created. -
Replace the original disk with the QCOW2 file:
mv /path/disk.qcow2 /var/lib/vz/images/<ID_VM>/vm-<ID_VM>-disk-0.qcow2
5. Configure the virtual machine in Proxmox
-
Edit the virtual machine’s configuration in Proxmox to ensure it uses the correct disk. You can do this from the web interface or by directly editing the configuration file at:
/etc/pve/qemu-server/<ID_VM>.conf
Ensure that the line referencing the disk points to the QCOW2 file you just moved.
- If necessary, adjust network interfaces and any other parameters.
6. Start the virtual machine
- Start the virtual machine from the Proxmox web interface.
- Verify that the operating system boots correctly and that all virtualized hardware is functioning as expected (network, disks, etc.).
Additional Considerations
- Drivers: If you have specific drivers installed in the VM in VirtualBox, you may need to install or update them for compatibility with Proxmox.
- Snapshots: VirtualBox snapshots do not transfer automatically, so if you have important snapshots, consider merging them before migration or making separate backups.
By following these steps, you should be able to migrate an Ubuntu virtual machine from VirtualBox to Proxmox without issues.
