______________________________________________________________________________________________________________
______________________________________________________________________________________________________________
THIS GUIDE HAS BEEN MOVED TO THE OMV-EXTRAS WIKI.
FOLLOW THIS LINK -> https://wiki.omv-extras.org/do…?id=omv7:omv7_plugins:kvm
______________________________________________________________________________________________________________
______________________________________________________________________________________________________________
1.
INTRODUCTION
The OPENMEDIAVAULT-KVM plug-in provides a virtualization tool built into the OMV GUI. We may have one or more "guest" operating systems remotely accessible on the server. Said in a "simple" way, having a server within the server.The plugin uses LIBVIRT internally, so virsh commands will work if necessary. If you create a VM with the plugin, you can also make changes to that VM with virt-manager, any missing features in the plugin are probably available in virt-manager or virsh.The access and visualization methods provided can be through standard viewers such as VNC, SPICE, or integrated into the web through NOVNC and spice-html5, facilitating access to the guest operating system from any browser.
2.
REQUIREMENTS
Have a processor with virtualization capacity. Check the characteristics on the CPU manufacturer's website.-
Activate the virtualization feature in the server BIOS. See the manual for the server motherboard. -
Having enough RAM to allocate to the virtual machine, and leaving enough RAM available for OMV. To install the openmediavault-KVM plugin:Install OMV-EXTRAS, see hereIn the OMV GUI go to System> Plugins> Search and select the openmediavault-KVM plugin, click on Install.
3.
USE OF THE COMPLEMENT
3.1
Previous steps
We need to create two folders. They can be shared folders, The libvirt-qemu user must have execute permissions on these folders (and the path to them, check the permissions of the used disk mount point). Customize the paths based on your file system./srv/dev-disk-by-uuid-........../pool. One of them we call "pool", it will be destined to store the virtual disks used in KVM./srv/dev-disk-by-uuid-........../ISOS. The second we call "ISOS", it is where we store the isos of the VMs we create.
Go to the download web of the operating system you want to install and download the installation ISO. Copy the ISO to the "ISOS" folder.
3.2
Configure "pool" and "ISOS" as storage groups in
KVM
In the OMV GUI go to Services>KVM>Pools> and click on + Add new poolIn the window define the following:-
Name: pool -
Type: Directory -
Path: Click on the icon on the right, find and select the folder /srv/dev-disk-by-uuid-........../pool
-
While remaining in the Pools tab, repeat the process for the ISOS folderYou need to activate both folders. To do this, select one of the folders, press the State button in the menu, then Start. Repeat the process with the second folder. In the State column you should see running in both folders.If we now go to Services>KVM>ISOs, we should see the iso previously copied, ready for use.
3.3
Network Configuration
In the OMV GUI go to Services>KVM>Networks> Any network interface that we are going to use must be activated. Select the interface line and click on State then Start. In the column Network state we must see Active.We will see a default network already configured. This interface will be able to access the host's resources, but it will not have an IP in our LAN, if not in a subnet.If we want the VM to have an IP in our LAN we can use a Macvtap bridge. This interface will be able to access shared resources on the network, but will not be able to access shared resources on the host. To do this, press the + Add button and press Add Macvtap network button. In the window define the following:Name: bridgeNetwork adapter: Select our network interface (you can see which it is in Network>Interfaces> The name of the network adapter appears in the Device column.
If we want a network interface that has an IP in our LAN and at the same time can access the shared resources of the host, we must create a bridge interface in OMV (in the Network>Interfaces section) as follows. Warning: This method will remove the current network interface configuration and replace it with a jumper. If you have services configured on the host with this network interface (for example, Wireguard), you will need to reconfigure them to work with the bridge:Go to Network>Interfaces> Make a note of the network interface name that appears under the Device column. Select this interface and click delete, BUT do not apply changes yet.Without applying the changes of the previous point, click on + Create then on Bridge. In the Interfaces field, find the name of our newly removed interface and select it. Enter the necessary data for the Ipv4 protocol with static IP, for this in Method select Static. Fill in the fields:IP: Your OMV IPNetmask: 255.255.255.0Gateway: IP of your DHCP server (your router)DNS: For example 1.1.1.1
Press Save and now you can apply the changes. Now your OMV network interface will have a name similar to br0. This is the bridge-type interface that you should select on your VM.Add the newly created network interface (br0) to your VM. You should not create an interface in KVM, macvtap or any other.If you already have a VM created:stop it, remove the current interface assigned and simply select your VM and click on Network and then Add Network. In Model change virtio to bridge. In Bridge look for the network interface created in OMV, it will be br0 (or similar). Press Add.
If you are creating a new VM:In the VM creation window, go to the Network section and change virtio to bridge. In the next field select your network interface br0.
3.4
Configure the Virtual Machine
In the OMV GUI go to Services> KVM> VMs> Press the +Add buttonIn the window define the following:OPTIONS:-
VM name: The one we want. Don't use space, don't repeat VM names. -
OS: Choose the right one for the system to install. In this case Generic Linux -
UEFI: Can if necessary for some reason. We leave it deactivated. -
CPUs: We assign the CPUs that we want according to our processor. In this case we have a CPU with 2 cores and 4 threads. We assign 2. -
Memory: The one we have available depending on the case. In this case we have 8 GB and we assign 4 GB to it.
-
STORAGE VOLUME:-
Volume: Choose to Create new disk. A dialog box opens asking for the pool for that volume. -
Pool: We select "pool", here the virtual disk for the VM will be created. -
Name: The name we want to identify the virtual disk. If we leave it blank it will be the same as the virtual machine. -
Size: Size of the virtual hard disk, at least what the VM you are going to create needs. In this case 30GB. -
Format: The format that will be given to the disk. We leave it as is if there is no reason to change it, qcow2.
-
OPTICAL DRIVE:-
CD: In the drop-down select the ISO you want to install.
-
NET:-
Model: We leave it as is, virtio. If we have created a bridge br0 in OMV we change this value to bridge. -
Network: We select in the drop-down the network interface created in the previous point.
-
If there is a special reason for this, we can configure various options by clicking the Show advanced options button at the top of the window. The option to activate the sound, change the architecture, the chipset will appear, disc bus...Click on Save and we should have our machine ready to boot. In the Services>KVM>Volumes we should see that the volume containing the VM has been created.
To start the virtual machine we select it and click on the State button, then click Start. The status will change to running and we can now access the VM.
3.5
Access to the VM
Once the VM starts, we have 4 alternatives to access the VM, try the one that works best for you:Access from the web noVNC and spice-html5. Press the Console button then Start, you can change the ports if you need (If the buttons are not activated try to change the value of one of the ports and leave it as it was), press Start Two links will appear in the noVNC and spice-html columns. We just have to click on one of them and a window will open in our browser with direct access to the VM.
Spice viewer. In the spice column we have the port to use, 5901. We need a viewer such as virt-viewer see here.
VNC viewer. In the VNC Port column we have the port to use, 5900. We need a VNC viewer see here.
4.
MORE INFORMATION
Forum thread dedicated to this plugin New openmediavault-kvm plugin
Backup function see here
Problems with Windows VMs:
enjoy it !!