VirtualBox will crash when using default audio

I recently tried following the instructions for virtualbox as detailed here: VirtualBox - NixOS Wiki

However none of the VMs I tried actually worked. They would all crash with a segfault. It took some Googling, but I found the solution which was to avoid ALSA audio.

Therefore I set the audio driver from default to Pulse and it booted. :smiley:

Perhaps the wiki should be updated about this. But I am writing this guide in case anybody else finds it useful.

The last lines of my log are:

00:00:00.613983 NAT: DNS#1: 83.255.255.2
00:00:00.614658 AC97: Using codec 'STAC9700'
00:00:00.614695 Audio: Initializing ALSA driver

I get errors like:

00:00:00.613983 NAT: DNS#1: 83.255.255.2
00:00:00.614658 AC97: Using codec 'STAC9700'
00:00:00.614695 Audio: Initializing ALSA driver

and using the terminal command gives:

VBoxHeadless -s TinyCore
Oracle VM VirtualBox Headless Interface 7.0.6
Copyright (C) 2008-2023 Oracle and/or its affiliates

Starting virtual machine: Segmentation fault (core dumped)

Hopefully this will help somebody with a similar situation.

1 Like

I have a fix in place, that makes VirtualBox VMs boot on Nixos with alsa. Please see Make VirtualBox with Alsa Audio Driver working by messemar ยท Pull Request #226144 ยท NixOS/nixpkgs ยท GitHub

1 Like