模拟的服务器硬件
CPU: 8核
内存:8G
硬盘:128G
服务器硬件支持虚拟化(CPU支持)
下载 cockpit
yum -y install cockpit
yum install qemu-kvm libvirt libvirt-daemon virt-install virt-manager libvirt-dbus
systemctl start libvirtd.service
设置开机自启动
systemctl enable --now cockpit.socket
添加镜像到虚拟机的根目录下
[root@localhost ~]# ll
总用量 9840644
-rw-------. 1 root root 1044 2月 17 15:07 anaconda-ks.cfg
-rwx------. 1 root root 10076815360 2月 17 16:38 CentOS-Stream-9-latest-x86_64-dvd1.iso
chown -R root CentOS-Stream-9-latest-x86_64-dvd1.iso
chmod 700 CentOS-Stream-9-latest-x86_64-dvd1.iso
vim /etc/cockpit/disallowed-users
[root@localhost ~]# cat /etc/cockpit/disallowed-users
List of users which are not allowed to login to Cockpit
#root
下载管理虚拟机的插件
修改/etc/libvirt/qemu.conf的配置文件
vim /etc/libvirt/qemu.conf
修改user group 为root
systemctl restart libvirtd.service
刷新Cockpit的Web界面
新点击虚拟机,点击创建虚拟机