Skip to main content

Export a Proxmox VM to VirtualBox

Example VM

I want to export the pfsense-deleteme VM and import it into VirtualBox. The procedure can effectively be reduced to:

  1. Convert the VM's disk to VDI format
  2. Copy the VM's disk to the host running VirtualBox
  3. Create the VM in VirtualBox
  4. Attach the VDI disk from Proxmox to the VirtualBox VM

Identify the VM

qm list

image.png

In the output of qm config 100 we can see the scsi0 disk is stored at local-zfs:vm-100-disk-0

qm config <vm_id>

image.png

qm stop <vm_id>

image.png

Convert the Disk

First, we'll get the path to the disk using pvesm path and the volume name for scsi0 as shown above.

pvesm path volume-name:vm-???-disk-?

image.png

Next, we'll get the storage format type of the disk. We can see it is Raw format.

pvesm list volume-name --id <VM_ID>

image.png

Finally, we'll convert the disk to .vdi format.

qemu-img convert -f <source_format> -O <destination_format> /path/to/source /output/path

From qemu-img --help:

Supported formats: alloc-track backup-dump-drive blkdebug blklogwrites blkverify bochs cloop compress copy-before-write copy-on-read dmg file ftp ftps gluster host_cdrom host_device http https iscsi iser luks nbd null-aio null-co nvme parallels pbs preallocate qcow qcow2 qed quorum raw rbd replication snapshot-access throttle vdi vhdx vmdk vpc vvfat zeroinit

This command does not produce any output, so please be patient as it can take a while for large disks to convert!

image.png

We can see the conversion was a success!

image.png

Copy the File Locally

# Enter root password when prompted
# Copy /tmp/pfsense-disk.vdi to user desktop

# Windows
scp root@pve-node:/tmp/pfsense-disk.vdi C:\Users\user_name\Desktop\pfsense-disk.vdi

# Linux
scp root@pve-node:/tmp/pfsense-disk.vdi /home/user_name/Desktop/pfsense-disk.vdi

I am using -i private key authentication to my PVE node in the screenshot below

image.png

image.png

Create the VM and Attach the Disk

Create the VM

image.png

Set your desired CPU specifications. Click Next. Click Use an Existing Virtual Hard Drive File and click the folder icon.

image.png  image.png

Momentarily open your file explorer and move the .vdi file to the VM's destination. Right-click the .vdi and choose Cut.

image.png

Open C:\Users\user_name\VirtualBox VMs and open the folder for your target VM. Paste the file in the target folder.

image.png

Now, go back to your VM creation dialog. Click Add.

image.png

Choose your .vdi file from this prompt. Then click Choose.

image.png

Click Next.

image.png

Click Finish

image.png

Test the VM

image.png