apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade
apt-get -y install qemu-kvm libvirt-bin
modprobe vhost_net
echo vhost_net >> /etc/modules
Kết quả:
lsmod | grep vhost
vhost_net 20480 0
vhost 32768 1 vhost_net
macvtap 20480 1 vhost_net
listen_tls = 0
listen_tcp = 1
#listen_addr = "0.0.0.0"
unix_sock_group = "libvirtd"
unix_sock_ro_perms = "0777"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"
auth_tcp = "none"
start_libvirtd="yes"
libvirtd_opts="-l -d"
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 16509 -j ACCEPT
Nếu sử dụng CentOS 7:
firewall-cmd --zone=public --add-port 16509/tcp --permanent
Nếu sử dụng Ubuntu (các phiên bản)
ufw allow 16509
service libvirt-bin restart
Tham khảo:
[1] - https://www.server-world.info/en/note?os=Ubuntu_16.04&p=kvm&f=1
[2] - https://github.com/retspen/webvirtmgr/wiki/Setup-Host-Server