Setting up Virtual Machines in DaDesktop with Virt Manager

Introduction

When putting together a course, it’s often handy to run a virtual server inside DaDesktop, and maybe spin up a couple of client VMs as well, using the same operating system or a mix of Windows and Linux.

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

DD Machines Nested Virt

Having tested extensively, we recommend going with Virt Manager because VirtualBox has a few bugs in this scenario; so at present, we advise against using VirtualBox for this purpose.

Virt Manager relies on the libvirt library to deliver VM management capabilities. Its graphical desktop interface lets you create, remove, and oversee several virtual machines with ease. While it’s geared mainly toward KVM-based VMs, it also works with other hypervisors like Xen and LXC.

Virt Manager also pairs nicely with Vagrant. Just run:

apt install vagrant-libvirt

Keep in mind that the selection of Vagrant boxes for libvirt/kvm is smaller than for VirtualBox, but you can convert them to libvirt format without much trouble, as demonstrated here:

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

The UI offers an overview of all your VMs, showing their status, CPU consumption, a live performance chart for running machines, and resource utilisation stats.

If you’re new to Virt Manager, it looks and feels quite a bit like VirtualBox, though it does have a few key differences which we’ll cover next.

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

 

What makes Virt Manager better than VirtualBox?

Benefits
  1. Far better performance: Virt Manager employs VirtIO drivers for storage, networking, and graphics, which yields noticeably higher speed. virtio drivers are KVM’s paravirtualised device drivers, and they work with both Linux and Windows guest VMs on KVM hosts. These drivers cover block storage, network controllers, and graphics. Because they’re open source, installing them is a breeze if your Linux distribution doesn’t already include them.
  2. A wider range of configuration options
  3. Integrates smoothly with Vagrant
  4. Some components of VirtualBox aren’t entirely open source
  5. You won’t need to recompile modules after a kernel update, unlike with VirtualBox.
  6. VirtualBox can occasionally break when a kernel update rolls out.
Drawbacks
  1. VirtualBox might have a somewhat gentler learning curve
  2. Configuring ‘Host networking’ instead of NAT is simpler in VirtualBox, though NAT handles most networking scenarios well on both platforms.
  3. VirtualBox runs on many platforms, whereas Virt Manager is Linux-only.


All things considered, when it comes to running servers inside a DaDesktop machine, we lean toward Virt Manager.

 

Installing Virt Manager

Since libvirt keeps getting better, it’s best to go with the most recent non-LTS release of Ubuntu or Debian.

Here’s a quick overview of installing kvm and virt-manager. For detailed steps, follow 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

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

 

Configuration

  1. How do I import or convert virtual machines? While you can easily build VMs from scratch with the OS and specs you need, for more complex scenarios it’s often simpler to bring in an existing VM setup for a particular server or appliance. Many of these come as VMDK images, which Virt Manager can technically add directly, though the current version might not make that obvious. VirtualBox server images can’t be imported straight into Virt Manager, but you can export them to other formats like Open Virtualisation Format (.OVF) — which Virt Manager handles with ease. Alternatively, you could use VmWare Convertor if you have it, or turn to Virt-V2V: https://www.redhat.com/en/blog/importing-vms-kvm-virt-v2v. Qemu-convert is another excellent open source tool for converting between different VM formats.
    To Convert from VirtualBox to Virt Manager KVM format follow the steps here: https://ostechnix.com/how-to-migrate-virtualbox-vms-into-kvm-vms-in-linux/
  2. Best way to import large files inside standalone. We recently added a feature that lets you upload files straight from your local machine into DaDesktop with ease.

    If that doesn’t suit you, look into cloud storage services like Google Drive or Microsoft 365. Once you sign in inside the DaDesktop machine, you can grab your files directly.

  3. When importing other virtual machines especially from other formats, often you will need to change graphics and / or disk types. One of the standout features of Virt Manager is its excellent support for VirtIO drivers. These fully virtualised, open source drivers deliver significantly better performance than standard disk, network, or graphics drivers, and they play nicely with almost every OS, including guest Windows 10 machines. If your guest OS can use them, they’re usually the top choice for both compatibility and speed when working with Virt Manager (KVM). https://wiki.archlinux.org/title/Libvirt
  4. Optimal settings for virtual machines using Virt Manager Today, almost all open source server operating systems include VirtIO drivers out of the box, and you can install them on Windows without much hassle. Typically, virtio drivers deliver the best performance, though other driver types might suit certain situations. For networking, NAT usually handles most needs; only if you require a more advanced configuration would you look into Bridged Host networking, which can be trickier to set up. 
    The guide at https://wiki.manjaro.org/index.php?title=Virt-manager is an excellent starting point.
    Running Windows takes a bit of extra work and you’ll need to slipstream the VirtIO drivers into the Windows 10 ISO so it can boot.
    When picking a hard disk format, raw files offer the best speed unless you need snapshot support; in that case, go with qcow2, though it’s a touch slower.
  5. Even though Wayland functions well as a display manager in many situations, we recommend sticking with X11 for the moment. Still, it’s worth experimenting with Wayland in your specific environment, especially as distributions keep improving their Wayland support.
  6. There’s no real need to enable KSM; while it does work in nested setups and within Virt Manager, the practical benefit is negligible.
  7. If you need help converting disk images for Virt Manager or setting up VMs for your DaDesktop courses, our Tech Support team is here for you.
  8. Where are disk image files stored on the filesystem? By default, Virt Manager keeps them in this folder, though you can configure a different location if needed.

    /var/lib/libvirt/images