Currently I don't use KVM on OMV
I recommend to USE PROXMOX or OTHER HYPERVISOR
====================================
Why KVM not using virtualbox?
- more performance (benchmark is here)
(but if you content with virtualbox performance, keep continue using) - pci passthrough
especially vga passthrough supported (what is vga passthrough? watch this video)
What is WebvirtMgr
see first what it is, screenshot is here
How to install?
webvirtmgr uses libvirt (cli interface for KVM, and other hypervisor such as XEN)
and libvirt uses KVM (already included in linux kernel) and qemu
for OMV 3.x
apt-get install -t jessie-backports python-dev libxml2-dev libvirt-dev zlib1g-dev python-pip ebtables dnsmasq libvirt-bin git supervisor virtualenv pkg-config build-essential qemu
usermod -a -G libvirt www-data
usermod -a -G kvm www-data
cd /var/www/
git clone https://github.com/luxflow/webvirtmgr
cd webvirtmgr
virtualenv env
source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
./manage.py syncdb
./manage.py collectstatic
deactivate
chown -R www-data:www-data .
echo -e '''[program:webvirtmgr]
command=/var/www/webvirtmgr/env/bin/python /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr.log
redirect_stderr=true
user=www-data
[program:webvirtmgr-console]
command=/var/www/webvirtmgr/env/bin/python /var/www/webvirtmgr/console/webvirtmgr-console
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=root''' > /etc/supervisor/conf.d/webvirtmgr.conf
systemctl stop dnsmasq
systemctl restart libvirtd
systemctl enable supervisor
systemctl start supervisor
Alles anzeigen
(for OMV 2.x change
`jessie-backports` to `wheezy-backports`
`virtualenv` to `python-virtualenv`
change `2.9.1` to `2.8.0` using `nano /var/www/webvirtmgr/requirements.txt`
`systemctl stop dnsmasq` to `/etc/init.d/dnsmasq stop`
`systemctl retstart libvirtd` to `/etc/init.d/libvirtd restart`
`systemctl enable supervisor` to `update-rc.d supervisor defaults`
`systemctl start supervisor` to `/etc/init.d/supervisor start`
)
by default, webvirtmgr listen on 127.0.0.1:8000
so you cannot access without ssh tunneling (guide is here)
another method is change listen address but it is not secure
vim /var/www/webvirtmgr/conf/gunicorn.conf.py
change
bind = '127.0.0.1:8000'
to
bind = '0.0.0.0:8000'
but be sure! http connection is not secure your data can be sniffed
(I don't explain about this detail but this is easy, hacker in public wifi, evil goverment can see your packet)
I'am planning to make a guide for how to setup secure https and reverse proxy but I'm not sure when
when I make a guide I will link it here
Known bug
1. In storage menu
creating ISO dosen't work
workaround for this is create DIR with name 'iso' (case sensitive)
2. In webconsole, key AltGr in German keylayout dosen't work
Optional: VGA Passthrough (for advanced user)
Requirement
- your motherboard and cpu support vt-d which is differnt from vt-x
you should enabled vt-d in your bios setting ( search google your cpu model to know it is support vt-d) - your kernel should be at least >=3.9
so you shuld install backports kernel in OMV 2.x (in OMV 3.x, stock kernel is ok, but I recommend backports kernel too) - you have at least 2 gpu in your system, one graphic card is for host (intergrated, external graphic all ok), the other are for guest (external graphic card only)
- An UEFI compatible GPU (Most modern gpus support this, Does my graphics card ROM support EFI?
- An UEFI compatible GUEST (ex: Windows 7 and up)
Setup
you shuld update kernel boot parameter
for intel cpu
append kernel boot parameter permanently `kvm.ignore_msrs=1 intel_iommu=on` (click here)
and reboot
check lspci -Dnn
result format is
domain:bus:slot.function device_name [vender_id:device_id]
find your graphic card with device_name
edit /etc/rc.local
below is example for gpu pass through
change constant according to your graphic domain:bus:slot.function
I enclose constant that you need to change with []
after that execute /etc/rc.local
for OMV 3.x ( for OMV 2.x change all vfio-pci to pci-stub except `modprobe vfio-pci`, change it to `modprobe pci_stub`)
echo -e '''#!/bin/sh -e
modprobe vfio-pci
#NVIDIA GRPAHIC
#echo [0000:01:00.0] > /sys/bus/pci/devices/[0000\:01\:00.0]/driver/unbind
#echo [10de 128b] > /sys/bus/pci/drivers/vfio-pci/new_id
#echo "vfio-pci" > /sys/bus/pci/devices/[0000:01:00.0]/driver_override
#echo [0000:01:00.1] > /sys/bus/pci/devices/[0000\:01\:00.1]/driver/unbind
#echo [10de 0e0f] > /sys/bus/pci/drivers/vfio-pci/new_id
#echo "vfio-pci" > /sys/bus/pci/devices/[0000:01:00.1]/driver_override
exit 0''' > /etc/rc.local
Alles anzeigen
install OVMF bios for qemu
for OMV 3.X apt-get install ovmf
for OMV 2.X
wget http://ftp.us.debian.org/debia…131112.2590861a-3_all.deb
dpkg -i ovmf_0~20131112.2590861a-3_all.deb
create VM in webvirtmgr, go settings -> XML in webvirtmgr
append hostdev elements, and loader like below exmaple
change bus slow function to your gpu
<domain>
...
<os>
<loader type='pflash'>/usr/share/ovmf/OVMF.fd</loader>
</os>
...
<devices>
...
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='pci' managed='yes'>
<driver name='vfio'/>
<source>
<address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</source>
</hostdev>
...
</devices>
</domain>
Alles anzeigen
Optional: intel intergrated gpu (intel HD) passthrough (for advanced++ user)
Requirement
- intel cpu >= sandybridge
- no need to additional external graphic card
- kernel >= 4.6 (if you are OMV 2.X manually compile kernel, if you are OMV 3.X install backports kernel)
- qemu >= v2.7.0-rc0 (there is no official package for this, manually packaging it)
- latest seabios (also you should manually compile)
see manual (I belive advanced++ user, and I'm lazy )
Question & Discussion
here
you can ask question if something goes wrong