Haiku under VirtualBox is extremely laggy

I’m trying to move away from VMware because it was crashing my Linux VMs. But it did run Haiku very very well. And I was doing my dev work in that VM quite happily. So I’ve uninstalled VMware and installed VirtualBox, which runs my Linux VMs without crashing or issue. However Haiku is unusable. Using an r5 image (or a nightly) I get like 0.3 frames per second. Including the mouse cursor, which lags by 4-5 seconds making it impossible to click anything. Installing the Virtualbox Guest Extensions causes my Haiku to not even boot. Listing the applications folder in the file browser takes several minutes. Minutes!! What the heck?

So… is anybody successfully using Haiku in VirtualBox? (I have 7.1.6 installed, seems to be the latest, on Windows 10). My settings boil down to 8gb of RAM, 16 CPU cores, 120GB of disk space, Bridged networking with my actually ethernet interface (give the VM it’s own IP on the LAN, which is nice).

Maybe there is some secret incantation in the virtualbox settings?

I do have real hardware to run it on but that has it’s own set of issues that I couldn’t resolve.

Yeah, there is a known performance issue regarding VirtualBox since 6.something.

You may have a more responsive haiku VM if you give it only one single cpu.

1 Like

:cry:

Wow that sucks. Worth a try, but not really suitable for dev work.

It could also being due to WSL2 hyperVM being installed. This force VB to switch to emulation mode.

I also faced this issue and finally decided to go to a native installation, using a cheap mini-pc

Give a look at this other discussion on same issue reported by others:

I can report that 1 cpu does indeed “fix” the lag. Obviously it’s not fast but has normal screen refresh speed and mouse tracking.

My next question: is this a Haiku issue or a VirtualBox issue?

Wait… I just tried this and… maybe… it’s working? I had some of those switched on and after turning them off, rebooting, changing the CPU count to 4 and starting the Haiku VM it’s… ok. Well for the moment.

3 Likes

Difficult to tell, but keep in mind that Haiku developers tend not to use virtualbox, instead using qemu where available.

I was wondering… Is it possible to use a VM inside another? In this case running Haiku in qemu inside a Virtualbox linux VM could allow to use more CPU.

I use Virtualbox on Windows and it has normal speed and it uses 4 cpus…I will upload the settings screen if it helps

Set VM type to “Other Linux (64 bits)”. It enables x2apic.

Never had any lag in VBox with Haiku personally (and I always gave it all my cores).

Edit: just in case… I use VBox 7.1.4[*] on Win10, no HyperV installed.

[*] 7.1.6 on a different machine.

@memecode… a bit more info/tips:

Edit2: Better to stay away from the VirtualBox guess additions. Their are buggy and compiled for older versions of VBox (I tried a few times to update recipe+patchset, but haven’t had success yet. Way too complicated for me so far, and a nightmare compared to updating/re-building VMware addons).

For graphics, set “Graphics Controller” to “VMSVGA”, then you can install the vmware_addons, and your Haiku under VBox will be happy to use that, giving you plenty of resolutions to choose (will show as “VMware SVGA (VM)” in the Screen preflet).

Set “Pointing Device” to “USB Tablet”, and you won’t miss the lack of “mouse integration” (albeit drag-n-drop on Qt apps will be broken).

You’ll only miss clipboard integration with the host… that can be solved by only installing/running parts of the VBox guess additions: only installing the vboxdev driver, and manually starting the VBoxTray program. It “works” but it is unstable and tends to send you to KDL :slight_smile:). One could edit a “shared” .txt file via SSH, as a “work-around” for that missing functionality.

3 Likes

After using it for a while I’m finding that the ssh dies and one process known as “pcn intr handler” starts eating 100% of a core. Any further attempts to ssh in don’t work.

Any guesses what that’s about?

Some driver misbehaving in its interrupt handler, but not idea about what driver “pcn” might be. Perhaps a network driver? I used “virtio-net” and or “Intel PRO/1000 MT Desktop”.

1 Like

Ooo that seems to have made a difference. I’m not seeing the same CPU usage or ssh hangs. Fingers crossed we’re stable now.

Why not use both VMWare and Virtual box?

Because they install so many virtual network interfaces and clutter up my work flow. And possibly interfere with each other.