AQEMU-QEMU: Virtualizing on Haiku as host

Good day,

(Disclaimer: this topic is intended to deal with running VM on Haiku, that is, using Haiku as the Host, and using other OSes as Guests. It’s not intended to deal with running Haiku as guest inside VirtualBox, VMWare, …)

In the Switching to Haiku topic some people asked me how I got some VM working and share that info. Actually, I really don’t like so much the AQEMU interface for managing VM’s (maybe here I have another task: a simpler interface for QEMU?) but it’s what is available on Haiku right now, so have to deal with it. Besides, it puts all VM files in the same location (the VM folder selected on first launch, or modified in the prefs), instead of creating a folder for each VM to keep things tidier.

Please feel free to correct me as I’m at an early stage in QEMU knowledge and might say something wrong. Also, if you have a better setup, let me know to update this topic accordingly.
Nonetheless, I will update this as my knowledge improves and I can get better performance on the VM (if possible).

Regarding Hypervisor, on Haiku there is no native KVM, so no matter what we set on the BIOS, there will not be hardware accelerated virtualization. This is key for the VM settings as we will see later on and will affect the performance of the virtual machine to a great extent.

Also, AQEMU is quite picky with some settings, and does not keep them from launch to launch, so we have to trick it for the VM to keep all the settings properly.


The image shows the Haiku VM I have set for testing stuff and don’t break my production Haiku install. As we can see, the CPUs assigned is set to 1. No matter how much CPUs I give the VM, AQEMU always sets them to 1. So we have to add commandline arguments to force the number of CPUs to stay the same each launch. See the QEMU Arguments window.

When setting a VW, I do follow the Wizard to create the machine and when we are prompted with the Accelerator stage:
Have to pick TCG. KVM wouldn’t work. At least it doesn’t work for me. And in the network stage, always pick “No network”. I’ve never been able to configure a working network from the Network pane in AQEMU, so we will do a different way.

Once we have the VM skeleton completed, we are going to activate the network and let QEMU to use always the same number of CPUs. We do that in the Advanced button that is on the top right of the AQEMU Virtual Machine info pane:

Here we are going to add Custom QEMU Command Line Arguments. The first two lines deal with the network interface. I got network working with this setup that I found somewhere over the rainbow online, if you find a better setup, let me know.
The last line (-smp 4) tells QEMU to use 4 CPUs for the VM. If not set here, whenever starting AQEMU it will default to 1 (at least in my case).

With this setup I can run the Haiku test VM and Linux with network support, though I have to set the DNS in the Network preferences of the Guest OS. Note that with Haiku I have Graphics set to VMWare Video Card. Haiku is not picky about the graphics here, KDE doesn’t like VMWare. So this is more of a trial an error task. Maybe also due to my Video being on framebuffer?

Now, in order to boot the VM have to add a CDROM/DVDROM media device that points to the ISO file of the OS we want to boot. Once boot from the ISO file and installed on the virtual HD, we have to remove it, if not, the VM will start again from the ISO file instead of from the virtual HD with the new install.
To install any OS there, different than Haiku, we need patience. Haiku installs quite fast, almost as on BM. Others, hummm… quite slow, though they install, of course.

Not sure yet which VM hard drive format performs better. I used “.img” just because AQEMU defaulted to that when I set the VMs. I’ll have to check out other formats though.

In further posts I will write down the settings I have for each VM with the screenshot of the VM running.