Pages

Unixbhaskar's Blog

Thursday, December 8, 2011

Using kvm on Arch Linux to install CentOS 6

This is mighty interesting and damn easy thing to do for better way to use and test new releases.I am gonna show you how you can exploit the power of KVM with minimal fuss.So here we go:

I am sitting on Arch Linux and got to bring in the kvm thing into the box..so I went ahead and do this :


bhaskar@ArchLinux_12:24:23_Thu Dec 08:~> sudo pacman -S qemu-kvm
resolving dependencies...
looking for inter-conflicts...

Targets (2): vde2-2.3.1-1 qemu-kvm-0.15.1-1

Total Download Size: 1.96 MB
Total Installed Size: 10.31 MB

Proceed with installation? [Y/n] y
:: Retrieving packages from extra...
vde2-2.3.1-1-i686 177.1K 58.0K/s 00:00:03 [#####################################################################] 100%
qemu-kvm-0.15.1-1-i686 1829.6K 62.8K/s 00:00:29 [#####################################################################] 100%
(2/2) checking package integrity [#####################################################################] 100%
(2/2) checking for file conflicts [#####################################################################] 100%
....
.....



Then I add myself to the kvm group like below:


bhaskar@ArchLinux_12:26:58_Thu Dec 08:~> sudo /usr/sbin/usermod -G kvm -a bhaskar

bhaskar@ArchLinux_12:27:12_Thu Dec 08:~> id bhaskar
uid=1000(bhaskar) gid=1000(bhaskar) groups=1000(bhaskar),92(audio),78(kvm)



Next, I modprobe two kernel module to integrate with the system like below:



bhaskar@ArchLinux_12:27:58_Thu Dec 08:~> sudo /sbin/modprobe kvm-intel

bhaskar@ArchLinux_12:28:10_Thu Dec 08:~> sudo /sbin/modprobe kvm



And the result shows like this :


bhaskar@ArchLinux_12:28:24_Thu Dec 08:~> sudo /bin/lsmod | grep kvm*
kvm_intel 116373 0
kvm 294406 1 kvm_intel



Then,the final step ,oh btw I have the ISO image of CentOS6 already downloaded in my system, so it easy to use...

So I went ahead like this to boot it from that ISO file by kvm:


bhaskar@ArchLinux_12:39:04_Thu Dec 08:~> qemu-kvm -enable-kvm -cdrom /home/bhaskar/Downloads/CentOS-6.0-i386-bin-DVD.iso


And here is how it look like the initial screen:



So ,pretty easy..huh..you can pass hell lot of option to that command line of qemu-kvm to fine tune you instances.

Hope this will help.

Cheers!
Bhaskar

No comments:

Post a Comment