CentOS-7 安装KVM

前端之家收集整理的这篇文章主要介绍了CentOS-7 安装KVM前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
yuminstallqemu-kvmqemu-kvm-toolsvirt-managerlibvirtvirt-install-y
[root@localhost~]#grep-E'(vmx|svm)'/proc/cpuinfo
flags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflushdtsmmxfxsRSSesse2sssyscallnxpdpe1gbrdtscplmconstant_tscarch_perfmonpebsbtsnoplxtopologytsc_reliablenonstop_tscaperfmperfpnipclmulqdqvmxssse3fmacx16pcidsse4_1sse4_2x2apicmovbepopcntaesxsaveavxf16crdrandhypervisorlahf_lmaratepbplnptsdthermtpr_shadowvnmieptvpidfsgsbasesmep
#如果没有内容不支持
[root@localhost~]#qemu-imgcreate-fraw/opt/Centos-7.3-x86_64.raw10G
Formatting'/opt/Centos-7.3-x86_64.raw',fmt=rawsize=10737418240
systemctlenablelibvirtd.service
servicelibvirtdstart
[root@localhost~]#servicelibvirtdstatus
Redirectingto/bin/systemctlstatuslibvirtd.service
●libvirtd.service-Virtualizationdaemon
Loaded:loaded(/usr/lib/systemd/system/libvirtd.service;enabled;vendorpreset:enabled)
Active:active(running)since五2017-05-2614:41:33CST;7minago
Docs:man:libvirtd(8)
http://libvirt.org
MainPID:912(libvirtd)
CGroup:/system.slice/libvirtd.service
├─912/usr/sbin/libvirtd
├─2441/sbin/dnsmasq--conf-file=/var/lib/libvirt/dnsmasq/default.conf--leasefile-ro--dhcp-script=/usr...
└─2449/sbin/dnsmasq--conf-file=/var/lib/libvirt/dnsmasq/default.conf--leasefile-ro--dhcp-script=/usr...

5月2614:41:24localhost.localdomainsystemd[1]:StartingVirtualizationdaemon...
5月2614:41:33localhost.localdomainsystemd[1]:StartedVirtualizationdaemon.
5月2614:41:38localhost.localdomaindnsmasq[2441]:started,version2.66cachesize150
5月2614:41:38localhost.localdomaindnsmasq[2441]:compiletimeoptions:IPv6GNU-getoptDBusno-i18nIDNDH...auth
5月2614:41:38localhost.localdomaindnsmasq-dhcp[2441]:DHCP,IPrange192.168.122.2--192.168.122.254,leas...1h
5月2614:41:38localhost.localdomaindnsmasq[2441]:reading/etc/resolv.conf
5月2614:41:38localhost.localdomaindnsmasq[2441]:usingnameserver192.168.106.2#53
5月2614:41:38localhost.localdomaindnsmasq[2441]:read/etc/hosts-2addresses
5月2614:41:38localhost.localdomaindnsmasq[2441]:read/var/lib/libvirt/dnsmasq/default.addnhosts-0addresses
5月2614:41:38localhost.localdomaindnsmasq-dhcp[2441]:read/var/lib/libvirt/dnsmasq/default.hostsfile
Hint:Somelineswereellipsized,use-ltoshowinfull.
[root@localhost~]#ddif=/dev/cdromof=/opt/CentOs-7.3.iso
记录了8554496+0的读入
记录了8554496+0的写出
4379901952字节(4.4GB)已复制,137.034秒,32.0MB/秒
[root@localhost~]#virt-install--nameCentOS-7.3-x86_64--virt-typekvm--ram1024--cdrom=/opt/CentOs-7.3.iso--diskpath=/opt/Centos-7.3-x86_64.raw--networknetwork=default--graphicsvnc,listen=0.0.0.0--noautoconsole

开始安装......
创建域......|0B00:00:01
域安装仍在进行。您可以重新连接
到控制台以便完成安装进程。
[root@localhost~]#

VNC连接:

wKioL1kn1_ejEcrDAACjz7KmkVw405.png

wKiom1kn2CzRhBuHAAM0V1EmW-k804.png-wh_50


CentOS-7安装的时候让网卡名称默认变成eth0的方法

按TAB键,后面加入:

net.ifnames=0 biosdevname=0

wKiom1kn3eXCycxhAAESBP0MgkM249.png

[root@localhostqemu]#virshlist--all
Id名称状态
----------------------------------------------------
-CentOS-7.3-x86_64关闭
-CentOS-7.3-x86_64_1关闭
[root@localhostqemu]#virshstartCentOS-7.3-x86_64_1
域CentOS-7.3-x86_64_1已开始
cpu:

[root@localhostqemu]#pwd
/etc/libvirt/qemu
[root@localhostqemu]#virsheditCentOS-7.3-x86_64_1
<vcpuplacement='auto'current="1">4</vcpu>
重启:
[root@localhostqemu]#virshshutdownCentOS-7.3-x86_64_1
[root@localhostqemu]#virshstartCentOS-7.3-x86_64_1

[root@localhostqemu]#virshsetvcpusCentOS-7.3-x86_64_12--live#热添加或热减少
改内存:

virsheditCentOS-7.3-x86_64_1
<memoryunit='KiB'>4048576</memory>
重启:
[root@localhostqemu]#virshshutdownCentOS-7.3-x86_64_1
[root@localhostqemu]#virshstartCentOS-7.3-x86_64_1

virshqemu-monitor-commandCentOS-7.3-x86_64_1--hmp--cmdballoon500#热添加或热减少
原文链接:https://www.f2er.com/centos/377454.html

猜你在找的CentOS相关文章