OMV is a fantastic system like the swiss army knife of soho networking. As you have many tools in your workshop you some times need to run other things than your OMV installation supports.
These other things can be run in a virtual machine on your OMV box.
On my home OMV i am currently running a server with iRedMail/Roundcube and Owncloud. I am planning on moving my mythtv backend to a second vm on my OMV installation.
This is a howto that describes how I made KVM/qemu/libvirt work under my OMV install. I choose to run KVM as a host platform for guest VM's because KVM is a intregral part of the Linux kernel and I believe that KVM is the hypervisor technology that is most efficient on Linux host systems. I used qemu and libvirt together with KVM for the same reasons. They work on the standard Linux kernel – no compilation and no kernel replacement. Stability and security is the most important factor when it concerns my household and our many irreplaceble personal data on our OMV NAS.
This howto is based on a OMV that runs Squeeze backports. I don't know how it will work on standard Squeeze kernel. I have ”sudo” installed and my OMV gets it's ip-address from a static lease from my DHCP server. If you dont' have sudo install you can remove sudo from all my examples.
To install Squeeze backports see http://forums.openmediavault.o…ic.php?f=10&t=2258#p13821
First check if you CPU has virtualisation capability buildin.
look for 'svm' or 'vmx'. If neither of these is shown you cannot run KVM on your CPU and you must use another virtualisation technology like VirtualBox.
Install KVM,libvirt and qemu.
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get -t squeeze-backports install qemu-kvm bridge-utils kvm libvirt-bin virtinst
Since my KVM guest vil be a server, i need to be able to access the guest through it's own Ip-address and through NAT'ed connection from the internet. To this i need setup a network bridge on the host.
Edit /etc/network/interfaces so it looks like this:
# 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
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet manual
#iface eth0 inet6 manual
auto br0
iface br0 inet static
address <Your-IP-Address>
netmask <Your-Netmask-Address>
network <Your-Network-Address>
broadcast <Your-Broadcast-Address>
gateway <Your-Gateway-Address>
bridge_ports eth0
bridge_fd 0
bridge_hello 0
bridge_maxage 0
bridge_stp off
dns-nameservers <Your_DNS-Server-IP>
Alles anzeigen
or if you like me assigns the ip through a static lease from your router/dhcp server:
# 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
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet manual
#iface eth0 inet6 manual
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 0
bridge_hello 0
bridge_maxage 0
bridge_stp off
Alles anzeigen
restart nework with the new settings:
make your adminuser member of the kvm and libvirt groups
Logout and login to make sure taht you have the new group membership in effect.
Test if everything is working in your OMV and that
shows your new br0 interface
Start kvm and test if kvm is running
you should se someting like (depending on you processor Intel|AMD)
Check that KVM and libvirt is installed and running
since you have no virtual machines defined or running you should se something like
Baiscally you now have a KVM host running. The host can be managed from either the commandline or by the application virt-manager installed on any machine on your network.
install virt-manager to create and manage your hosts and guests
To install virt-manager on another pc (mine are al Ubuntus or Debians) run:
Start virt-manager – choose add connection, chose hypervisor QEMU/KVM and insert the ip of your host system. Login with the hostssystems adminuser and password.
Enter passwords etc.
Now you have a virt-manager console connected to your OMV KVM hostssystem. In here you define and administer virtual guest vm's and storage areas on your OMV host. Define your vms and boot them from the downloaded iso files. I have defined two standard images – one Debian Wheeze and One Ubuntu 12.04.2. When ever i wan't to try something I make a clone of one of these and run the clone. Since KVM is a complete virtualisation host you can run all guest OS'es that run on x86 (32bit or 64bit). I haven't tried Windows guests because we don't have the need for Windows in our family.
New to virt-manager and kvm – here's a short howto on defining storage pools and starting your first guest vm.
Defining storage pools and your first guest vm
Open virt-manager and connect to your host machine (OMV).
Click ”connection details” move to the storage tab. Click on ”New Volume” and create a storage volume of your liking. I place my storage on a OMV share. Select the RAW format as this is the most cpu and disk efficient – remember the host is build on a low power cpu.
Set the storage pool as started on boot.
Create a storage volumes for you first guest machine. Make it of an fitting size. .raw images is of fixed size like ordinary harddisks and can only be altered with the same tools as ordinary disks. .qcow2 images can be altered by virt-manager but the again .qcow2 isn't as cpu and disk/io efficiet as .raw
I have not defined Virtual networks since all my guests are servers and they need to be accessible from the outside so they will use the defined network bridge in /etc/network/interfaces. If you will run a workstation machine like a win desktop you can define and use virtual networks for this.
Close the ”Connectons Details” window.
Copy the iso image that you would like your vm's to install from into the directory of your defined storage pool this is easy if you have placed the storage poll on a share on your OMV.. You can have a selection of iso's to install from when you create machines.