7

I have parameters for qemu-system-x86_64, which attach unix socket as interface into VM:

qemu-system-x86_64
    -chardev socket,id=char1,path=/tmp/sock0,server \
    -netdev type=vhost-user,id=hostnet1,chardev=char1  \
    -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:00:00:14

How i can connect this interface to KVM virtual mashine, whitch created by virt-install?

UsCr
  • 191
  • 5

1 Answers1

1

It's a great question, I don't understand why there are only 4 votes and no answers. I'm in the same boat, so this is what I see: I think at some time, this was working: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sub-sect-domain_commands-converting_qemu_arguments_to_domain_xml - however, I just tried it and it doesn't work because it'll say: error: this function is not supported by the connection driver: virConnectDomainXMLFromNative. The explanation for that error is (https://libvirt.org/drvqemu.html#import-and-export-of-libvirt-domain-xml-configs):

The virsh domxml-from-native provides a way to convert an existing set of QEMU args into a guest description using libvirt Domain XML...

Note: this operation is deleted as of 5.5.0 and will return an error.

In the release notes for 5.5.0 they write:

qemu: Remove support for virDomainQemuAttach and virConnectDomainXMLFromNative APIs

The qemu implementations for the APIs mentioned above were removed and the APIs now return an error. The implementation was stale for a long time and did not work with modern QEMU command lines, generated from libvirt or otherwise.

Based on this I think it's pretty much impossible to do an "automatic conversion" without downgrading to libvirt v5.4.0 (2019-06-03). So that must be the answer. If that isn't an acceptable solution, you might want to do as I did: I ended up manually running the virt-manager 5-step "Create a new virtual machine", "Import existing disk image" and selecting some values I thought was similar to the parameters passed as commandline arguments to qemu-system-x86_64. Neither are good solutions, but I don't see other methods, unfortunately (because I also want that functionality with recent releases, if possible).

Okay Dokey
  • 11
  • 2
  • 1
    So few people actually want this that the functionality went unmaintained for years, which is why it was removed. If you think this is important, you could contribute to its maintenance again. – Michael Hampton Jul 03 '21 at 22:28
  • I think currently contributing requires knowing much more details about each setting in both qemu and virt-install, than I currently have. What I think confuses us (at least me) is that the parameters doesn't translate directly 1-to-1. In my case I had e.g. "qemu-system-x86_64 .... -device intel-hda -device hda-duplex - -vga virtio". After going through the wizard in virt-manager I think I've accomplished something "similar" but in fact I don't know the details fully/enough to know if I've created a 100% identical system with identical devices etc... But at least what I did is running (ubuntu) – Okay Dokey Jul 04 '21 at 17:47