DaDesktop

Building Virtual Machines within DaDesktop Using Virt Manager

Introduction

When preparing a course, it's often handy to spin up a virtual server inside DaDesktop. You might also want to add one or two client machines in the same way, whether they run the same OS or a mix of Windows and Linux.

You can set up nested VMs using either Virt Manager or VirtualBox – optionally with Vagrant on Linux. If your DaDesktop machine runs Windows 10, VirtualBox is the way to go.

DD Machines Nested Virt

After thorough testing, our recommendation is to go with Virt Manager. There are a couple of known bugs with VirtualBox, so for now we advise against using it in this scenario.

VirtManager relies on the libvirt library to deliver virtual machine management. Its desktop interface lets you create, remove, and oversee multiple VMs. While it's primarily designed for KVM VMs, it also supports other hypervisors like Xen and LXC.

Virt Manager integrates nicely with Vagrant, quite simply  :-          

apt install vagrant-libvirt

Keep in mind that there are fewer pre-built Vagrant boxes for libvirt/kvm than for VirtualBox. However, you can easily convert them to be compatible as shown here :-

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

The interface offers a quick overview of all VMs, their statuses, CPU usage, a live performance graph for running instances, and resource utilisation figures.

If you're new to Virt Manager, you'll find it quite similar to VirtualBox, though with a few important differences outlined below.

A solid guide on using virt-manager with Ubuntu Linux can be found here – https://www.debugpoint.com/virt-manager/

 

Why should I use Virt Manager instead of Virtualbox?

Advantages
  1. Performance is noticeably better – Virt Manager employs VirtIO drivers for storage, networking, and graphics, delivering a significant boost. Virtio drivers are KVM's paravirtualised device drivers, available for both Linux and Windows guests running on KVM hosts. The virtio package covers block (storage) devices, network interface controllers, and graphics. Because VirtIO drivers are open source, they're straightforward to install if your Linux distro doesn't already include them.
  2. More configuration options are available.
  3. It pairs well with Vagrant.
  4. Some parts of VirtualBox aren't fully open source.
  5. Unlike VirtualBox, Virt Manager doesn't require you to recompile modules every time a new kernel update arrives.
  6. VirtualBox is known to sometimes break after a kernel upgrade.
Disadvantages
  1. Arguably, VirtualBox has a slightly gentler learning curve.
  2. Configuring 'Host networking' (as opposed to NAT) is simpler on VirtualBox, though NAT handles most networking scenarios easily on both platforms.
  3. VirtualBox runs on many operating systems, but Virt Manager is Linux-only.


All things considered, for running servers inside a DaDesktop machine, Virt Manager gets our vote.

 

Installation

Since libvirt is constantly evolving, stick with the latest non-LTS Ubuntu or Debian release.

Installing kvm and virt-manager. These are very brief notes – please follow an up-to-date guide suited to your chosen DaDesktop OS. One helpful resource is https://www.debugpoint.com/virt-manager/

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

Reboot your DaDesktop machine, then launch Virt Manager from the Applications menu.

 

Configuration

  1. How do I import or convert virtual machines ? While it's straightforward to build VMs to your exact OS and spec requirements, for more complex setups you'll often want to import an existing VM, such as a particular server or appliance. These frequently come as VMDK images; they can be added straight into Virt Manager, though with the current version it's not always obvious how. VirtualBox server images can't be directly imported, but they're easy to export to other formats like the Open Virtualisation Format (.OVF), which Virt Manager handles without trouble. Alternatively, you could use VMware Converter if you have access to it, or use Virt-V2V instead https://www.redhat.com/en/blog/importing-vms-kvm-virt-v2v. Qemu-convert is another excellent open source tool that simplifies converting between virtual machine formats.
    To convert from VirtualBox to KVM format for Virt Manager, 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. Recently, a method to conveniently transfer files from your machine into your DaDesktop environment has been introduced.

    Otherwise, consider employing a cloud file service like Google Drive or Microsoft 365. You can then log into that service from within the DaDesktop machine to access your files.

  3. When importing virtual machines, particularly from other formats, you'll often need to adjust graphics and/or disk types.  One of Virt Manager's strongest points is its excellent support for VirtIO drivers. These are open source, fully virtualised drivers that deliver far better performance than the default disk, network, or graphics drivers, and they're available for nearly every operating system – including superb support for guest Windows 10 machines. If your guest OS can use them, VirtIO is almost always the preferred choice for compatibility and speed when working with Virt Manager (KVM). https://wiki.archlinux.org/title/Libvirt
  4. Optimal settings for virtual machines using Virt Manager VirtIO drivers now come built into most open source server operating systems, and they're easy to install on Windows. In general, virtio gives the best performance, though sometimes you may need one of the other available driver types. NAT is generally enough for most networking needs; unless your setup demands a more complex Bridged Host network, stick with NAT as it's simpler to get working reliably. 
    https://wiki.manjaro.org/index.php?title=Virt-manager is a great introductory guide on this topic.
    Running Windows requires a few extra steps, including slipstreaming VirtIO drivers so the Windows 10 ISO can boot.
    When picking a hard disk format, .raw files are faster unless you need snapshot support – in that case, choose qcow2 (which is a bit slower).
  5. While Wayland often performs well as a display manager, we suggest sticking with X11 for the time being. That said, it's worth experimenting with Wayland in your own specific configuration, especially since distro support for Wayland is improving steadily.
  6. You can skip using ksm. Even though it works in nested environments and with Virt Manager, it doesn't make a noticeable difference in practice.
  7. Tech Support is available if required in Greece 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 stored on the filesystem? By default, Virt Manager saves images in the following directory, though you can configure a different location if you prefer.

    /var/lib/libvirt/images