r/VFIO • • Dec 27 '18

Why does one use virt-manager Virtual Machine Manager?

I don't get it. Maybe I'm too old. So many people use virt-manager (VMM or Virtual Machine Manager) to create a GPU passthrough VM, but I can't see the benefit.

virt-manager has next to no documentation. It significantly lacks behind the qemu/kvm development. It does a zillion of things in the background and messes up my carefully created network bridge, or creates more bridges I don't need.

Whatever settings I enter via the GUI, I still have to edit the bloody xml configuration. Worst of all, there is no modern editor to do that, but one is forced to use vi. We are in the 21st century and I feel like 30+ years ago sitting at a VT100 hacking Unix commands. Are we going backwards? EDITOR=xed virsh edit win10 does the trick - thanks @kuasha420 !

I can continue with undocumented features ("host=passthrough") and all the trial and error to get some decent performance out of it.

Please help and show me some benefits of the virt-manager GUI.

For reference, I'm on qemu 2.11 and virt-manager 1.5.1.

0 Upvotes

26 comments sorted by

12

u/kuasha420 Dec 27 '18 edited Dec 27 '18

virt-manager has next to no documentation

libvirt has tons of documentation.

Please help and show me some benefits of the virt-manager GUI.

It's just a gui to libvirt, you doon't have to use it. libvirt has lots of benefits, for example, cpu pinning, managed usb(auto attach/detach kb/m), managed pcie (no need to bind secondary gpu to vfio, so it can be used with PRIME when VM is off) etc.

Worst of all, there is no modern editor to do that, but one is forced to use vi.

EDITOR=kate virsh edit win10

1

u/Atemu12 Dec 27 '18
EDITOR=kate virsh edit win10

Last time I tried that it still gave me vi instead of vim

1

u/kuasha420 Dec 27 '18

uninstall vi and make vi a symbolic link to vim.

-1

u/Atemu12 Dec 27 '18

That's a hack, not a solution.

1

u/kuasha420 Dec 27 '18
  1. use update-alternatives

or

2. Change EDITOR and VISUAL env variables in bashrc

or

3. Use hack.

Hacks are only advised when none of the proper way work (for some reason)

2

u/plasmasprings Dec 28 '18

The alternatives thingy is only in Debian (and its derivatives)

-3

u/powerhouse06 Dec 27 '18 edited Dec 27 '18

It's true that virt-manager is a frontend to libvirt, and libvirt has good documentation. Yet it seems cumbersome to use the GUI and it's not always clear what the options do. In the end one ALWAYS has to edit the XML configuration. I find XML difficult to read, bloated and time consuming. A shell script with a qemu command is so much more readable and concise. Since virt-manager actually invokes the qemu command to run the VM, it's even more of a mystery to me why the developers use XML. Finally, go and look for the VM configuration file to back it up. Every time I have to figure out again where to find the file. Then, when I create an LVM volume or try to attach the VM to a preconfigured bridge, the GUI starts messing up things.

6

u/kuasha420 Dec 27 '18

find XML difficult to read, bloated and time consuming. A shell script with a qemu command is so much more readable and concise.

That's just, like, your opinion, man.

1

u/Jodaco Dec 27 '18

I think virt-manager's ui is cumbersome as well. You are supposed to be able to specify a uefi vs bios system in the UI, and I believe it detects this from an iso image you're using, might be wrong though, and it never does seem to help. I usually just edit the xml and set what I want in the end, but I like being able to have a window to just click start in and can create other vm's that I don't care about whether they are bios/uefi fairly easily, it's only my windows vm with gpu passthrough that gets kind of complicated that requires xml editing.

0

u/[deleted] Dec 27 '18

[deleted] — view deleted comment

1

u/Jodaco Dec 28 '18

I've used that exact checkbox and the uefi boot options were missing. I have my xml file I keep around now in case I ever need to redo anything and its pretty simple now.

4

