DaDesktop

Setting Up Virtual Machines in DaDesktop with Virt Manager

Introduction

When designing a course, it often comes in handy to run a virtual server inside DaDesktop, and sometimes even spin up a couple of client machines alongside it—whether using the same operating system or a blend of Windows and Linux.

You can run 'Nested VMs' either with Virt Manager or VirtualBox—optionally paired with Vagrant on Linux—or just VirtualBox if your DaDesktop machine runs Windows 10.

DD Machines Nested Virt

After thorough testing, we recommend going with Virt Manager. VirtualBox has a couple of known bugs in this setup, so for now we advise against using it that way.

Virt Manager leverages the libvirt library to deliver virtual machine management. Its desktop interface lets you create, remove, and manage numerous VMs. While it's mainly intended for KVM virtual machines, it also handles other hypervisors like Xen and LXC.

Virt Manager plays nicely with Vagrant too—just run:

apt install vagrant-libvirt

Bear in mind that there are fewer Vagrant boxes for libvirt/KVM compared to VirtualBox, but you can easily convert them for libvirt compatibility as demonstrated here:

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

The UI gives you a summary of all VMs—their status, CPU usage, live performance graphs, and resource utilization stats.

If you're new to Virt Manager, it's pretty similar to VirtualBox but with a few key differences we'll cover next.

For a solid walkthrough on using virt-manager with Ubuntu Linux, check out https://www.debugpoint.com/virt-manager/

 

Why Choose Virt Manager Over VirtualBox?

Advantages
  1. It offers significantly better performance. Virt Manager relies on VirtIO drivers for storage, networking, and graphics, which yield far superior speed. These are KVM's paravirtualized device drivers, available for both Linux and Windows guest VMs running on KVM hosts. The virtio package covers block (storage) devices, network interface controllers, and graphics. Since VirtIO drivers are open source, installing them is a breeze if your Linux distro doesn’t already have them preinstalled.
  2. You get more configuration options.
  3. It integrates smoothly with Vagrant.
  4. Unlike Virt Manager, certain components of VirtualBox are not fully open source.
  5. Virt Manager doesn’t require recompiling modules after every kernel update, unlike VirtualBox.
  6. VirtualBox can occasionally break when a new kernel upgrade is needed.
Disadvantages
  1. VirtualBox might have a slightly shallower learning curve.
  2. Configuring 'Host networking' instead of NAT is easier in VirtualBox, though NAT serves most networking needs just fine on both platforms.
  3. VirtualBox runs on many platforms, while Virt Manager is Linux-only.


All things considered, for running servers inside a DaDesktop machine, Virt Manager is our preferred choice.

 

Installation

Since libvirt is constantly being improved, always go with the latest non-LTS Ubuntu or Debian release.

Here’s a quick guide to installing KVM and virt-manager. But be sure to follow a current guide for your chosen DaDesktop OS—this one is a good reference: https://www.debugpoint.com/virt-manager/

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

Afterwards, restart your DaDesktop machine and launch Virt Manager from the Applications menu.

 

Configuration

  1. How do I import or convert virtual machines ? While it's simple to spin up VMs tailored to your OS and spec needs, for more complex setups you often want to import an existing VM, like a specific server or appliance. These are frequently supplied as VMDK images, which can be added directly to Virt Manager—though it's not always obvious that the current version supports this. VirtualBox server images can't be imported straight into Virt Manager, but they can be exported to other virtualization formats, such as the Open Virtualization Format (.OVF), which Virt Manager handles easily. Alternatively, you could use VMware Converter if you have it, or Virt-V2V as described here: https://www.redhat.com/en/blog/importing-vms-kvm-virt-v2v. Another great option is Qemu-convert (https://docs.openstack.org/image-guide/convert-images.html), an open-source tool for converting between VM formats.
    To Convert from VirtualBox to Virt Manager KVM format follow these steps https://ostechnix.com/how-to-migrate-virtualbox-vms-into-kvm-vms-in-linux/
  2. Best way to import large files inside standalone. A new feature lets you easily upload files from your own machine to your DaDesktop machine (details here).

    If that doesn't suit you, you can fall back on cloud storage like Google Drive or Microsoft 365—just log into the service inside DaDesktop to access your files.

  3. When importing other virtual machines especially from other formats, often you will need to change graphics and / or disk types.  One of Virt Manager's standout features is its excellent support for VirtIO drivers. These open-source, fully virtualized drivers deliver much better performance than the original disk, network, or graphics drivers, and they're available for nearly all operating systems—including great support for guest Windows 10 machines. If your guest OS is compatible, VirtIO drivers are typically the best choice for both performance and compatibility when using Virt Manager (KVM). For more details, see https://wiki.archlinux.org/title/Libvirt.
  4. Optimal settings for virtual machines using Virt Manager These days VirtIO drivers ship with nearly every open-source server OS, and you can easily install them in Windows. In most cases, virtio is the best option, but other driver types are available if needed. For networking, NAT is usually sufficient unless you need a more complex setup requiring bridged host networking—though that can be trickier to get right. A great starting guide is https://wiki.manjaro.org/index.php?title=Virt-manager. Running Windows requires a few extra steps, including slipstreaming VirtIO drivers so the Windows 10 ISO can boot. When choosing hard disk format, for speed .raw files are best unless snapshots are required; if so, use qcow2 format, but this is a little slower.
  5. Wayland works fine as a display manager in most scenarios, but we suggest sticking with X11 for the time being. Still, it's worth experimenting with Wayland in your own setup—distributions are constantly improving Wayland support.
  6. There's no need to use KSM—though it works in nested setups and within Virt Manager, it barely makes a practical difference.
  7. Tech Support is on hand if you need help converting disk images for use with Virt Manager or configuring Virt Manager for your DaDesktop courses.
  8. Where do the disk image files live on the filesystem? Virt Manager stores them by default at the location below, though you can change this if you like:

    /var/lib/libvirt/images