感谢支持
我们一直在努力

快速搭建KVM及安装Linux系统

快速搭建KVM及安装Linux系统

1.安装KVM内核及libvirtd相关组件
yum -y install kvm Python-virtinst libvirt tunctl bridge-utils virt-manager qemu-kvm-tools virt-viewer

2.加载KVM运行模块
[root@localhost ~]# modprobe kvm
[root@localhost ~]# modprobe -ls |grep kvm
kernel/arch/x86/kvm/kvm.ko
kernel/arch/x86/kvm/kvm-intel.ko
kernel/arch/x86/kvm/kvm-amd.ko

3.创建物理桥
virsh iface-bridge eth0 br0
查看网络
[root@localhost ~]# ifconfig
br0      Link encap:Ethernet  HWaddr 00:0C:29:C1:62:56 
          inet addr:192.168.150.136  Bcast:192.168.150.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fec1:6256/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4925 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3937 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:532933 (520.4 KiB)  TX bytes:13484199 (12.8 MiB)
eth0      Link encap:Ethernet  HWaddr 00:0C:29:C1:62:56 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:377686 errors:0 dropped:0 overruns:0 frame:0
          TX packets:110643 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:507725096 (484.2 MiB)  TX bytes:66233641 (63.1 MiB)

4.创建一块虚拟磁盘:
qemu-img create -f qcow2 /kvm/test003.img 5G

5.创建一个虚拟机:
qcow2格式
[root@localhost ~]# virt-install –name test003 –ram 512 \
–vcpus=1 –disk path=/kvm/test003.img,size=5,format=qcow2,bus=virtio \
–accelerate –cdrom /tmp/CentOS-6.6-x86_64-minimal.iso\
 –vnc –vncport=5910 –vnclisten=0.0.0.0\
 –network bridge=br0,model=virtio –noautoconsole
 raw格式:
 [root@localhost ~]# virt-install –name test003 –ram 512 \
–vcpus=1 –disk path=/kvm/test003.img,size=5,bus=virtio \
–accelerate –cdrom /tmp/CentOS-6.6-x86_64-minimal.iso\
 –vnc –vncport=5910 –vnclisten=0.0.0.0\
 –network bridge=br0,model=virtio –noautoconsole

6.VNC连接

快速搭建KVM及安装Linux系统快速搭建KVM及安装Linux系统

————————————–分割线 ————————————–

Linux入门学习教程:虚拟机体验之KVM篇  http://www.linuxidc.com/Linux/2015-03/114462.htm 

RHEL6 KVM虚拟化创建桥接网卡-网桥 http://www.linuxidc.com/Linux/2013-08/88517.htm

RedHat Linux KVM虚拟机桥接 http://www.linuxidc.com/Linux/2013-02/79934.htm

CentOS 5.6下KVM的安装/桥接设置/虚拟机创建及运行 http://www.linuxidc.com/Linux/2012-12/76883.htm

Ubuntu下用libvirt安装KVM虚拟机时找不到/bin/qemu-kvm问题解决 http://www.linuxidc.com/Linux/2013-08/88985.htm

RedHat6.5下安装配置KVM虚拟机 http://www.linuxidc.com/Linux/2014-10/107972.htm

————————————–分割线 ————————————–

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-03/115004.htm

赞(0) 打赏
转载请注明出处:服务器评测 » 快速搭建KVM及安装Linux系统
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