Logging my quest into the NetBSD universe.

Saturday, June 5, 2010

Poor men's NetBSD (aka installing NetBSD 5.1 RC2 in virtualbox)

A week ago I did a NetBSD installation in a virtualbox, which is running under Debian unstable, at this point I use Debian for work and the goal is to start playing with NetBSD for fun. This blog is here mainly to track some of the steps/experiments I'm doing, it could be that this grows, it could be that this dies silently in the future ....

However, as a first step I read NetBSD 5.1 RC2 is available (e.g. see here on the NetBSD blog), so I will start doing a writeup on how to install this NetBSD 5.1 RC2 under virtualbox (like probably a lot of people have already done before me, but one's got to start somewhere). And at least that brings the test count of the 5.1 RC2 up by one.

So we start with downloading the iso image which can be found at the following location http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.1_RC2/iso/

There download the i386 iso (this applies to each other version of NetBSD as well), next I assume you already have virtualbox installed (and operational). Next we start virtualboxroot and we click the 'New' button in the toolbar, the 'New Virtual Machine Wizard' appears, here we click next to get started.


Next we need to tell it what the name and type of our virtual machine should be, here we name it NetBSD.


We start with assigning it some memory. Here I choose half a gigabyte (but we can change it later on if we would need more.


We specify a new virtual hard disk should be created.


This launches the new virtual disk wizard.


This is my favorite virtualbox feature, instead of assigning (and thus loosing) a lot of storage by sacrificing it upfront, we let virtualbox dynamically expand the storage as the demand grows.


We need to specify an upper limit, but we don't loose it immediately (when I look at the NetBSD.vdi file after the installation which you can typically find in ~/.Virtualbox/HardDisks it consumes about 700 megabyte of space).


Virtual Disk was created.


And the virtual machine is ready as well.


Next we select File -> Virtual Media Manager and we go to the known CD/DVD Image tab.


There we add the NetBSD ISO which we downloaded at the beginning.


Next we go the settings of the Virtual machine (right mouse) select storage and attach the CD/DVD image which was just made as secondary master device.


And now we power on the Virtual Machine, it will boot from CD.


The welcome message, and we all speak English:


We use a sensible keyboard lay-out:


And we want to install NetBSD:


Confirm.


There is only one disk, this makes it easy.


And we have enough room for a full install.


This is the 10 GB disk we created, simply use it.


The disk is only there to contain NetBSD, so we dedicate it entirely.


And we need a bootloader.


Let NetBSD do whatever it thinks is best.


Confirm the suggestion.



What's in a name ?


Setting up is done, start the installation.


Creating the filesystems.


Output should appear on VGA, not on a serial connection.


Show some test scrolling on the screen during the installation.


Everything is on the iso image, so let's use that.


Accept the defaults.


Then it starts unpacking the packages onto the target.


Packages are installed.


We select a timezone, your answers may differ ;).


Pick a choice, even though this is just a local plaything I can't force myself to make use of the weak DES.


Then we set the root password.


A shell.


And we're done !


Now we select reboot, when you see it booting from the CD again, simply power off (close) the virtual box window (it is already installed, we don't want to do it again).


In the virtual machine settings (right mouse) we disconnect the CD image.


And we power the virtual machine again (press start, oh and don't mind my sin in that list, it's there for work :()


This is the NetBSD bootcode.


And after boot we can log in (with the password we specified) and this shows the NetBSD 5.1 RC2 is running.



Et voila, we have NetBSD running inside a Virtualbox. You could typer poweroff now, or do a shutdown, or close the window to terminate it. You could even export your virtual machine (File->Export Appliance) to share it with your friends.