Boxes don't list VMs created as root if run as user

Hi,

I’m starting to explore libvirt virtualization world and I’m sorry if this question is somewhat stupid but …

  • I’ve created a VM as root using virt-manager (I presume this wasn’t probably a wonderful idea but it solved some rights problems and I didn’t had time to jump onto this at this time)
  • when stating gnome-boxes as root, this VM is listed and I can start it without problem
  • when starting gnome-boxes as user it doesn’t list this VM
  • as a user I can see this VM with virsh: virsh list --all
  • as a user I can list it and run it too using virt-manager

What can I do to be able to run this VM using gnome-boxes without root privileges ? It’s stated in doc that it’s supposed to work “out of the box” if I understand well

Thanks !

PS: I didn’t found any sort of logging / debug option for Boxes (but I didn’t found very far, only read online doc). Did I missed something ?

Env: Ubuntu 22.04 / Gnome boxes 42.0.1-1ubuntu1 (not flatpack, but Debian package)

1 Like

GNOME Boxes operates in the mode defined by the URI here:

~/.config/gnome-boxes/sources/"QEMU Session"

To use the system mode, become a member of the libvirt group.

See also: qemu:///system vs qemu:///session | Cole Robinson

Thanks. I’m already member of libvirt, if not I wouldn’t be able to list system VMs using virsh list --all command

This is super interesting, solved the problem, and I really can’t believe there’s no mention to it in online doc :open_mouth:

By default, virsh uses the following URI:

  • qemu:///session - for normal unprivileged users.
  • qemu:///system - for root and privileged users running sudo.

You can change the default virsh URI with:

  • Command option: -c, --connect
  • Environment variable: LIBVIRT_DEFAULT_URI

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.