In this post, I talked about how switching to the open source nouveau and mesa video drivers and VirtualBox insulated me from Linux kernel changes and made OpenSUSE Tumbleweed a viable option for me. Well…not so fast. With the Linux kernel 5.8.x memory allocation changes, VirtualBox would no longer load. But, as Mr. Spock used to say, there are always alternatives.
KVM is the native Linux hypervisor. QEMU provides an interface to it. Back in 2007, when I first moved to Linux, I looked at QEMU but decided then that it was too complex. No longer. OpenSUSE makes the KVM/QEMU installation and operation easy.
Important safety tip – Before burning down VirtualBox, write down the hardware characteristics of your VMs – memory, CPUs, network, USB setup, etc., as well as the location of your virtual hard drives. You’ll need to match the key hardware characteristics when you recreate your VMs in QEMU/KVM. If your virtual disks are one file each, you can skip the next paragraph.
If you have your virtual drives in multiple 2GB files and/or have snapshots, you’ll need to combine them into one file. QEMU doesn’t recognize the multiple file formats. I used the Virtual Media Manager in VirtualBox to convert the multiple files and snapshots into one .vmdk file. You’ll find the instructions here. Be sure to select the most recent snapshot for the conversion. Works like a charm. If you are using VMWare Workstation, they also have a utility to combine virtual disk files. Consult the VMWare docs.
Once you’ve recorded your VM physical characteristics and combined your multiple virtual disk files (if needed), uninstall VirtualBox (or whatever virtual solution that you use) completely, but retain your virtual drives. I created a new directory in my /home folder for the virtual drives that wanted for KVM and copied them over.
After uninstalling VirtualBox (or whatever you use), restart your computer. Then open YaST and Click on Virtualization -> Install Hypervisor and Tools. (This assumes that you have installed all the YaST modules. If not, you’ll need to go into YaST Software and install the additional YaST modules.)
A new window will pop up:
Check KVM server and KVM Tools under KVM Hypervisor. Those boxes are grayed out in the above image because I already have them installed. Click Accept and OpenSUSE will install all the necessary files and kernel modules. Once the installation competes, restart the computer.
You now have a running KVM hypervisor, but you need to recreate your virtual machines in the Virtual Machine Manager. Open YaST again as above and click on Virtualization -> Create Virtual Machines.
Select Import existing disk image. I clicked on Architecture options to show that you can select the VM’s architecture up front. Click forward.
Click Browse on this window.
Here’s the tricky part. Note that the default location is on your system drive. I want my VMs on my /home drive, which is a much larger SDD. Ignore what’s in the window and click Browse Local at the bottom. When you get to your virtual disk, click Open. That will bring you back to the previous screen. Simply start typing in the operating system in the bottom box, then pick the correct one as they are offered and click Forward.
Select the memory and CPU setup that you had in your VirtualBox virtual machine. Click Forward.
This takes you to the last screen, which summarizes your system. You can also select your network type, with NAT being the recommended default. You also should click the Customize configuration box. Click Finish and KVM will create the virtual machine, then display a window to customize the VM. It’s critical that you go through the settings and ensure that they match your VirtualBox setup.
That’s it. You now have a new virtual machine in QEMU/KVM that should be almost identical to the one that you had in VirtualBox. If you click the “Play” icon at the top, your VM will start. For future VM startups, use Virtual Machine Manager from the OpenSUSE menu.
Note, if your VM is a Windows installation, its authentication will likely be lost. You can regain it several ways. Consult your Windows documentation or Microsoft’s site.
I’ve found QEMU/KVM’s performance equivalent to VirtualBox, but without all the kernel compatibility issues. So far, it does everything that I need.
Like any other system, there’s a lot more to QEMU/KVM. The OpenSUSE virtualization forums and, of course, the online manual. QEMU/KVM possesses a host of helpful capabilities and a rich command-line utility capabilities, including converting .vmdk virtual disks to the native .qcow2 format. Happy exploring!
You must be logged in to post a comment.