Hacker News new | ask | show | jobs
by eVeechu7 866 days ago
I thought virt manager was ok but honestly your complaints about it are specific and fair.
1 comments

Virtual box has graphical configuration for a ton of different options. It also “just works” in many cases and is relatively easy to use.

I am surprised the open source community has not built better gui tools, and no project, closed or open has made configuring pcie passthrough easy.

I have always wanted to be able to run Windows in a virtualized session with my GPU for gaming, and use my onboard APU for the Linux host, but the configuration is daunting, and many of the games I play today don’t work on linux thanks to anticheat or DRM.

> I am surprised the open source community has not built better gui tools

This is the thing that isn't surprising.

In order to make a better GUI tool, you have to understand how the internals work. Then you don't care to use a GUI tool because you know how to use the command line or edit the configuration files. The people who want better GUI tools are the people who don't know how to make them.

In order to change this, the people who want GUI tools but don't know how to make them have to provide some incentive (typically money) to the people who know how to make them but don't want them, e.g. via donations or some kind of commercial agreement. And if they stand around and wonder why nobody else has fixed their problem for them instead of doing the thing that causes it to be fixed, an object at rest tends to remain at rest.

> no project, closed or open has made configuring pcie passthrough easy

"GPU passthrough with libvirt qemu kvm" https://wiki.gentoo.org/wiki/GPU_passthrough_with_libvirt_qe...

"PCI passthrough via OVMF" https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF :

> The Open Virtual Machine Firmware (OVMF) is a project to enable UEFI support for virtual machines. Starting with Linux 3.9 and recent versions of QEMU, it is now possible to passthrough a graphics card, offering the virtual machine native graphics performance which is useful for graphic-intensive tasks

KVM-GPU-Passthrough: https://github.com/BigAnteater/KVM-GPU-Passthrough

https://clayfreeman.github.io/gpu-passthrough/

I don't think that linking two different Wiki's (for different Linux distros) and two different github posts is "easy" compared to VirtualBox's very "fisher price" Next-Next-Next-Done GUI

Not saying I prefer one or the other, but it's worth bearing in mind where "the bar" is

FWICS from scanning those resources, there are a few shell commands to wrap with a config parser and an output parser for a GUI

E.g. virt-manager is built with glade XML and Python:

virt-manager/virt-manager//ui/createvm.ui: https://github.com/virt-manager/virt-manager/blob/main/ui/cr...

virt-manager/virt-manager//ui/gfxdetails.ui: https://github.com/virt-manager/virt-manager/blob/main/ui/gf...

virt-manager/virt-manager//ui/hoststorage.ui: https://github.com/virt-manager/virt-manager/blob/main/ui/ho...

virtManager/createvm.py: https://github.com/virt-manager/virt-manager/blob/main/virtM...

virtManager/device/addstorage.py: https://github.com/virt-manager/virt-manager/blob/main/virtM...

virtManager/device/gfxdetails.py: https://github.com/virt-manager/virt-manager/blob/main/virtM...

virtManager/addhardware.py:

  DeviceController.TYPE_PCI

    def populate_controller_model_combo(combo, controller_type): 
https://github.com/virt-manager/virt-manager/blob/135cf17072... https://github.com/virt-manager/virt-manager/blob/135cf17072...
"Locating the GPU": https://clayfreeman.github.io/gpu-passthrough/#locating-the-... :

  for d in /sys/kernel/iommu_groups/*/devices/*; do
    n=${d#*/iommu_groups/*}; n=${n%%/*}
    printf 'IOMMU Group %s ' "$n"
    lspci -nns "${d##*/}"
  done;
iommu.sh gist: https://gist.github.com/Roliga/d81418b0a55ca7682227d57af2778...

iommu_groups.sh: https://github.com/drewmullen/pci-passthrough-ryzen/blob/mas... :

  lspci -nns "${d##*/}"
"PCI passthrough via OVMF > 2. Setting up IOMMU > 2.2 Ensuring that the groups are valid": https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#En... :

> An IOMMU group is the smallest set of physical devices that can be passed to a virtual machine. For instance, in the example above, both the GPU in 06:00.0 and its audio controller in 6:00.1 belong to IOMMU group 13 and can only be passed together. The frontal USB controller, however, has its own group (group 2) which is separate from both the USB expansion controller (group 10) and the rear USB controller (group 4), meaning that any of them could be passed to a virtual machine without affecting the others.

"Exporting your ROM": https://github.com/BigAnteater/KVM-GPU-Passthrough?tab=readm... :

  lspci -vnn
  find /sys/devices -name rom

  # PATH_TO_ROM=

  echo 1 > $PATH_TO_ROM
  mkdir -p /var/lib/libvirt/vbios/
  cat $PATH_TO_ROM > 
  /var/lib/libvirt/vbios/gpu.rom
  echo 0 > $PATH_TO_ROM
"Attaching the GPU" [with `virsh`] https://clayfreeman.github.io/gpu-passthrough/#attaching-the... :

  <hostdev mode='subsystem' type='pci' managed='yes'>
    <rom file='/path/to/gpu-dump.rom'/>
    <source>
      <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </source>
  </hostdev>
  <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
      <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
    </source>
  </hostdev>
"Adding your GPU and USB devices to the VM" [with `virt-manager`]: https://github.com/BigAnteater/KVM-GPU-Passthrough?tab=readm...

> 1. Add every PCI device which has to do with your graphics card to the VM.

That's still MASSIVELY more complex than "Next -> Next -> Next -> Done"
I wish there was a port of UTM to linux
Gnome Boxes is an attempt at a similar interface, but yeah, it's not quite as polished.
virt-manager supports more complex libvirt XML configurations, can also manage VMs created by Gnome Boxes, but doesn't yet have IOMMU/PCIE passthrough with OVMF UEFI device selector and vm configuration gui: https://virt-manager.org/