KVM-Qemu VM Setup in CentOS 6.6 Minimal :) 
Follow these simple steps to install a VM in a minimal installation of CentOS 6.6 :

[acool@localhost ~]$ # 1.- install all these
[acool@localhost ~]$ sudo yum groupinstall "Virtualization Platform" "Virtualization Tools"
[acool@localhost ~]$ sudo yum install python-virtinst
[acool@localhost ~]$ sudo yum install bridge-utils
[acool@localhost ~]$
[acool@localhost ~]$ # 1.a- dd image from CD-ROM
[acool@localhost ~]$ sudo dd if=/dev/sr0 of=/usr/share/CentOS-6.6.iso
[acool@localhost ~]$
[acool@localhost ~]$ # 2.- start this
[acool@localhost ~]$ sudo service libvirtd start
[acool@localhost ~]$ sudo chkconfig libvirtd on
[acool@localhost ~]$
[acool@localhost ~]$ # 3.- modify eth0 and create network bridge file
[acool@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=90:2B:34:10:25:C0
TYPE=Ethernet
UUID=c74e1b53-a135-4573-ac74-8fd00b06a7ea
ONBOOT=yes
NM_CONTROLLED=no
BRIDGE=br0
[acool@localhost ~]$
[acool@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.45
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=4.2.2.2
DNS2=4.2.2.1
DNS3=8.8.8.8
[acool@localhost ~]$ # 4.- restart networking
[acool@localhost ~]$ sudo service network restart
[acool@localhost ~]$
[acool@localhost ~]$ # 5.- put all these parameters in a file
[acool@localhost ~]$ cat virt-install.sh
sudo virt-install --connect qemu:///system \
-n vm20 \
-r 1024 \
--vcpus=2 \
--disk path=/var/lib/libvirt/images/vm20.img,size=12 \
-c /usr/share/CentOS-6.6.iso \
--graphics vnc \
--noautoconsole \
--os-type linux \
--accelerate \
--network=bridge:br0 \
--hvm
[acool@localhost ~]$
[acool@localhost ~]$ # 6.- create VM !!
[acool@localhost ~]$ ./virt-install.sh

Starting install...
Allocating 'vm20.img' | 12 GB 00:00
Creating domain... | 0 B 00:00
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
[acool@localhost ~]$
[acool@localhost ~]$ # 7.- make sure it's running
[acool@localhost ~]$ sudo virsh list --all
Id Name State
----------------------------------------------------
1 vm20 running
[acool@localhost ~]$
[acool@localhost ~]$
[acool@localhost ~]$ # In another computer, open Virtual Machine Manager and connect to 192.168.1.45 and install linux in vm20 :)


Comments
Comments are not available for this entry.
2024 By Angel Cool