一、命令控制虚拟机

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

Linux中的虚拟机管理器Linux中的虚拟机管理器

Linux中的虚拟机管理器

 

二、脚本方式安装虚拟机

 

Linux中的虚拟机管理器

Linux中的虚拟机管理器

 

 

三、手动方式安装虚拟机                                 

选择安装方式  

Linux中的虚拟机管理器   

选择镜像所在位置

  Linux中的虚拟机管理器

选择内存大小和cpu核数                                                                      

Linux中的虚拟机管理器   

  设定硬盘大小        

  Linux中的虚拟机管理器

选择第一个进行安装                                                                        

Linux中的虚拟机管理器    

    安装模式       

Linux中的虚拟机管理器  

选择手动分区                                                                                                                    

Linux中的虚拟机管理器    

设定标准分配

Linux中的虚拟机管理器

分区及大小设定                                                                                                 

Linux中的虚拟机管理器

      

四、模拟虚拟机的恢复

虚拟机两个组成部分:硬盘文件.qcow2和硬件信息文件.xml

准备1个已经安装好的虚拟机

Linux中的虚拟机管理器

Linux中的虚拟机管理器

Linux中的虚拟机管理器

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

1)模拟恢复过程
cd /mnt
virsh  create  test.xml    ##用硬件信息启动虚拟机

2)在操作过程中会有以下错误:

error: Failed to create domain from test.xml
No such file or directory

Linux中的虚拟机管理器

3)解决方案
mv /mnt/test.qcow2 /var/lib/libvirt/images/

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

Linux中的虚拟机管理器

五、虚拟机快照创建

下图test为母盘,public为快照

-f表示文件类型  -b表示快照对象

Linux中的虚拟机管理器

Linux中的虚拟机管理器

Linux中的虚拟机管理器

Linux中的虚拟机管理器

 

 

 

相关文章:

  • 2021-12-29
  • 2021-05-31
  • 2021-08-13
猜你喜欢
  • 2021-10-05
  • 2022-01-01
  • 2021-06-15
  • 2021-10-11
  • 2021-11-25
  • 2021-11-17
相关资源
相似解决方案