Easy way to convert a libvirt XML configuration to a format Proxmox recognizes?

abceleung

New Member
May 20, 2024
5
1
3
(Crosspost from r/Proxmox)

I have a libvirt VM (QEMU/KVM based) that has CPU pinning, PCIe device passthrough, iothread and other optimizations (it is a VFIO gaming VM) in a Fedora host. I will install Proxmox in this machine soon, and I want to recreate the gaming VM inside it.

How do I convert this XML configuration to a format that Proxmox can use? Are all config options in libvirt available in Proxmox?

AFAIK Proxmox does not use libvirt.
 
AFAIK Proxmox does not use libvirt.
Indeed. libvirt converts the XML to QEMU/KVM command-line arguments when starting a VM. Maybe you can get it to show you the command-line arguments it produces?

Proxmox supports a args: setting in its VM configuration file where you could put any QEMU/KVM command-line argument. However, Proxmox also converts all its other settings and they may interfere. And Proxmox uses a storage layer and PCI(e) device passthrough mapping and othe stuff: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_configuration

It might be best to try to recrease the VM in Proxmox as best as you can and only then see if you needs additional args: for which you can see if libvirt can tell you the command-line arguments. Proxmox designed for enterprise enviroments, so it might not be easy/possible/practical to convert your VM as is. But you might come close by manually adding stuff, if you spend the time (again) to tweak it.

EDIT: Short answer: No, there is no easy way. You can check Proxmox's command-line arguments that is procudes with qm showcmd VM_ID_NUMBER.
 
Last edited:
  • Like
Reactions: abceleung
Indeed. libvirt converts the XML to QEMU/KVM command-line arguments when starting a VM. Maybe you can get it to show you the command-line arguments it produces?

Proxmox supports a args: setting in its VM configuration file where you could put any QEMU/KVM command-line argument. However, Proxmox also converts all its other settings and they may interfere. And Proxmox uses a storage layer and PCI(e) device passthrough mapping and othe stuff: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_configuration

It might be best to try to recrease the VM in Proxmox as best as you can and only then see if you needs additional args: for which you can see if libvirt can tell you the command-line arguments. Proxmox designed for enterprise enviroments, so it might not be easy/possible/practical to convert your VM as is. But you might come close by manually adding stuff, if you spend the time (again) to tweak it.

EDIT: Short answer: No, there is no easy way. You can check Proxmox's command-line arguments that is procudes with qm showcmd VM_ID_NUMBER.
Thanks for your answer!

I guess I can compare the output of qm showcmd VM_ID_NUMBER (in Proxmox) and virsh domxml-to-native (this converts libvirt configs to QEMU command line) and try to mesh them together. It should work since both Proxmox and libvirt use QEMU.
 
Last edited:
  • Like
Reactions: leesteken
Indeed. libvirt converts the XML to QEMU/KVM command-line arguments when starting a VM. Maybe you can get it to show you the command-line arguments it produces?

Proxmox supports a args: setting in its VM configuration file where you could put any QEMU/KVM command-line argument. However, Proxmox also converts all its other settings and they may interfere. And Proxmox uses a storage layer and PCI(e) device passthrough mapping and othe stuff: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_configuration

It might be best to try to recrease the VM in Proxmox as best as you can and only then see if you needs additional args: for which you can see if libvirt can tell you the command-line arguments. Proxmox designed for enterprise enviroments, so it might not be easy/possible/practical to convert your VM as is. But you might come close by manually adding stuff, if you spend the time (again) to tweak it.

EDIT: Short answer: No, there is no easy way. You can check Proxmox's command-line arguments that is procudes with qm showcmd VM_ID_NUMBER.
BTW, what happens if Proxmox settings and args: settings overlap? Which one takes priority?
 

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!