I am trying to setup KVM in ubuntu 14.04 host machine.
I use a wireless interface to access the internet in my machine. I have setup the wireless interface in my
auto wlan0 iface wlan0 inet static address 192.168.1.9 netmask 255.255.255.0 gateway 192.168.1.1 wpa-ssid My_SSID wpa-psk SSID_Password dns-nameservers 126.96.36.199 dns-search lan dns-domain lan
I checked if my machine is available for virtualization and this command confirms that my hardware supports virtualization.
egrep '(vmx|svm)' /proc/cpuinfo
I installed the necessary packages for kvm virtualization as below.
apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder
I also installed the bridge utils package to configure bridge network for my kvm.
apt-get install bridge-utils
I modified my
/etc/network/interfacesto allow the bridged network as below.
auto br0 iface br0 inet static address 192.168.1.40 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 gateway 192.168.1.1 dns-nameservers 188.8.131.52 dns-search lan dns-domain lan bridge_ports wlan0 bridge_stp 0ff bridge_fd 0 bridge_maxwait 0 wpa-ssid my_ssid wpa-psk ssid_password
After the above step, I am able to
ping 192.168.1.40and also I could see there is br0 and virbr0 listed in the output of
ifconfig -acommand. I am also able to access the internet without any problem with my wireless interface.
However, after the above step if I try to add another OS using
ubuntu-vm-buildercommand, I am not able to add a new OS. This is the command I use to add a new OS.
sudo ubuntu-vm-builder kvm trusty \ --domain rameshpc \ --dest demo1 \ --hostname demo1 \ --arch amd64 \ --mem 1024 \ --cpus 4 \ --user ladmin \ --pass password \ --bridge br0 \ --ip 192.168.1.40 \ --mask 255.255.255.0 \ --net 192.168.1.0 \ --bcast 192.168.1.255 \ --gw 192.168.1.1 \ --dns 184.108.40.206 \ --components main,universe \ --addpkg acpid \ --addpkg openssh-server \ --addpkg linux-image-generic \ --libvirt qemu;///system;
I have seen that setting a bridged network using a wireless interface is quiet complicated as discussed in this question. However, as the answer describes it is possible using a tunneling device. I have tried the option as suggested in this link. But I couldn't get it to work.