Exporting VMs for use on another platform

Apr 16, 2021
60
14
8
35
Sadly, I must tear down my server and re-purpose the hardware as a desktop machine. I'll be using KVM/libvirt for virtual machines on the desktop.

How do I export proxmox VMs for use with that technology? Is there anything in particular that is required? Would it be easier to just transfer across to a new VM environment using clonezilla?
 
There are many "depends". You need to understand what format the virtual disks are in, if they are qcow or raw on file storage - just copy them over. If you are using any block or volume type storage (lvm,zfs,etc) you need to convert to qcow/raw.
Then you need to convert the VM config file from Proxmox format to whatever your target hypervisor will be. If its direct KVM then you can start the VM, look at the running command line and convert it to XML file that KVM/libvirt expects:

Code:
/usr/bin/kvm -id 2000 -name vm2000 -no-shutdown -chardev socket,id=qmp,path=/var/run/qemu-server/2000.qmp,server=on,wait=off -mon chardev=qmp,mode=control -chardev socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5 -mon chardev=qmp-event,mode=control -pidfile /var/run/qemu-server/2000.pid -daemonize -smbios type=1,uuid=a0370210-9975-435a-9c90-4b42df2ceb04 -smp 1,sockets=1,cores=1,maxcpus=1 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg -nographic -cpu qemu64 -m 256 -device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e -device pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f -device vmgenid,guid=5e9a583f-5a22-4b93-8124-e5200e82a4d2 -device piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2 -chardev socket,id=serial0,path=/var/run/qemu-server/2000.serial0,server=on,wait=off -device isa-serial,chardev=serial0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-name=iqn.1993-08.org.debian:01:ade92047c036 -device virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5 -drive file=/dev/bbpve/bbqct1:vm-2000-disk-0,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on -device scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100 -netdev type=tap,id=net0,ifname=tap2000i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown -device e1000,mac=3E:9D:6B:B6:BA:59,netdev=net0,bus=pci.0,addr=0x12,id=net0 -machine accel=tcg,smm=off,type=pc+pve0

search around, there may DIY scripts/tutorials available.


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
There are many "depends". You need to understand what format the virtual disks are in, if they are qcow or raw on file storage - just copy them over. If you are using any block or volume type storage (lvm,zfs,etc) you need to convert to qcow/raw.
Then you need to convert the VM config file from Proxmox format to whatever your target hypervisor will be. If its direct KVM then you can start the VM, look at the running command line and convert it to XML file that KVM/libvirt expects:

Code:
/usr/bin/kvm -id 2000 -name vm2000 -no-shutdown -chardev socket,id=qmp,path=/var/run/qemu-server/2000.qmp,server=on,wait=off -mon chardev=qmp,mode=control -chardev socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5 -mon chardev=qmp-event,mode=control -pidfile /var/run/qemu-server/2000.pid -daemonize -smbios type=1,uuid=a0370210-9975-435a-9c90-4b42df2ceb04 -smp 1,sockets=1,cores=1,maxcpus=1 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg -nographic -cpu qemu64 -m 256 -device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e -device pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f -device vmgenid,guid=5e9a583f-5a22-4b93-8124-e5200e82a4d2 -device piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2 -chardev socket,id=serial0,path=/var/run/qemu-server/2000.serial0,server=on,wait=off -device isa-serial,chardev=serial0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 -iscsi initiator-name=iqn.1993-08.org.debian:01:ade92047c036 -device virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5 -drive file=/dev/bbpve/bbqct1:vm-2000-disk-0,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on -device scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100 -netdev type=tap,id=net0,ifname=tap2000i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown -device e1000,mac=3E:9D:6B:B6:BA:59,netdev=net0,bus=pci.0,addr=0x12,id=net0 -machine accel=tcg,smm=off,type=pc+pve0

search around, there may DIY scripts/tutorials available.


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Hi,
thanks for the hint.

It seems we can use the command:

Code:
virsh domxml-from-native qemu-guest1 demo.args

where

Code:
$ cat demo.args
LC_ALL=C
PATH=/bin
HOME=/home/test
USER=test
LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb


Converting QEMU Arguments to Domain XML
 
  • Like
Reactions: bbgeek17

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!