If you manage virtual machines on a remote host using libvirt and virt-manager, the typical connection flow uses SSH. But virt-manager’s graphical connection dialog doesn’t expose a port field: it assumes SSH is on the default port 22.
If your remote host runs SSH on a non-standard port, you need to bypass the GUI and connect via command line, specifying the full libvirt URI directly:
virt-manager -c 'qemu+ssh://root@<hostname>:<port>/system?socket=/var/run/libvirt/libvirt-sock'
Replace <hostname> with the remote host’s address or hostname, and <port> with the non-standard SSH port number. For example:
virt-manager -c 'qemu+ssh://root@192.168.1.10:2222/system?socket=/var/run/libvirt/libvirt-sock'
Make sure you have passwordless SSH access to the remote host already configured (public key authentication). Without it, the connection will prompt for a password in a way that virt-manager doesn’t handle gracefully.
macOS Link to heading
virt-manager is a GTK application that doesn’t run natively on macOS, but you can install a remote-only version via Homebrew using homebrew-virt-manager. It supports the same URI-based connection approach, useful for managing Linux VMs from a Mac without spinning up a Linux desktop.
Updated 2026: The
homebrew-virt-managertap has seen limited maintenance in recent years. An alternative is to usevirshfrom the command line (available viabrew install libvirt) or to connect via a jump host using standard SSH port forwarding to avoid the non-standard port issue altogether.