首先执行命令更新软件包
apt-get update
apt-get upgrade
然后安装libvirt
apt-get install libvirt-dev libvirt-daemon libvirt-clients
命令行工具:virsh
输入virsh即可进入。
sudo apt-get install libvirt-bin
systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset:
Active: active (running) since Thu 2021-01-07 21:30:08 PST; 35s ago
Docs: man:libvirtd(8)
https://libvirt.org
Main PID: 70499 (libvirtd)
Tasks: 19 (limit: 32768)
CGroup: /system.slice/libvirtd.service
├─70499 /usr/sbin/libvirtd
├─70842 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/defaul
└─70843 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/defaulJan 07 21:30:08 ubuntu systemd[1]: Started Virtualization daemon.
Jan 07 21:30:09 ubuntu dnsmasq[70842]: started, version 2.79 cachesize 150
Jan 07 21:30:09 ubuntu dnsmasq[70842]: compile time options: IPv6 GNU-getopt DBu
Jan 07 21:30:09 ubuntu dnsmasq-dhcp[70842]: DHCP, IP range 192.168.122.2 -- 192.
Jan 07 21:30:09 ubuntu dnsmasq-dhcp[70842]: DHCP, sockets bound exclusively to i
Jan 07 21:30:09 ubuntu dnsmasq[70842]: reading /etc/resolv.conf
Jan 07 21:30:09 ubuntu dnsmasq[70842]: using nameserver 127.0.0.53#53
Jan 07 21:30:09 ubuntu dnsmasq[70842]: read /etc/hosts - 7 addresses
Jan 07 21:30:09 ubuntu dnsmasq[70842]: read /var/lib/libvirt/dnsmasq/default.add
Jan 07 21:30:09 ubuntu dnsmasq-dhcp
sudo systemctl is-active libvirtd
active