Together with friends we decided to join efforts and administrate our own online services. We had some issue when setting up virtualization on Debian Stretch and I wanted to share what we learned.
We chose to use what we believe to be the “most standard” solution: KVM with QEMU, and libvirt. I expected it to work out of the box and I was wrong. Following the Debian Wiki was instructive but not sufficient.
sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system sudo adduser <youruser> libvirt sudo adduser <youruser> libvirt-qemu
What about checking libvirtd service status ?
sudo systemctl status libvirtd
And you might get errors like:
dnsmasqCapsRefreshInternal:741 : Cannot check dnsmasq binary /usr/sbin/dnsmasq: No such file or directory virFirewallValidateBackend:193 : direct firewall backend requested, but /sbin/ebtables is not available: No such file or directory virFirewallApply:916 : internal error: Failed to initialize a valid firewall backend
To fix those errors, we had to run:
sudo apt-get install ebtables dnsmasq sudo systemctl restart libvirtd
Creating a new Guest
With Virtual Manager
The Debian Wiki says “The easiest way to create and manage VM guest is using GUI application Virtual Machine Manager” but does not provide information on how to set it up.
I first tried to connect to the host machine from virt-manager installed on my laptop and got the following error
libvirtError: End of file while reading data: sh: nc: command not found
Pretty straightforward to fix you say? You have to install netcat on your host machine. But not any netcat, netcat-openbsd
sudo apt-get install netcat-openbsd
If you install netcat-traditional, it will raise the following error:
The remote host requires a version of netcat/nc which supports the -U option.
To be continued…