Sunday, May 13, 2012

HowTo: Install and run NetBSD on Virtualbox

NetBSD attracts me.

Maybe it's the philosophy being it... or maybe it just the old BSD daemon holding the flag on top of computer. Regardless of the reason, I've been toying with the idea of installing NetBSD on my Athon XP 3200+ nForce2 old desktop for a while now.

However the only instructions I found to convert a NetBSD 5.1.2 CD image into an USB bootable install medium involved using NetBSD. This chicken-egg dilema lead me to VirtualBox 4.1.14.

Just a few seconds after booting the install image into the VirtualBox machine it kernel panicked with the following error:
 uvm_fault(0xc0b82a00, 0, 1) -> 0xe 
 fatal page fault in supervisor mode 
 trap type 6 code 0 eip c0100d27 cs 8 eflags 3046 cr2 0 ilevel 1 
 kernel: supervisor trap page fault, code=0 
 Stopped in pid 0.19 (system) at netbsd:Xspllower+0x17: addb %al,0(%eax) 
 db{0} 
Just the luck heh?

The workaround? VBoxSDL.

VBoxSDL is a simple graphical user interface (GUI) that lacks the nice point-and-click support which VirtualBox, our main GUI, provides. VBoxSDL is currently primarily used internally for debugging VirtualBox and therefore not officially supported.

To be able to install NetBSD 5.1.2 on VirtualBox 4.1.14, assuming the virtual machine is name "NetBSD", you'll have to use VBoxSDL like this:
  1. $ VBoxSDL --norawr0 --startvm NetBSD

Now you'll be able to install NetBSD without any issues.

The problem is when you, in your sweet innocence, reboot the system and VirtualBox isn't able to start the vm stating that:
 Failed to open a session for the virtual machine NetBSD. 
 The virtual machine 'NetBSD' has terminated unexpectedly during startup because of signal 11. 
 Details 
 Result Code: NS_ERROR_FAILURE (0x80004005) 
 Component: Machine 
 Interface: IMachine {5eaa9319-62fc-4b0a-843c-0cb1940f8a91} 

The workaround? Yes you've guessed... VBoxSDL:
  1. $ VBoxSDL --nopatm --startvm NetBSD

Peace at last. I can finally muck around NetBSD :D

For reference:
 --[no]rawr0 Enable or disable raw ring 3 
 --[no]patm Enable or disable PATM 
Sources:
http://download.virtualbox.org/virtualbox/UserManual.pdf
http://chvnx.com/post/18341637412/netbsd-in-virtualbox
VBoxSDL --help

4 comments:

Anonymous said...

i just installed netbsd 6.0_beta1 on virtualbox 4.1.14 last night and never had any issues. no vboxsdl was required. cheers!

tangram said...

Those sure are great news!

Let's hope that the final release of 6.0 works fine too.

Anonymous said...

I had the same problem on my NetBSD 6.0 (BETA2) but this solution works like a charm. Thanks

Orlando Sánchez said...

All work awesomely! Thanks a lot. This is the only solution that work for me.