创建虚拟机 需要打开 BIOS 观察下 CPU 高级选项中的 virtinst 是否打开
否则
虚拟机类型中 没有 kvm 有些时候 用qemu 虚拟系统 会报错误 /dsp 关闭selinux 可以继续
yum install kvm qemu virt-manager
Install KVM
[1] Install KVM
[root@dlp ~]#
yum -y install qemu-kvm libvirt python-virtinst bridge-utils
[root@dlp ~]#
lsmod | grep kvm
kvm_intel
43336 0
kvm
306680 1 kvm_intel
[root@dlp ~]#
/etc/rc.d/init.d/libvirtd start
Starting libvirtd (via systemctl):
[ OK ]
[root@dlp ~]#
chkconfig libvirtd on
[2] Configure Bridge networking for KVM virtual machine.
[root@dlp ~]#
cd /etc/sysconfig/network-scripts
[root@dlp network-scripts]#
cp ifcfg-eth0 ifcfg-br0
[root@dlp network-scripts]#
vi ifcfg-br0
DEVICE=
br0
# change
HWADDR=00:1A:4D:45:9F:57 ONBOOT=yes
BOOTPROTO=none
IPADDR=10.0.0.30
NETMASK=255.255.255.0
TYPE=
Bridge
# change
GATEWAY=10.0.0.1
DNS1=10.0.0.1
IPV6INIT=no
USERCTL=no
PREFIX=24
[root@dlp network-scripts]#
vi ifcfg-eth0
DEVICE=eth0
HWADDR=00:1A:4D:45:9F:57
ONBOOT=yes
BOOTPROTO=none
IPADDR=10.0.0.30
NETMASK=255.255.255.0
TYPE=Ethernet
GATEWAY=10.0.0.1
DNS1=10.0.0.1
IPV6INIT=no
USERCTL=no
PREFIX=24
BRIDGE=br0
# add
[root@dlp network-scripts]#
cd
[root@dlp ~]#
/etc/rc.d/init.d/network restart
Restarting network (via systemctl):
[ OK ]
[root@dlp ~]#
ifconfig
br0
Link encap:Ethernet HWaddr 00:1A:4D:45:9F:57
inet addr:10.0.0.30 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::21a:4dff:fe45:9f57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1156 (1.1 KiB) TX bytes:5409 (5.2 KiB)
eth0
Link encap:Ethernet HWaddr 00:22:68:3D:82:88
inet6 addr: fe80::21a:4dff:fe45:9f57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25530 errors:0 dropped:0 overruns:0 frame:0
TX packets:16690 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:28448404 (27.1 MiB) TX bytes:1630382 (1.5 MiB)
RX bytes:283089551 (269.9 MiB) TX bytes:5809514 (5.5 MiB)
Interrupt:45 Base address:0x8000
lo
Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:78 errors:0 dropped:0 overruns:0 frame:0
TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:13655 (13.3 KiB) TX bytes:13655 (13.3 KiB)
virbr0
Link encap:Ethernet HWaddr EE:52:9F:C3:31:42
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:2199 (2.1 KiB)
阅读(1229) | 评论(0) | 转发(0) |