linux 7 kvm启动,Centos7 kvm虚拟化安装使用

准备环境

1. 开启处理器中的虚拟化 Intel VT-x/EPT或AMD-V/RVI(V)选项

a4a80310f3fca632dedd778e68d0b6eb.png

2. 启动虚拟机并查看机器是否支持KVM

8e8c35d4f70187774c3cb76efbbefda2.png

3. 关掉防火墙

[root@localhost ~]# systemctl stop firewalld

[root@localhost ~]# setenforce 0

[root@localhost ~]#

4. 安装并启动kvm

[root@localhost ~]# yum install -y qemu-kvm libvirt virt-install bridge-utils

[root@localhost ~]# systemctl start libvirtd

[root@localhost ~]# systemctl enable libvirtd

5. 创建查看存储文件

[root@localhost ~]# qemu-img create -f raw /opt/CentOS-7-x86_64.raw 10G

Formatting '/opt/CentOS-7-x86_64.raw', fmt=raw size=10737418240

[root@localhost ~]# ls -l /opt/CentOS-7-x86_64.raw

-rw-r--r--. 1 root root 10737418240 10月 30 13:59 /opt/CentOS-7-x86_64.raw

6. 上传镜像 (我这里是centso7的镜像)

[root@localhost ~]# mv CentOS-7-x86_64-Minimal-2003.iso /tmp/

[root@localhost ~]# ls /tmp/

CentOS-7-x86_64-Minimal-2003.iso

7. 创建物理桥桥接接口br0

[root@localhost ~]# virsh iface-bridge ens33 br0

[root@localhost ~]# systemctl restart network

把自己的物理网卡ens33 作为交换机,把br0 当网卡,提供IP,重启网络服务

注意:命令可能会卡死或出错,终端被强制退出;等一会,重启网卡,在登录就OK 了

8. 安装虚机

virt-install --virt-type kvm --name CentOS-7-x86_64 --ram 1536 --cdrom=/tmp/CentOS-7-x86_64-Minimal-2003.iso --disk path=/opt/CentOS-7-x86_64.raw --network bridge=br0 --graphics vnc,listen=0.0.0.0 --noautoconsole

9.使用VNC连接 (连接软件资源有)

f15665cd63df79c83e0d72b2a7e694d9.png

1456de41593e7df66961c8b4951fc29d.png

10.开始安装

86d8e86ee37fd430efeef8ba9385525d.png

631c07987599349fa3e556c415f9091e.png

11.重启之后会退出 不要慌

7c48f5008968a1cf548e10e4be35138d.png

12.在虚拟机上查看启动

aa87b523398d3b9b7403737c6cdac508.png

4ed39a1945002764815064fa1b778024.png

ff5387a2ac762ada689ca09576f675b9.png

如果没网 请把网卡改成dhcp动态

3be18c8e5c54e54ee536ee2250412c27.png

4937cca613336a227ba6b0109048a8cd.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值