How to install a KVM host and configure KVM with libvirt and Open vSwitch on Ubuntu 14.04 Trusty Tahr. The following steps have been tested on freshly installed server installation. Let’s start from scratch by installing all required packages.
Install required packages
# apt-get install openvswitch-switch qemu-kvm libvirt-bin
And wait until all packages are downloaded and installed.
Afterwards, let’s continue by destroying the default bridge and creating the new ovs bridge.
# ovs-vsctl add-br ovsbr0 # virsh net-destroy default
Edit the config from the default bridge with this command.
# virsh net-edit default
And make sure, you change the file to this:
<network> <name>ovsbr0</name> <forward mode='bridge'/> <bridge name='ovsbr0'/> <virtualport type='openvswitch'/> </network>
Remove the old bridge completely and make sure the new bridge is autostarted.
# virsh net-undefine default # virsh net-autostart ovsbr0
I’d like to keep my networking configuration in /etc/network/interfaces. That’s why I added the following section to that file.
auto ovsbr0 iface ovsbr0 inet static address 172.16.11.1 network 172.16.11.0 netmask 255.255.255.0 broadcast 172.16.11.255 iface ovsbr0 inet6 static address 2001:xxxx:xxxx:1::1 netmask 64
Test new installed KVM host
Now reboot your machine and check with following commands if you’re network is properly configured.
# virsh net-list # ip addr # ovs-vsctl show
Congratulations! You’ve installed a KVM host. Now you can proceed and install virtual machines on this new host. The network interfaces will be added to the freshly created Open vSwitch bridge.
Edit on 2014/05/14 : changed the ovsbr0 XML file
Edit in 2014/05/28 : only tested on a Server installation of Ubuntu 14.04