NOTE: The user id <user> on KVM host used for ssh should be added to group libvirt already. Check out Alpine KVM for preparing KVM for remote management. <user>’s ssh key should also be setup.
Install Homebrew
Homebrew allow Linux package to be installed and ran on MacOS/X system. Follow instruction on Homebrew:
On MacOS, however, we have to append ?socket=/var/run/libvirt/libvirt-sock to the connection string. /var/run/libvirt/libvirt-sock is where the file libvirt-sock located on your KVM host. Though unlikely, you may have to modify it according to your environment.
kvm user@hostname # virsh connect to remote host and enter interactive modekvm user@hostname list --all # virsh connect to remote host and do 'list --all'kvm-list user@hostname # same as abovekvm-stop user@hostname vm-name # virsh connect to remote host and shutdown vm-namekvm-start user@hostname vm-name # virsh connect to remote host and start vm-namekvm-manager user@hostname # start virt-manager connect to remote host