Forget VMware and VirtualBox: This should be your new VM manager

For decades, I used VirtualBox for all my virtual machine (VM) needs. I could use it as a graphical user interface (GUI), or I could run it from the command line. It was easy to work with, was cross-platform, and rarely caused me any problems.
Until it didn’t.
Over the past few years, I cannot tell you how many times I wound up with a broken VirtualBox installation that required me to completely remove the software and reinstall it. Generally speaking, it was a hassle, but the solution worked.
Until it didn’t.
A few weeks ago, VirtualBox broke again. I ran through the usual tricks, but was unable to get it working. I removed conflicting kernel modules (which were often the problem), did a purge uninstall, reboots, upgrades … you name it, I did it. This time, however, the fixes wouldn’t work.
The problem is, I depend on VMs every day. Without the ability to spin up VMs, I wouldn’t be able to review Linux distributions, test software, and perform several other tasks.
Thus, I permanently removed VirtualBox, vowing to never use it again.
The solution came by way of KVM, which is a Linux Kernel-based VM. KVM is an open source virtualization technology that allows the Linux kernel to function as a hypervisor to deliver near-native performance and reliability.
Since adopting KVM, I’ve not had a single issue with my VMs. However, I don’t use KVM alone. Instead, I pair it with Virt-Manager to make working with VMs exponentially easier.
How do you install and use KVM/Virt-Manager?
Let me show you.
What you’ll need
The only things you’ll need for this are a running instance of Linux, a user with sudo privileges, and an ISO of any Linux distribution.
Let’s get to work.
Installing Virt-Manager
First off, you don’t have to install KVM, as it is built into the Linux kernel. With that said, you do need to install the GUI frontend, Virt-Manager, and here’s how:
- On Ubuntu/Debian-based machines: sudo apt-get install virt-manager -y
- On Fedora-based machines: sudo dnf install virt-manager -y
- On Arch-based machines: sudo pacman -S virt-manager
- On openSUSE-based machines: sudo zypper install virt-manager
With Virt-Manager installed, you’re ready to create your first VM.
Creating a VM with KVM/Virt-Manager
You should find a new entry in your desktop menu named Virtual Machine Manager. Click on that to run the app. When it appears, you’ll see a single, small window (Figure 1).
Figure 1: The Virt-Manager main window in my default bubblegum pink theme.
Click the far left icon, which looks like a monitor, to create a new VM. In the resulting window (Figure 2), make sure Local install media is selected and click “Forward.”
Figure 2: Local install media should be selected by default.
In the next screen (Figure 3), click “Browse” and then, with your default file picker, locate and select the ISO you want to use.
Figure 3: If you’ve already created a VM, the ISO for your distribution will appear in the drop-down.
Chances are, Virt-Manager won’t auto-detect the OS, so type “gen” and then select “Generic Linux 2024.” Click “Forward” to continue.
You can now dedicate any amount of RAM and CPU cores you need for the OS (Figure 4).
Figure 4: I typically leave this as-is, unless the OS requires more RAM.
The next window (Figure 5) is where things start to get a bit more complicated. Don’t worry, once you understand what’s happening, you’ll be fine.
Figure 5: Make sure to use your storage wisely.
By default, Virt-Manager will store your VMs on the same drive as your OS. Because I create so many VMs, I prefer to store them on external drives to avoid running out of room. If you’re not worried about that, check “Create a disk image for the virtual machine” and allocate however much storage you want.
Choose “Select or create custom,” and then click “Manage.”
It’s now time to create a new storage pool and then a volume to house the VM. In the “Locate or create storage volume” window (Figure 6), click the + at the bottom left of the window. Give the new pool a name, change the Target Path to a directory on an external drive (if necessary), and click “Finish.”
Figure 6: You have to create a storage pool before you create a volume.
Once you’ve created the pool, click + to the right of Volumes. In the resulting window (Figure 7), give the new volume a name (probably the same name as the distro), allocate the space you want for the VM, and click “Finish.”
Figure 7: You’re almost done.
Make sure your new volume is selected (it’ll end in qcow2) and click “Choose Volume.”
Back at the New VM window, click “Forward.” In the next window, give the VM a name and then check “Customize configuration before install.”
Click “Finish,” and the custom config window will open (Figure 8).
Figure 8: There’s a lot to customize here.
For my KDE Neon installation, I have to select UEFI from the Firmware drop-down. Once I do that, I click “Apply” and then click “Begin Installation.”
At this point, a new window will open, where you can begin the OS installation process.
And that’s how you install Virt-Manager and use it, along with KVM, to create reliable, near-native-performing virtual machines.
The post Forget VMware and VirtualBox: This should be your new VM manager appeared first on The New Stack.
