Alpine KVM
Setup libvirt/KVM on a remote Alpine Linux server and connect virsh/virt-manager from remote.
Alpine server is assumed to have no GUI capability. All steps are done through remote connection.
Install KVM
Note:
- This part is a streamline version of Alpine KVM wiki page.
- No virt-manager on remote Alpine server. You only need it on your local machine.
- Assume VMs bridge-mode using macvtap. bridge package not required.
- Use root or sudo for all commands in this section.
Add KVM packages:
|
|
Add user
to group libvirt
:
|
|
Allow libvirt
group to access /var/run/libvirt/libvirt-sock
:
|
|
Create /etc/polkit-1/localauthority/50-local.d/50-libvirt-ssh-remote-access-policy.pkla
with following content:
|
|
At this point virt-manager and virsh can connect from remote and takeover completely.
Remote Management
virsh
and virt-manager
can be used to manage KVM remotely.
virsh
is the command line tool that can manage libvirt/KVM directly on the host or from remote.
virt-manager
is the GUI interface.
Local connection (on Alpine server)
From libvirt
group user:
Interactive mode:
|
|
Command line / batch mode
|
|
Remote connection
NOTE:
user@hostname
will be the same string for ssh to thelibvirt
group user on Alpine host. SSH key should be setup already.
Linux
|
|
MacOS
Check out MacOS Connect to KVM Client Desktop for running virt-manager to remote manage and connect KVM on MacOS.