Creating VMs within DaDesktop using Virt Manager

Introduction

When prepping a course, it's often handy to virtualise a server inside DaDesktop, and perhaps virtualise a client machine or two in the same way, using the same OS or a mix of Windows and Linux.

Running 'Nested VMs' can be done through Virt Manager, or VirtualBox with Vagrant optionally when using Linux. If your DaDesktop machine runs Windows 10, then VirtualBox is the go.

DD Machines Nested Virt

After plenty of testing, our recommended pick is to use Virt Manager, as there are a couple of gremlins when using VirtualBox. So at the moment, we don't advise using VirtualBox for this purpose.

The VirtManager application draws on the libvirt library to offer virtual machine management services. It sports a desktop interface that lets you create, delete, and manage multiple virtual machines. While it's primarily used for KVM VMs, it can also support other hypervisors like Xen and LXC.

Virt Manager also plays nicely with Vagrant, just run this:-

apt install vagrant-libvirt

Just so you know, there are fewer Vagrant boxes knocking about that use libvirt/kvm compared to VirtualBox, but they can be easily converted to work with libvirt, as shown here :-

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

The user interface dishes up a summary view of all VMs, their status, CPU usage, a LIVE performance graph of running VMs, and resource utilisation statistics.

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

Here's a solid guide on using virt-manager with Ubuntu Linux - https://www.debugpoint.com/virt-manager/

 

Why should I use Virt Manager instead of Virtualbox?

Advantages
  1. Performance is streets ahead - Virt Manager uses VirtIO drivers for storage, networking, and graphics, offering much better grunt. Virtio drivers are KVM's paravirtualised device drivers, available for Linux and Windows guest VMs running on KVM hosts. The virtio package supports block (storage) devices, network interface controllers, and graphics. Being open source, VirtIO drivers are a breeze to install if they're not already included in your Linux distro.
  2. More configurability options on offer
  3. Gets on well with Vagrant
  4. Some parts of VirtualBox aren't fully open source
  5. Virt Manager doesn't require module recompiles whenever a new kernel upgrade comes along, unlike VirtualBox.
  6. VirtualBox has been known to throw a wobbly when a new kernel upgrade is needed.
Disadvantages
  1. VirtualBox arguably has a slightly shorter learning curve.
  2. Setting up 'Host networking' rather than NAT is easier on VirtualBox. That said, NAT handles most networking needs without a hassle on both systems.
  3. VirtualBox is available across many platforms, whereas Virt Manager is only found on Linux.


All up, we reckon Virt Manager is the better bet for running servers inside a DaDesktop machine.

 

Installation

Because libvirt is always getting better, make sure you're using the latest non-LTS Ubuntu or Debian version.

Installing kvm, virt-manager. These are just quick install notes, but do have a squiz at an up-to-date guide for your chosen DaDesktop OS. Here's one guide https://www.debugpoint.com/virt-manager/

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

Reboot your DaDesktop machine, and then fire up Virt Manager from the Applications menu.

 

Configuration

  1. How do I import or convert virtual machines? Creating VMs to your own OS and spec requirements is pretty straightforward, but for more complex setups, importing an existing VM setup for a specific server or appliance is often the preferred path. These frequently come 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 directly into Virt Manager, but they can be easily exported into other virtualisation formats, like the Open Virtualisation Format (.OVF), which Virt Manager can import without any trouble. Otherwise, you could use VmWare Converter if you have access to it, or Virt-V2V instead: https://www.redhat.com/en/blog/importing-vms-kvm-virt-v2v. Qemu-convert is also a top 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. A method has recently been added to easily upload files from your machine straight into your DaDesktop machine.

    Failing that, have a think about using a cloud files tool like Google Drive or Microsoft 365. You can then access them by logging into the tool from inside the DaDesktop machine.

  3. When importing other virtual machines, especially from other formats, you'll often need to change the graphics and/or disk types. One of the real beauties of Virt Manager is its excellent support for VirtIO drivers. These are fully virtualised, open-source drivers that deliver much better performance than the original disk, network, or graphics drivers, and they're available for nearly all operating systems, including top-notch support for guest Windows 10 machines. If your guest OS supports them, these are usually the pick of the bunch 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 baked into almost all open-source server operating systems these days and can be installed in Windows without much fuss. Generally, the best drivers are virtio, but in some cases, you might need to use one of the many other types. For most networking scenarios, NAT does the trick unless you need a more complex setup requiring Bridged Host networking, though this can be a bit trickier to get humming along smoothly.
    https://wiki.manjaro.org/index.php?title=Virt-manager is a great starter guide here.
    Running Windows requires a few extra steps and will need slipstreaming of VirtIO drivers so the Windows 10 ISO can boot.
    When picking a hard disk format, .raw files are the quickest option unless snapshots are needed; if so, go for the qcow2 format, but just be aware it's a tad slower.
  5. Although Wayland works well as a display manager in most cases, we'd suggest sticking with X11 for now. That said, it could be worth giving Wayland a crack in your own particular setup, and distros are constantly improving their support for it.
  6. Don't bother with ksm – while it works nested and in Virt Manager, it makes bugger-all difference in practice.
  7. Tech Support is on hand if you need it, whether you're converting disk images to work with Virt Manager or setting things up for DaDesktop courses.
  8. Where are disk image files stashed in the filesystem? Virt Manager uses the following location to store image files, but this is configurable and you can use other spots if you'd rather.

    /var/lib/libvirt/images