Fedora 32: virsh command in a system session without sudo
-
Even though you are a member of the libvirt group, by default when you run virsh commands without sudo, you are actually in a user session instead of system session.
To operate in a system session without using sudo, you need to use
virsh -c qemu:///system
.# Running a one-liner virsh commands virsh -c qemu:///system list --all # Entering a virsh interactive terminal virsh -c qemu:///system
-
Excellent tip! Just tried this out and it worked.
-
@EddieJennings said in Fedora 32: virsh command in a system session without sudo:
Excellent tip! Just tried this out and it worked.
If you want to avoid typing
-c qemu:///system
and make it default when usingvirsh
command, create an alias in your.bashrc
file.alias virsh="virsh -c qemu:///system"
-
I can see the use for this in a multi user system where you have virtualization admin. They would not need sudo access to do things.
For most though, just using sudo will suffice.