Creating VMs within DaDesktop via Virt Manager

Introduction

When getting a course ready, it's often helpful to spin up a virtual server inside DaDesktop, and maybe also create one or two client machines in a similar fashion—whether you stick with the same operating system or blend Windows and Linux.

You can run 'Nested VMs' using either Virt Manager or VirtualBox. With Linux, Vagrant can be added optionally; if you're using Windows 10 as your DaDesktop environment, VirtualBox is the way to go.

DD Machines Nested Virt

After thorough testing, we lean toward Virt Manager as the recommended choice. A few bugs crop up with VirtualBox, so for now we advise against using it in this context.

The VirtManager app leverages the libvirt library to deliver VM management features. Its desktop UI lets you create, delete, and oversee multiple virtual machines. While it's mainly built for KVM VMs, it also works with other hypervisors like Xen and LXC.

Virt Manager pairs nicely with Vagrant too. To get going, just run:

apt install vagrant-libvirt

Keep in mind that you'll find fewer pre-built Vagrant boxes for libvirt/kvm than for VirtualBox, but converting them for use with libvirt is straightforward. See this guide:

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

The interface gives you a snapshot of all VMs—showing their status, CPU consumption, live performance graphs for running VMs, and resource usage stats.

If you're new to Virt Manager, it's a lot like VirtualBox, but there are some key distinctions we'll cover here.

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

 

Why should I use Virt Manager instead of Virtualbox?

Advantages
  1. Performance is significantly improved. Virt Manager relies on VirtIO drivers for storage, networking, and graphics, which deliver far superior speed. VirtIO drivers are KVM’s paravirtualized device drivers designed for both Linux and Windows guest VMs on KVM hosts. They cover block devices (storage), network interface controllers, and graphics. Because they're open source, installing them on your Linux distro is a breeze if they aren't already included.
  2. It offers a wider range of configuration options.
  3. Seamless integration with Vagrant.
  4. Parts of VirtualBox remain proprietary.
  5. Unlike VirtualBox, Virt Manager doesn't require recompiling modules whenever you update the kernel.
  6. VirtualBox occasionally breaks after kernel upgrades.
Disadvantages
  1. VirtualBox arguably has a gentler learning curve.
  2. Configuring ‘Host networking’ as opposed to NAT is simpler in VirtualBox, though NAT handles most networking needs comfortably on both platforms.
  3. VirtualBox runs on many platforms, while Virt Manager is limited to Linux.


Overall, when it comes to running servers inside a DaDesktop environment, we give the nod to Virt Manager.

 

Installation

Since libvirt evolves continuously, always pick the most recent non-LTS release of Ubuntu or Debian.

To install KVM and virt-manager, here are some quick notes—but we recommend following an up-to-date guide tailored to your DaDesktop OS. One such guide is https://www.debugpoint.com/virt-manager/

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

Restart your DaDesktop machine and then launch Virt Manager from the Applications menu.

 

Configuration

  1. How can I import or convert virtual machines? While building VMs from scratch to your exact OS and specs is straightforward, more complex scenarios often call for importing an existing VM appliance or server setup. These frequently come as VMDK images, which you can add straight to Virt Manager—though the current version doesn’t make this capability obvious. VirtualBox server images can’t be directly imported, but you can easily export them to formats like Open Virtualization Format (.OVF), which Virt Manager handles without a hitch. Alternatively, you could use VMware Converter (if you have it) or Virt-V2V (https://www.redhat.com/en/blog/importing-vms-kvm-virt-v2v). Qemu-convert is another excellent open-source tool for converting between VM formats.
    To convert from VirtualBox to Virt Manager's KVM format, follow the steps here: https://ostechnix.com/how-to-migrate-virtualbox-vms-into-kvm-vms-in-linux/
  2. Best approach for importing large files into a standalone setup. A recent update introduced a way to upload files from your host machine directly into your DaDesktop environment with ease.

    Alternatively, you could use a cloud file service like Google Drive or Microsoft 365. Just sign in to the service from within the DaDesktop machine to grab your files.

  3. When you import VMs—particularly from other formats—you’ll often need to swap out the graphics or disk type. One of Virt Manager’s biggest strengths is its excellent VirtIO driver support. These fully open-source, paravirtualized drivers deliver far better performance than standard disk, network, or graphics drivers and are available for almost all operating systems, with standout support for Windows 10 guests. If your guest OS can use them, they’re usually your best bet for compatibility and speed with Virt Manager (KVM). For more, see https://wiki.archlinux.org/title/Libvirt
  4. Optimal configuration for virtual machines with Virt Manager. VirtIO drivers ship with nearly every open-source server OS these days, and you can install them on Windows without much hassle. In most cases, virtio is the top driver choice, but other types may be needed in specific situations. For networking, NAT usually covers the vast majority of use cases; only if you need a more complex setup would you turn to Bridged Host networking, which tends to be trickier to get running smoothly. 
    The Manjaro wiki offers a great starting guide: https://wiki.manjaro.org/index.php?title=Virt-manager
    Running Windows requires a few extra steps, including slipstreaming the VirtIO drivers into the Windows 10 ISO to let it boot.
    For your disk format, raw files give you the fastest performance, unless you need snapshots—then go with qcow2, though it’s a bit slower.
  5. While Wayland does a fine job as a display manager in many scenarios, we suggest sticking with X11 for the time being. However, it’s worth experimenting with Wayland in your own setup—distros are steadily improving Wayland support.
  6. Skip KSM—though it works in nested setups and within Virt Manager, the practical performance gain is negligible.
  7. Tech Support is on hand for help with converting disk images for Virt Manager and for setting up Virt Manager for DaDesktop courses.
  8. Where on the filesystem do disk image files live? By default, Virt Manager stores images in the location below, but you can configure a different directory if you like.

    /var/lib/libvirt/images