11.linux 中的虚拟机管理器

###虚拟机管理###
##1.虚拟机管理命令
virt-manager                    ##开启虚拟机管理器
virsh list                      ##显示正在运行的虚拟机
virsh list --all                ##查看所有虚拟机
virsh start desktop             ##打开
virsh shutdown desktop          ##正常关闭虚拟机
virsh destroy desktop           ##强行关闭
virt-viewer desktop             ##显示虚拟机


在自己电脑上模拟虚拟机恢复
准备一个已经安装好的虚拟机
mv /etc/libvirt/qemu/test.xml   /mnt/
mv /var/lib/libvirt/images/test.qcow2  /mnt/

在虚拟机管理器中删除这个装好的虚拟机

模拟恢复过程
cd /mnt
virsh create test.xml           ##用硬件信息启动虚拟机
在操作过程中会有以下错误:
error:Cannot access storage file '/var/lib/libvirt/images/test.qcow2' (a07,gid:107):No such file or directory
cd


解决方案:

mv /mnt/test.qcow2/var/lib/libvirt/images/

virsh define test.xml  ##永久恢复虚拟机

猜你喜欢

转载自blog.csdn.net/zhangyubo114285/article/details/81348207