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.



Nice work but sadly I get no internet connection.
I tested your configuration and as a minimal configuration:

qemu -m 512 -cdrom haiku-os.iso

In both cases I can establish a connection to the Haiku host. But there is no forwarding into the internet. I use a Haiku beta 2 version with all updates and a wired connection eth0 as a host.



I tried Puppylinux as a guest with the same result. Somewhere (I think in Qemu) the connection is blocked or not further forwarded. I tried many different network settings in Aqemu and in a shell skript. Nothing works.
On a Linux host qemu works fine, so I know that it is possible. I don’t use wifi, just eth0.
Perhaps somebody has a tipp for me.

Good day @muffin,

The reason why I haven’t yet posted configs of different VM’s running inside Haiku with AQEMU/QEMU yet is because I’m struggling with the network configurations.

For Haiku, network did work just by telling the Haiku network preferences to use the gateway of my LAN as a DNS server. With that, Haiku sees the network and connects without issues (I still have to post this). I tried with other OSes (linuxes) too, and here is where trouble starts. If I use a Plasma based distro, I can connect to the internet from the VM, just need to add the LAN gateway as a DNS in the KDE network config. But these KDE Plasma based distros are way too slow.

I fount that Manjaro LXQt performs quite well inside the VM, not as fast as Haiku though. Problem is I can’t get the network to work, and I tried many different settings. Same with Puppy, never got network to work there either. This weekend I’ve been trying to get Manjaro LXQt network working without any success, and did plenty of research on the topic, but nothing yet. In fact, I haven’t found yet a setup that works well across all distros, and I’m not sure if it’s due to my network setup, my lack of knowledge, some sort of magic, or whatever.
All the doc I’ve read this weekend talk about Linux, Macos and Windows. Nothing Haiku, so it’s more a trial and error task. In many docs they talk about some libs I couldn’t find in HaikuDepot, though I presume they aren’t needed as in some cases network works. I’m puzzled here.

I haven’t installed yet MacOS 9.2 to test it to check if network works there too, and hopefully I will, though in my case, it’s more important to get Manjaro LXQt working. Once done, I’ll play with MacOS 9.2.

I’ll keep on with the research and hopefully will get to the point where network will work. When I reach that point, I’ll post it here for others to know. In case someone else finds it first, we would appreciate it to be posted here too.



Puppylinux works as well. And next I’ll test Alpine Linux and Manjaro LXQT.
Alpine linux should be not so slow :sweat_smile:.
You don’t have to use dhcp. You must use static network settings.
IP: (or above pp.)
DNS: your.router.ip.from.the.lan

This should work with every VM.

Edit: Alpine Linux works also. Normally qemu should automatically use the right nameserver, so done in FreeBSD and Linux. In Haiku one has to set the nameserver manually and everything works.


Good day @muffin,

Great work!!! Two brains always work better than one!. Congrats. With that setup, seems that all VM would have network access, which is a great leap forward, imho. Finally can use Firefox on Haiku :drooling_face: :drooling_face: :drooling_face:

I’ll check that out to confirm as soon as I get on my box.

Thanks a lot!

I got Alpine Linux with Xorg and Awesome working. Firefox runs, but slowly.


1 Like

Good day,

With the tip provided by @muffin, Manjaro LXQt can run on the VM with network access, though pings seem not to work properly… :scream: :

Other than pings, the updates work… so good thing there. Now I just must figure out how to get QEMU to scale the guest window properly… mmmm…


Why not just edit /etc/resolv.conf to have just one line:


(or whatever your router IP address is)?

This should work everywhere, though you may want to disable network mangler. Sorry, I mean network manager.

It sounds like the qemu host is not answering DHCP requests like it should, hence the static ip and dns config.
on a partially related note: editing resolv.conf is pretty much deprecated on most linuxes, Not really good advice to disable system components and then edit config files only some specific software uses.

The resolve.conf will be automatically overwritten from system, if you choose one time dhcp.
This ping is not working properly, which was confusing me. I first tried to ping to check the connection but then I noticed that all was fine but the ping. :rofl:
For a use in qemu I advice Puppylinux as a guest. It boots directly into RAM, so you get the possibly fastest OS while having no KVM in Haiku. Alpine Linux is also very fast and provides a hardened kernel as a security feature.

If you want really small linux there is now prebuild toybox linux builds for use in qemu.
toybox is similar to busybox but BSD0 (like bsd license but no attibution required)

3.3mb was quite fun to play with for me, though not that practically usefull. (It’s only a cli basically, but really awesome that it exists)

That’s why you need to disable network manager, to stop it overwriting resolv.conf. The simple way is to disable it and use /etc/network/interfaces and /etc/resolv.conf instead. Of course there are a lot of strange linuxen out there now that may have decided to do it a different way, but it’s the conventional method.

