Introduction

Often when preparing a course it's useful to virtualise a server within DaDesktop, and perhaps virtualise one or two client machines too in the same way, either using the same OS or a Windows/Linux mix.

Running 'Nested VMs' can be done either using Virt Manager or VirtualBox with vagrant optionally when using Linux, or VirtualBox if using Windows 10 as the DaDesktop machine.

DD Machines Nested Virt

After extensive testing our suggested preference is to use Virt Manager, as there are a couple of bugs if using VirtualBox; therefore currently, we do not suggest use of VirtualBox in this manner.

The VirtManager application uses the libvirt library to provide virtual machine management services. It has a desktop interface that helps to create, delete, and manage multiple virtual machines. It is primarily used for KVM VMs but can support other hypervisors as well, such as Xen, and LXC.

Virt Manager also works very well with Vagrant, simply  :-          

apt install vagrant-libvirt

It's worth noting that there are fewer Vagrant boxes available using libvirt/kvm compared to VirtualBox, but these can be easily converted to work with libvirt as shown here :-

https://medium.com/@gamunu/use-vagrant-with-libvirt-unsupported-boxes-12...
 

The user interface provides a summary view of all VMs their status, CPU usages, LIVE performance graph of running VMs, and resource utilization statistics.

If you haven't used Virt Manager before, it's very similar to VirtualBox but with a few important differences as described below.

This is a decent guide concerning using virt-manager on Ubuntu Linux - https://www.debugpoint.com/virt-manager/

 

Why should I use Virt Manager instead of Virtualbox?

Advantages
  1. Performance is much better - Virt Manager uses VirtIO drivers for storage, networking and graphics this provides much better performance. Virtio drivers are KVM's paravirtualized device drivers, available for Linux and Windows guest virtual machines running on KVM hosts. The virtio package supports block (storage) devices and network interface controllers, and graphics. VirtIO drivers are open source so easily installed if not already pre-installed on your Linux distro.
  2. More configurability options available
  3. Works well with Vagrant
  4. Some parts of VirtualBox are not fully open source
  5. Virt Manager does not need module recompliles whenever a new kernel upgrade is made as is the case for VirtualBox.
  6. VirtualBox is sometimes known to break when a new kernel upgrade is required.
Disadvantages
  1. VirtualBox may be said to have a slightly shorter learning curve
  2. Setting up 'Host networking' rather than NAT is easier on VirtualBox, however NAT works for most networking use cases quite easily on both systems.
  3. VirtualBox is available on many platforms however Virt Manager is only available on Linux


All in all, we find that for running servers within a DaDesktop machine, that Virt Manager is preferred.

 

Installation

Because libvirt is improving all the time, always use the latest non LTS Ubuntu or Debian version.

Installation of kvm, virt-manager. These are very brief install notes, however please follow an up to date guide for your preferred DaDesktop OS. This is one guide https://www.debugpoint.com/virt-manager/

sudo apt install virt-manager
sudo adduser student libvirt
sudo systemctl restart libvirtd

Reboot DaDesktop machine, Run Virt Manager from Applications menu

 

Configuration

  1. How do I import or convert virtual machines ? Although it is easy to create vm's built to your requirements of operating system and specification very easily, often for more complicated setups, it's preferred to import an existing VM set-up of a particular server or appliance. Often these are supplied as VMDK images which can be added directly to Virt Manager, although it's not clear that this is indeed possible, with the current version. For Virtual Box server images these cannot be imported (added) directly to Virt Manager, but can be easily exported into other virtualisation formats such as open Virtualisation Format (.OVF) which Virt Manager can import easily. Otherwise you could use VmWare Convertor if you have it, or Virt-V2V instead https://www.redhat.com/en/blog/importing-vms-kvm-virt-v2v. Qemu-convert is also a great open source tool that allows easy conversion between different virtual machine formats.
    To Convert from VirtualBox to Virt Manager KVM format follow these instructions https://ostechnix.com/how-to-migrate-virtualbox-vms-into-kvm-vms-in-linux/
  2. Best way to import large files inside standalone. Currently, there is no direct way in DaDesktop to access files or virtual machine files from the machine you are physically using. Instead, consider using a Cloud files tool such as Google Drive, Microsoft 365, etc. These can then be accessed by logging into the tool inside the DaDesktop machine. We are hoping to add an integrated tool to assist with this operation.
  3. When importing other virtual machines especially from other formats, often you will need to change graphics and / or disk types.  One of the best things about Virt Manager is that it includes really great support for VirtIO drivers. These are open source fully virtualised drivers that provide much better performance compared to original disk, network or graphic drivers, and are available for nearly all operating systems including excellent support for guest Windows 10 machines. If your Guest OS supports them, these are usually the preferred option for compatibility and performance when using VIrt Manager (KVM). https://wiki.archlinux.org/title/Libvirt
  4. Optimal settings for virtual machines using Virt Manager VirtIO drivers are included in almost all open source server operating systems nowadays, and can be installed easily in Windows. Generally the best drivers are virtio, but in some cases you may to use one of the many other types. Generally NAT is sufficient for most cases of networking unless you require a more complicated set-up where Bridged Host networking may be required, however this is generally more tricky to get working easily. 
    https://wiki.manjaro.org/index.php?title=Virt-manager Is a great starter guide here.
    Running Windows  requires some extra steps, and will require slipstreaming of VirtIO drivers to allow the Windows 10 iso to boot.
    When choosing hard disk format, for speed .raw files re best unless snapshots are required, if so use qcow2 format, but this is a little slower.
  5. Although Wayland works well for most cases as a display manager, we advise that you continue to use X11 for now. That said it may be worth trying out Wayland in your own particular setup.
  6. Don't bother using ksm, as although it works nested, and in Virt Manager, it makes little difference in practice.
  7. Tech Support is available if required when converting disk images to work with Virt Manager, and additionally setting up using Virt Manager for DaDesktop courses.
  8. Where are disk image files located within the filesystem? Virt Manager uses the following location to store image files, however this is configurable and other locations can be used if preferred.

    /var/lib/libvirt/images