使用virt-manager 创建虚拟机

virt-manager 是一个图形化虚拟机管理工具,方便管理和查看虚拟机

#安装相关工具
[root@localhost ~]# yum install qemu-kvm  libvirt virt-manager virt-install
[root@localhost ~]# systemctl enable --now libvirtd
#查看支持iso版本
[root@localhost ~]# osinfo-query os|grep centos
 centos5.0            | CentOS 5.0                                         | 5.0      | http://centos.org/centos/5.0            
 centos5.1            | CentOS 5.1                                         | 5.1      | http://centos.org/centos/5.1            
 centos5.10           | CentOS 5.10                                        | 5.10     | http://centos.org/centos/5.10           
 centos5.11           | CentOS 5.11                                        | 5.11     | http://centos.org/centos/5.11           
 centos5.2            | CentOS 5.2                                         | 5.2      | http://centos.org/centos/5.2            
 centos5.3            | CentOS 5.3                                         | 5.3      | http://centos.org/centos/5.3            
 centos5.4            | CentOS 5.4                                         | 5.4      | http://centos.org/centos/5.4            
 centos5.5            | CentOS 5.5                                         | 5.5      | http://centos.org/centos/5.5            
 centos5.6            | CentOS 5.6                                         | 5.6      | http://centos.org/centos/5.6            
 centos5.7            | CentOS 5.7                                         | 5.7      | http://centos.org/centos/5.7            
 centos5.8            | CentOS 5.8                                         | 5.8      | http://centos.org/centos/5.8            
 centos5.9            | CentOS 5.9                                         | 5.9      | http://centos.org/centos/5.9            
 centos6.0            | CentOS 6.0                                         | 6.0      | http://centos.org/centos/6.0            
 centos6.1            | CentOS 6.1                                         | 6.1      | http://centos.org/centos/6.1            
 centos6.10           | CentOS 6.10                                        | 6.10     | http://centos.org/centos/6.10           
 centos6.2            | CentOS 6.2                                         | 6.2      | http://centos.org/centos/6.2            
 centos6.3            | CentOS 6.3                                         | 6.3      | http://centos.org/centos/6.3            
 centos6.4            | CentOS 6.4                                         | 6.4      | http://centos.org/centos/6.4            
 centos6.5            | CentOS 6.5                                         | 6.5      | http://centos.org/centos/6.5            
 centos6.6            | CentOS 6.6                                         | 6.6      | http://centos.org/centos/6.6            
 centos6.7            | CentOS 6.7                                         | 6.7      | http://centos.org/centos/6.7            
 centos6.8            | CentOS 6.8                                         | 6.8      | http://centos.org/centos/6.8            
 centos6.9            | CentOS 6.9                                         | 6.9      | http://centos.org/centos/6.9            
 centos7.0            | CentOS 7                                           | 7        | http://centos.org/centos/7.0  
#准备iso文件
[root@localhost ~]# mkdir -p /data/isos/
[root@localhost isos]# ls /data/isos/
CentOS-7-x86_64-Minimal-2003.iso
#在windows上打开xmanager
#打开manager
[root@localhost isos]# export DISPLAY=10.0.0.1:0.0
[root@localhost isos]# virt-manager
[root@localhost isos]# libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast


在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

virt-install是一个用于在KVM/QEMU上创建虚拟机的命令行工具。它可以通过VNC连接来管理虚拟机。下面是使用virt-installvnc创建虚拟机的步骤: 1. 安装virt-install:在大多数Linux发行版上,可以通过包管理器安装virt-install。 2. 创建一个XML文件:在创建虚拟机之前,需要创建一个XML文件,其中包含虚拟机的配置信息。可以通过手动编写XML文件或使用virt-manager创建。 3. 运行virt-install:使用virt-install命令创建虚拟机。 ``` virt-install \ --connect qemu:///system \ --name vm-name \ --ram 2048 \ --vcpus 2 \ --disk path=/var/lib/libvirt/images/vm-name.qcow2,size=20 \ --os-type linux \ --os-variant rhel7 \ --network bridge=br0 \ --graphics vnc,listen=0.0.0.0 \ --noautoconsole \ --import ``` 解释: - --name:虚拟机的名称。 - --ram:虚拟机的内存大小(以MB为单位)。 - --vcpus:虚拟机的虚拟CPU数量。 - --disk:虚拟机的磁盘路径和大小。 - --os-type:虚拟机使用的操作系统类型。 - --os-variant:虚拟机使用的操作系统的变体。 - --network:虚拟机的网络设置。 - --graphics:虚拟机的图形设置,这里使用VNC连接。 - --noautoconsole:虚拟机创建后不自动打开控制台。 - --import:启动虚拟机安装程序。 4. 连接到虚拟机使用VNC客户端连接到虚拟机的IP地址和端口,进行虚拟机的管理和操作。 以上是使用virt-installvnc创建虚拟机的步骤,希望对你有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值