Wednesday, August 4, 2010

KVM: Install and run KVM on Ubuntu 10.04 64-bit

Install Ubuntu 10.04 64-bit, choose only "OpenSSH" server at install.

Login and Promote yourself to root:

sudo su

Check if your computer has Virtualization Friendly CPU:

egrep '(vmx|svm)' --color=always /proc/cpuinfo

Install necessary software (KVM, libvirt, virt-install, etc)

aptitude install -y ubuntu-virt-server python-virtinst virt-viewer

This will take care of most stuff, including a network bridge, libvirtd, etc.

Optional: To put the VMs in the same subnet as the host, you need to bridge your network (not using the virbr0 that was provided by libvirt).

The following script will do it if eth0 is your NIC to the subnet, and you have DHCP.

cp /etc/network/interfaces /etc/network/interfaces.bk

cat > /etc/network/interfaces <

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
EOF

Restart network:
/etc/init.d/networking restart

3. Now we install a Ubuntu10.04 Client:
Prepare a directory for the new VM

mkdir ubuntu_10.04_64_base_kvm
cd ubuntu_10.04_64_base_kvm
wget http://mirrors.login.com/ubuntu-iso/lucid/ubuntu-10.04-server-amd64.iso

virt-install --connect qemu:///system -n ubuntu_10.04_64_base_kvm -r 1024 --vcpus=1 --os-type=linux --os-variant=virtio26 -b virbr0 --arch=x86_64 --disk path=./ubuntu_10.04_64_base_kvm.img,size=20 --vnc --accelerate --disk path=./ubuntu-10.04-server-amd64.iso,device=cdrom







3 comments:

  1. The install process is stuck after the following message:
    Setting up qemu-kvm (0.12.3+noroms-0ubuntu9.2) ...

    ReplyDelete
  2. Polo Ralph Lauren Corporation is a leader in the design,marketing and distribution of premium lifestyle products in four categories: apparel,home, accessories and fragrances. For more than 43 years, polo ralph lauren outlet reputation and distinctive image have been consistently developed across an expanding number of products, brands and internation markets

    Polo Ralph Lauren Corporation is a leader in the design,marketing and distribution of premium lifestyle products in four categories: apparel,home, accessories and fragrances. For more than 43 years, ralph lauren outlet reputation and distinctive image have been consistently developed across an expanding number of products, brands and internation markets

    Abercrombie ia an American based retailer and fashion brand for casual apparel for men, women and childre. It stocks personal care items, casual clothing,and discount deals.It operates on a multinational basis with more than 1000 stores as well as online shopping and enjoys a huge and loyal customer base which loves abercrombie coupons range and latest style.

    ReplyDelete
  3. ok u have some errors first, ur bridge ist br0 no virbr0, virbr0 appears cause u installe the bridge utils first, 2 u can configure just the virbr0 to make the bridge network, 3 u r using a linux version for 64 bits, u MUST check if ur pc can handle it first always, u never say that the virtualizations its capable by hardware, this is on the bios... =D plz make a better tuto next time =D

    ReplyDelete