Posted on

Keeping old software useful with QEMU

Introduction

Maybe some of you have old code or programs you’re still fond of like Winamp, Windows XP, or the Python code you wrote in high school. I’ve kept a lot of the code and work I did in college, and I want to be able to run it still so I’m going to set up a QEMU virtual maching running Mandrake Linux 9.1. The reason why I picked an ancient (2003!) release of Linux is because I know that Waterloo Maple 9 (also from 2003!) supports it well.

Verifying the hardware can support virtualization

For this installation, I’m using Arch Linux on an ASUS ZenBook 14 UM433DA. I’m pretty sure it’ll support everything QEMU needs, but it’s always smart to double-check. It’s possible to just run software completely emulated in QEMU, but it also supports hardware virtualization via KVM so that the software I’m running will perform quite a bit better. First up, is the kernel compiled to support KVM?

$ zgrep CONFIG_KVM /proc/config.gz
CONFIG_KVM_GUEST=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM=m
CONFIG_KVM_WERROR=y
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_AMD_SEV=y
CONFIG_KVM_MMU_AUDIT=y

Sure enough, it looks like the kernel is compiled to support KVM. To clarify what just happened, the zgrep command lets you search for text inside files compressed with gzip, and the configuration used to compile the kernel can be found at /proc/config.gz. Next, is the kernel module loaded?

$ lsmod | grep kvm
kvm_amd               114688  0
kvm                   827392  1 kvm_amd

The lsmod command lets you list all the modules the kernel has loaded, and as you can see above the kernel module is loaded. I can go ahead and install QEMU along with libvirtd and virt-manager. Neither libvirtd nor virt-manager are required, but sometimes it’s nice to have a GUI.

Installing QEMU and friends

Let’s get those packages installed.

$ sudo pacman -S qemu virt-manager
... (lots of installed packages)

If you try to run virt-manager right away, you’ll notice that it can’t connect to the libvirtd daemon, so I’ll enable it and start it now.

$ systemctl enable libvirtd
$ systemctl start libvirtd

Installing the Vintage OS and software

Now that all the virtualization softare is installed, the next step is to find the OS and get it running. It took me a little time to dig up a copy of Mandrake Linux 9.1 since the organization that was maintaining it, Mandriva, has gone away. Eventually I found all three install discs for the 32-bit i586 architecture on Archive.org.

Using virt-manager, I created a new QEMU/KVM user session since I don’t care about networking or anything that requires superuser privileges. I created a new VM with a simulated Pentium III CPU and 512 MB of RAM, and then mounted the Mandrake 9.1 ISO and ran through the install.

Mandrake 9.1 running Maple 9

The OS install went pretty smoothly – no issues at all. I was able to get logged in to KDE, mounted the CD, then ran the Maple install as root. I installed it in /opt/maple9 and then ran xmaple as the regular user. It worked great and now I can run all those Maple worksheets I wrote in college!