Here is a screenshot from Fossapub (Puppylinux) with Palemoon browser and dark mode. While starting Palemoon you have to be patient, but then browsing the web is possible, even when it is slower than normally.
For reading some news it is okay so far.
I like it to switch between the virtual desktops in Haiku. On one screen Aqemu runs with Fossapub and Palemoon maximized to read news, on another screen Web+ or Mail and so on. Switching with Alt+Fx makes it really easy and comfortable. Even having the qemu guest in Fullscreen the Alt+Fx key works to switch to another desktop. Really good!


Again, this is a really bad idea, moat of the OS doesn’t use resolv.conf, it’s really just there for specific applications using libc functions directly. It breaks local resolution of hostnames, DNSSEC, dns precedence. etc.
You don’t need to use nm either, but then it’s better to pick a distro that doesn’t need it, or just a different OS, not one that expects that it is always enabled and will break if it isn’t. :)

The default networking in qemu has support for basic networking only, things like ping do not work in “user” mode networking, so don’t bother with static ip’s or config files, the only way to get a full blown networking where everything works is to use “nat” mode, the qemu doc has detailed info on how to do use “nat”, but only for linux as a host, that said, i don’t think haiku has any support for “nat” networking, but i could be wrong?, so just use the default “user” mode and pick an NIC that will with all your vm’s, type:

qemu-system-i386 -nic model=help

to get a list of supported NIC’s in qemu.

Qemu works basically fine in Haiku. For me there is no need to go deeper into the network settings with NAT.
It is enough to get a guest running and connecting with the network. I will install Haiku nightly images in qemu and other guests like Puppylinux just for playing around and browsing the web.
I have enough to do with learning more about Haiku. My next point on my agenda is to learn more about the Haiku filesystem. :smiley:

You are talking about retrieving DNS from a local router: DNSSEC is not a concern. Sure there are other ways to configure DNS, I’m just offering an easy solution that is compatible with most *nix and their applications, there’s no need to label it a “really bad idea”. It’s also still the standard for example in Debian, slackware, freebsd and openbsd to name a few examples off of the top of my head.

You are missing the point, for one the severall OS you mentioned are completely distinct, they do share some similarities but copying advice 1:1 will mostly not work.

resolv.conf simply /isnt/ compatible with most applications on desktop Linux and hasen’t been for years, disabling system components that are vital for the dns resolution to work properly and instead using a file that is basically only left for backwards compat for some specific applications is what I called a really bad idea.

My advice was about linux, it doesn’t apply to the BSDs anymore than advice for Haiku applies to MacOS.
Apart from common ideas desktop linux diverges heavily from mechanisms and tools *nix usually uses for this sort of stuff, ifconfig is mostly dead there for instance (and never was able to e.g join wifi networks like it can on FreeBSD), and most of the configuration and resolution goes over d-bus.

I suspect that it’s already on nat networking, since muffins static ip starts with 10.* .Ideally the case where everything just works™ is to use ipv6 networking and give the VM it’s own distinct address, but that’s not quite working on haiku. I am a bit lost why icmp wouldn’t work, but tcp would, seems more like a bug to me honestly.

1 Like

In the case of /etc/resolv.conf syntax the example I gave will work on all of them. I’m not aware of any different syntax for /etc/resolv.conf?

That is untrue. You can show this either by trying it on almost any Linux box, or you can read the documentation or source code if you care to check the intended behaviour of the relevant services.

For example, I assume you’re talking about systemd based Linux systems, since the vast majority of Linux distributions use systemd these days. systemd uses the systemd-resolved service for DNS, and it fully supports using /etc/resolv.conf for DNS configuration. It simply checks whether /etc/resolv.conf is a symlink or a real file, and in the latter case it follows whatever configuration is specified there. It integrates with dbus and whatever else you want. To quote the manual:

"To improve compatibility, /etc/resolv.conf is read in order to discover configured system DNS servers, but only if it is not a symlink to /run/systemd/resolve/stub-resolv.conf , /usr/lib/systemd/resolv.conf or /run/systemd/resolve/resolv.conf"

If you’re interested to look further, here is the relevant part of the systemd-resolved source code.

I note that on the ubuntu 20.04 machine I am writing from, /etc/resolv.conf is not a symlink.

1 Like

AQEMU 0.9.2 has issues with qemu 3.x, that’s why VMs fail to start with Invalid parameter 'vlan' no matter what you do in network GUI section. There’s a 0.9.6 that fixed this, but as it’s a dev-release it is not on HaikuDepot.

For me this works everytime:

  • Enable network in the GUI, but don’t add any card
  • Put this on General > Advanced Options:

-net nic,macaddr=52:54:00:97:xx:xx,model=pcnet (MACaddr to taste, and I like PCnet cards :smile:)
-net user,hostname=vm_hostname

  • Guest OS now grabs DHCP consistently, no need for manual IP except…
  • Configure DNS manually as per @muffin 's tip
  • Done!


For those interested: SliTaz is another small, tight and REALLY fast Linux distro, that also boots to RAM by default (at least the live ISO).