彩世界平台-彩世界时时app-彩世界开奖app苹果下载

热门关键词: 彩世界平台,彩世界时时app,彩世界开奖app苹果下载

您的位置:彩世界平台 > 彩世界开奖app苹果下载 > centos 7.0安装kvm

centos 7.0安装kvm

发布时间:2019-09-01 04:51编辑:彩世界开奖app苹果下载浏览(139)

    centos 7.0安装kvm

    PRE-INSTALL

    =============================================================

    kvm相关安装包及其作用

    qemu-kvm 主要的KVM程序包

    python-virtinst 创建虚拟机所需要的命令行工具和程序库

    virt-manager GUI虚拟机管理工具

    virt-top 虚拟机统计命令

    virt-viewer GUI连接程序,连接到已配置好的虚拟机

    libvirt C语言工具包,提供libvirt服务

    libvirt-client 为虚拟客户机提供的C语言工具包

    virt-install 基于libvirt服务的虚拟机创建命令

    bridge-utils 创建和管理桥接设备的工具

    INSTALL

    =============================================================

    [[email protected] ~]# yum install qemu-kvm libvirt virt-install bridge-utils

    #查看是否加载kvm模块

    [[email protected] ~]# lsmod|grep kvm

    kvm_intel 138567 0

    kvm 441119 1 kvm_intel

    #如果没有这两条,可以用"modprobe kvm"加载;

    #相关命令"insmod;rmmod;modinfo"

    #启动libvirtd

    [[email protected] ~]# systemctl start libvirtd;systemctl enable libvirtd

    [[email protected] ~]# systemctl list-unit-files|grep libvirtd

    libvirtd.service enabled

    NETWORK CONFIGURATION

    =============================================================

    #修改网卡文件eno16777736

    [[email protected] ~]# cd /etc/sysconfig/network-scripts/

    [[email protected] network-scripts]# echo "BRIDGE=br0" >> ifcfg-eno16777736 #在ifcfg-e**原网卡文件中增加"BRIDGE=br0"

    #新建网桥文件ifcfg-br0(网桥名称),增加内容如下

    [[email protected] network-scripts]# vi ifcfg-br0

    *************************************************

    DEVICE=br0

    TYPE="Bridge" #大小写敏感,所以必须是Bridge

    BOOTPROTO="dhcp"

    ONBOOT="yes"

    DELAY="0"

    STP="yes"#这一行是来启动STP,和brctl命令行出来的结果有关

    *************************************************

    #重启NetworkManager及network服务:

    [[email protected] network-scripts]# systemctl restart NetworkManager

    #当你手动修改了网卡文件后,需要重启NetworkManager服务来重新接管网络配置

    #网卡配置文件和NetworkManager配置冲突时,解决方案:{1、重启NetworkManager;2、关闭NetworkManager}

    [[email protected] network-scripts]# systemctl restart network

    [[email protected] network-scripts]# ip a#ip命令用来查看和管理ip信息

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

    valid_lft forever preferred_lft forever

    2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP qlen 1000

    link/ether 00:0c:29:61:5c:1d brd ff:ff:ff:ff:ff:ff

    3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN

    link/ether 52:54:00:b6:45:5b brd ff:ff:ff:ff:ff:ff

    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

    valid_lft forever preferred_lft forever

    4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 500

    link/ether 52:54:00:b6:45:5b brd ff:ff:ff:ff:ff:ff

    6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP

    link/ether 00:0c:29:61:5c:1d brd ff:ff:ff:ff:ff:ff

    inet 192.168.0.32/24 brd 192.168.0.255 scope global dynamic br0

    valid_lft 11979sec preferred_lft 11979sec

    inet6 fe80::20c:29ff:fe61:5c1d/64 scope link

    valid_lft forever preferred_lft forever

    7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UNKNOWN qlen 500

    link/ether fe:54:00:cb:63:b2 brd ff:ff:ff:ff:ff:ff

    inet6 fe80::fc54:ff:fecb:63b2/64 scope link

    valid_lft forever preferred_lft forever

    #查看网桥连接

    [[email protected] network-scripts]# brctl show #brctl是一个网桥连接管理命令

    bridge name bridge id STP enabled interfaces #如果上面不设置STP=yes,这里就会显示no

    br0 8000.000c29615c1d yes eno16777736

    vnet0

    virbr0 8000.525400b6455b yes virbr0-nic

    CLOSE SELINUX

    =============================================================

    [[email protected] network-scripts]# setenforce 0

    [[email protected] network-scripts]# getenforce

    Permissive

    [[email protected] network-scripts]#vi /etc/selinux/config

    ******************************************

    SELINUX=permissive #修改配置文件使其永久生效

    ******************************************

    CREATE A VM

    =============================================================

    [[email protected] ~]# mkdir -p /var/kvm/images

    [[email protected] ~]# virt-install

    --network bridge:br0

    --name vm1

    --ram=1024

    --vcpus=1

    --disk path=/var/kvm/images/vm1.img,size=10

    --graphics none

    --location ''

    --extra-args="console=tty0 console=ttyS0,115200"

    #详细每个参数的意义可以查看扩展资料

    #安装过程会让你选择textmode 还是vnc,选择textmode继续安装吧

    #如果网络会有问题的话,尽量选择用--cdrom /path/to/centos7.iso

    #virt-install --name vm1 --ram=1024 --vcpus=1 --network bridge:br0 --disk path=/var/kvm/images/centos7.img,size=10 --graphics none --location= --extra-args="console=tty0 console=ttyS0,115200"

    PS:图形化下安装虚拟机需要X-WINDOW和virt-manager,安装虚拟机之前的操作都一样,图形下操作很简单

    扩展资料

    =============================================================

    本文出自 “三零妖人” 博客,请务必保留此出处

    centos 6.7 安装kvm

    1、确认自己的CPU是支持虚拟化的

    [[email protected]/]``#grep-Ei"vmx|svm"/proc/cpuinfo``flags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflushdtsmmxfxsrssesse2sssyscallnxrdtscplmconstant_tscuparch_perfmonpebsbtsxtopologytsc_reliablenonstop_tscaperfmperfunfair_spinlockpnivmxpclmulqdqssse3fmacx16sse4_1sse4_2movbepopcntaesxsaveavxhypervisorlahf_lmidaaratepbplnptsdts

    2、装载模块

    [[email protected]/]``#modprobekvm``[[email protected]/]``#modprobekvm-intel``[[email protected]/]``#lsmod|grepkvm``kvm_intel556240``kvm3415511kvm_intel``[[email protected]/]``#ls-l/dev/kvm``crw-rw----.1rootroot10,23211月1416:10``/dev/kvm

    3、安装qemu-kvm工具

    [[email protected]/]``#yuminstallqemu-kvmqemu-kvm-tools

    4、创建快捷执行链接

    [[email protected]/]``#ln-sv/usr/libexec/qemu-kvm/usr/sbin/``"/usr/sbin/qemu-kvm"``->``"/usr/libexec/qemu-kvm"

    6.7 安装kvm 1、确认自己的CPU是支持虚拟化的 [[email protected]/] #grep-Eivmx|svm/proc/cpuinfo flags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse36clflush...

    本文由彩世界平台发布于彩世界开奖app苹果下载,转载请注明出处:centos 7.0安装kvm

    关键词:

上一篇:centos安装crontab

下一篇:没有了