Centos安裝和配置KVM

安裝

yum install  -y virt-manager* virt-install libvirt* *vnc*
yum install -y kvm virt-* libvirts bridge-utils qemu-img

啓動

virt-manager
問題:(virt-manager:10753): Gtk-WARNING **: 08:11:22.554: cannot open display:
解決:鏈接服務器的時候加上-X就能夠了 "ssh -X username@IP Address"

virt-manager 掛載nfs

[root@localhost home]# service rpcbind restart
Redirecting to /bin/systemctl restart rpcbind.service
[root@localhost home]# service rpcbind restart
Redirecting to /bin/systemctl restart rpcbind.service
[root@localhost home]# service nfs restart
Redirecting to /bin/systemctl restart nfs.service
[root@localhost home]# exportfs -r

cat exports

[root@localhost home]# cat /etc/exports
/iso *(rw,sync,no_root_squash)
/image *(rw,sync,no_root_squash)

問題

1.could not open disk image /home/d/shixun/vm/vdisk.img: Permission denied
 修改文件夾權限以後,如果無效須要查看selinux disabled的狀態,重啓服務器。
 重啓服務器以後,更新
 yum update

使用

  • 開機 |關機| 重啓
 
 

配置橋接

-- ifcfg-em0 --

TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
BRIDGE=br0
DEVICE=em0

-- ifcfg-br0 --

TYPE=Bridge
BOOTPROTO=static
DEVICE=br0
ONBOOT=yes
IPADDR=*.*.*.*
GATEWAY=*.*.*.*
NETMASK=*.*.*.*
DNS2=*.*.*.*

IP衝突

  • 直接有效的解決辦法IP-MAC地址綁定
相關文章
相關標籤/搜索