Remote Access to libvirtd with virt-manager over SSH: Troubleshooting
In this article, we will cover the steps to troubleshoot issues when trying to access libvirtd remotely using virt-manager over SSH. We will assume that you have already set up SSH access to the remote server and that you are able to log in using SSH.
Error Message
When attempting to connect to the remote libvirtd service using virt-manager over SSH, you may encounter the following error message:
Error while connecting to : Error opening connection to 'qemu+ssh://[email protected]/system': Connection refused Troubleshooting Steps
To troubleshoot this issue, follow these steps:
Check that the libvirtd service is running on the remote server:
systemctl status libvirtdIf the service is not running, start it:
systemctl start libvirtdCheck that the SSH service is running on the remote server:
systemctl status sshdIf the SSH service is not running, start it:
systemctl start sshdCheck that the firewall on the remote server is configured to allow SSH and libvirtd connections:
firewall-cmd --permanent --add-service=sshfirewall-cmd --permanent --add-service=libvirtdfirewall-cmd --reloadCheck that the user you are using to connect to the remote server has permissions to access libvirtd:
usermod -a -G libvirtTry connecting again using virt-manager over SSH.
Additional Troubleshooting
If the above steps do not resolve the issue, you can try the following:
Check the SSH logs for any errors:
journalctl -u sshdCheck the libvirtd logs for any errors:
journalctl -u libvirtdCheck that the remote server is able to resolve the hostname of the local machine:
/etc/hostsCheck that the remote server has the necessary permissions to access the libvirtd service:
setsebool -P virt_use_sshd_password 1
Check that the libvirtd and SSH services are running on the remote server.
Check that the firewall on the remote server is configured to allow SSH and libvirtd connections.
Check that the user you are using to connect to the remote server has permissions to access libvirtd.
Check the SSH and libvirtd logs for any errors.
Check that the remote server is able to resolve the hostname of the local machine.
Check that the remote server has the necessary permissions to access the libvirtd service.