Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

[ubuntu] Installation of KVM virtualization on ubuntu server 12.04

$
0
0

http://www.dedoimedo.com/computers/kvm-intro.html

https://help.ubuntu.com/community/KVM/Networking

Condolidated the guid from the above two links.
I have installed on Ubuntu 12.04 server 64bit version. Converted all my production servers from VMWare Server 2.0 to KVM.
I have tried various virtualization products and finally settled on KVM.

check the CPU for virtualization support - If the following command displays anything other than 0 then it is supported

egrep -c '(vmx|svm)' /proc/cpuinfo

Next step is to check the virtualization is enabled in the bios. To check issue the following command. $ /usr/bin/kvm-ok
or $ /usr/sbin/kvm-ok
If the command is not available, then install cpu-checker $ apt-get install cpu-checker
The command should display something like below. $ INFO: Your CPU support KVM extensions
$ INFO: /dev/kvm exists
$ KVM acceleration can be used
Now install kvm $ apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager virtinst
$ apt-get install ubuntu-vm-builder
add the current user to the group 'libvirtd' $ adduser 'root' libvirtd
Next step is to add bridged network interface. By default KVM doesn't come with bridged network interface. Only NAT. $ apt-get install qemu libcap2-bin
Ubuntu 10.4 (Lucid) and later - Grant specific users the CAP_NET_ADMIN capability.

This capability should be assigned cautiously, as it will allow those users to disrupt all networking on the system.

Give qemu the inheritable CAP_NET_ADMIN capability for 64bit systems $ sudo setcap cap_net_admin=ei /usr/bin/qemu-system-x86_64
for 32bit $ sudo setcap cap_net_admin=ei /usr/bin/qemu-system-i386
Allow specific users to gain the inheritable CAT_NET_ADMIN capability by editing /etc/security/capability.conf

add the following line. cap_net_admin root
Creating a network bridge on the host $ invoke-rc.d networking stop
If you are working from a remote host, you might get disconnected, and if there was mistake, you won't get connected.

If you are working from a remote host, make the following changes, issue the restart command, you will get reconnected

after a brief period of disconnection. auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0

If you are on DHCP then, auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
/etc/init.d/networking restart
So, from now on when you create a new VM you can choose 'br0' interface, instead of the default one.

That is all for the host side installation.

To manage a KVM host you need Virtual Machine Manager(VMM)

which we have already installed in the host system.

Now you can install VMM in any Ubuntu client to manage the KVM Hosts. $ apt-get install virt-manager.
you are good to go.

You can directly mount .vmdk files in KVM. Don't need any convertion.

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>