Remote access to libvirt¶
Part of the KVM overview. Manage a remote hypervisor over SSH, use virt-manager with X11 forwarding, or Cockpit.
libvirt over SSH¶
virsh -c qemu+ssh://user@host/system list
virsh -c qemu+ssh://user@host/system # interactive shell
virt-manager -c qemu+ssh://user@host/system # GUI, run from your workstation
Add your user to the libvirt group on the remote host (permissions). Reference: https://wiki.libvirt.org/page/SSHSetup
virt-manager over X11 forwarding¶
ssh -X user@host
sudo dnf install virt-manager # on the host, if needed
virt-manager --connect=qemu:///system
Troubleshooting:
cannot open display:echo $DISPLAYshould show something likelocalhost:10.0. If you usesudo, copy the authority file:sudo cp ~/.Xauthority /root/.Xauthority(also fixesX11 connection rejected because of wrong authentication).X11 forwarding request failed on channel 0: client side, setForwardX11 yes(or usessh -X) in~/.ssh/config; server side, checkX11Forwarding yesinsshd_config, restartsshd, and make surexauthis installed.- Nothing to log in with:
virt-viewer vm01 --display localhost:10.0opens a single VM's console.
Cockpit¶
sudo dnf install cockpit cockpit-machines
sudo systemctl enable --now cockpit.socket
sudo firewall-cmd --permanent --add-service=cockpit
sudo firewall-cmd --reload
Then browse to https://host:9090.