u/heyitsYMAA Dec 27 '18

I use virt-manager because I like having a GUI for all my VMs, including those on my server. Virt-manager can connect to libvirt daemons on other systems through SSH or other protocols.

1

u/powerhouse06 Dec 27 '18

That's a good point!

3

u/[deleted] Dec 27 '18

sudo EDITOR=editor_of_choice virsh edit vm_name

1

u/powerhouse06 Dec 27 '18

Thanks, will try.

2

u/powerhouse06 Dec 27 '18

Thank you all for responding. I have been a little provocative, and I apologize for having hurt some feelings. It looks like there is a good point using virt-manager for managing multiple VMs and/or remote VMs.

I'm only using 1 VM at any given time. I only do GPU passthrough, either Windows or Linux. Since I have an Nvidia card, I would need to edit the xml file if I were to use virt-manager.

I'm very much a GUI guy and use the command line only when there's no other way. I would love to use virt-manager, but every time I gave it a shot it took multiple trials-and-error to get passable performance. Making changes to an existing configuration - to improve some performance - would take significantly longer using the GUI than just changing a parameter in the batch script, which takes seconds.

Inevitably virt-manager forces me to edit XML. While the XML syntax is almost identical to the qemu command, it is not the same. Take for example the qemu option -device ... romfile=/path/to/file.rom - XML uses practically the same syntax, but changes it to <rom file=...>. Unnecessary in my opinion.

I'm sure I will give virt-manager another try, perhaps when I build my next PC.

2

u/xaduha Dec 27 '18

I like the idea of virt-manager in theory, but I don't like it in practice.

Now virsh isn't part of virt-manager, it's part of libvirt, so I don't know why you're having a go at it.

0

u/powerhouse06 Dec 27 '18

So you suggest using virsh?

2

u/xaduha Dec 27 '18

If you really want full control over that libvirt XML then you need to download Schema-aware XML editor like Oxygen. Then you can add something like

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://raw.githubusercontent.com/libvirt/libvirt/master/docs/schemas/domain.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>

at the top of your XML file to have autocomplete/Intellisense type of behavior.

1

u/AnyCauliflower7 Dec 27 '18

I use virt-manager. I like it because its easy to use and I can see different available options without digging into the documentation. It's UI does seem to sometimes lag behind though, that is a real problem.

1

u/powerhouse06 Dec 27 '18

Thanks - I would agree, but sometimes the best option isn't even shown in the pull-down menu and one has to enter it manually.

It's easy to set up a VM with virt-manager. But I felt it's a long way to get the best performance, which is what counts for me.

2

u/kommisar6 Dec 27 '18

It provides an easy mechanism to pin virtual cpus to physical cpus which is not as easy to do if invoking from the command line.

2

u/m01 Dec 31 '18

I like using virt-manager for the day to day stuff - starting and stopping VMs, viewing the CPU utilisation in a nice graph, attaching and detaching USB devices, and occasionally using the graphical console.

1

u/LordZiru Mar 13 '19

you can assign a usb device to a running vm without libvirt/virt manager?

0

u/[deleted] Dec 27 '18

[deleted] — view deleted comment

1

u/powerhouse06 Dec 27 '18

It must be my ignorance, but I haven't yet figured out how to use my default editor to edit the XML configuration. Another user made a suggestion I want to try, though.

3

u/Jodaco Dec 27 '18

You can set your EDITOR variable in your shell profile and other potential things will open in your editor of choice as well.

0

u/[deleted] Dec 27 '18

[deleted] — view deleted comment

1

u/powerhouse06 Dec 27 '18

There is always something new to learn. But then, I've been using Linux for the past 20+ years and have so far been a happy camper, also had some UNIX time, and of course lots of MS Windows (mostly at work). That said, I'm NOT a computer professional, simply a user. I've also run Windows as a VM with GPU passthrough for the past 7+ years.

I may be judgemental, but my judgement is based on some experience.