Jump to content
  • entries
    9
  • comments
    23
  • views
    266

NetBSD


tmcd35

28,054 views

I've been playing around with this for a while. I must say as an OS - I like it! It feels somewhat uncomplicated compared to other *nix's.

 

Today I'm going for a fresh install of NetBSD 5 and see what I can get out of it. Wish me luck!

 

The Platform

Nice and simple - VMWare Fusion 2.x (whatever the latest is). 1 Core (from a 2.16Ghz Core Duo) and 768mb Ram. Hard Drive is 15Gb pre allocated.

 

A word on the hard drive. I've noticed with previous install attempts that NetBSD does not like expanding hard drives so you must pre-allocate the space. The other thing NetBSD doesn't like is Sun's VirtualBox.

 

Installation

Fairly straight forward process. The .iso maps to Fusions virtual CD drive and is auto booting. NetBSD, as with most 'real *nix's' (sorry Linux guys) uses a simple text based installation.

 

The first choice is the intallation type. I always opt for the 'Custom Installation' Option. I typically chose the following options:

 

  • Kernel (GENERIC)
  • Base
  • System (/etc)
  • Compiler Tools
  • Online Manual Pages
  • X11 Sets - ALL

 

The rest is not installed. Anything I need I can grab from the package collection later.

 

Going through the menus NetBSD detects most things just fine. Drive geometry, use entire disk, etc. Just remember to 'set partitions' rather than 'use default' as the default seems to be no partitions(?). From the 'set partitions' screen I tend to just leave the defaults as displayed and continue the installation.

 

v5 Installation seems a lot lot quicker than v4. It appears that the developers have combined all the elements of each package (Kernel, System, Base, etc) in to their own single archive (eg. kernel.tgz, system.tgz, etc) rather than have separate archives for each individual program that makes up a given package (gcc.tgz, xorg.tgz, etc).

 

The result is fewer files to copy from CD to hard drive and fewer files to unpack and thus a much quicker install.

 

Welcome to NetBSD

That was simple! Login in as root and I get a friendly message suggesting I set up a standard user account and 'su' for root access.

 

A good suggestion, so lets do it!

 

useradd -m <[i]username[/i]>
passwd <[i]username[/i]>

 

also use 'vi' to edit the '/etc/group' file to give your new user 'su' permissions.

wheel:*:0:root,<[i]username[/i]>

 

Now we can

 

exit

 

and logon as our new standard user.

 

Networking

The next step is to set up your networking. I use DHCP (VMWare Fusion is using a 'bridged' connection) so again this is not to painful.

 

The first stage is to find the name of your NIC...

 

ifconfig -a

It appears my NIC is called 'pcn0'.

 

 

So it's a simple case of using 'vi' to add a couple of lines to (or create) '/etc/rc.conf'

 

dhclient=YES
dhclient_flags="pcn0"

change 'pcn0' to the name of your NIC

 

A quick reboot and we have internet!!!

 

PKGSRC

pkgsrc (Package Source) is the NetBSD equivalent to 'ports' on FreeBSD , 'fink' on OSX or 'apt' on Linux. It's our software repository of tested NetBSD *nix apps.

 

So I need to grab the latest directory tree from CVS which will allow me to easily compile the programs I want to use in my OS.

 

First set the environment viariables

export CVSROOT="[email protected]:/cvsroot"
export CVS_RSH="ssh"

 

Next use 'vi' to add the following to '~/.cvsrc'

checkout -P
update -dP
release -d
diff -upN
cvs -q -z3
rdiff -u

 

and then connect to cvs to get the latest package data

 

cd /usr
cvs checkout -P pkgsrc

 

and finally bootstrap...

cd /usr/pkgsrc/bootstrap
./bootstrap

 

Pico

Look under '/usr/pkgsrc' and you'll find a large directory tree of various packages you can install. Installation of any program is simply a matter of 'cd'ing to the appropriate directory and running the following commands...

 

make
make install
make clean
make clean-depends

 

pkgsrc take care of all dependencies for you!

 

For a easy web view of packages you will find within the newly installed pkgsrc directory take a look at http://pkgsrc.se/

 

The first package that *must* be installed is 'pico'. 'vi' is a usable text editor, I know the basics to get in and get the job done, but it's not something you want to use long term. It lacks finesse.

 

'pico' (or 'nano') is an alternative command line text editor to 'vi'. It's much simpler to use on a day to day basis. Think of 'edit' under MS-Dos and your not a million miles away.

 

'pico' can be found in the following location...

 

/usr/pkgsrc/editors/pico

 

Licensing

Now a word on licenses. The are numerous licenses running around the open source world and not all are compatible with each other. Because of this pkgsrc makes you explicitly accept any new licenses you encounter before it will agree to install your chosen software.

 

'pico' requires the 'pine-license'. To accept a license edit the '/etc/mk.conf' file (again with 'vi' - grrr.)

 

ACCEPTABLE_LICENSES+=pine-license

 

Fluxbox

The last thing I want to do this time round is setup X. Usually I'd set up X first and then install my Window Manager of choice. This time I'm doing it the other way round!

 

Why? Have you seen 'twm'? Even booting into it once to check X.org has set up correctly is more than I can bare! So, I'll install Fluxbox now and when I configure X.org I'll get a lovely GUI immediately - sweet!

 

Unlike Windows or OS-X (at least officially) X can have any GUI front end your hear desires (and then some). These are called Window Managers. The most popular tend to copy Explorer (Windows) or Finder (OSX) - see Gnome, KDE and Enlightenment. But if you prefer the look and feel of the Amiga, GEM (early Mac/Atari ST), BeOS or Arthur (Acorn) then you can have that look and feel.

 

Fluxbox is a very, very basic Window Manager. No desktop icons or menu bars. There's a small bar for running apps and a 'start menu' you access by right-clicking anywhere on the desktop. It's fast and it's simple, and that's what I like. I can add my own file manager and/or icon manager later (if I so desire).

 

Fluxbox can be found here...

/usr/pkgsrc/wm/fluxbox

 

Finally set fluxbox to start with X...(http://www.fluxbox.org/screenshots/)...

echo "exec startfluxbox" > ~/.xinitrc

 

X

Finally, it's time to start up X. Before I get going a small gripe if you will. I liked XFree86! With release v5 NetBSD have jumped on the X.org band wagon with everyone else. It's a shame, I actually knew where I was with XFree86 and find X.org harder to configure.

 

Not fair, it's probably more the combination of NetBSD and VMWare that causes the 'difficulties' otherwhys X.org is supposed to configure itself, Oh-hum.

 

Okay, as you might have gathered. Do not blindly run 'startx' or get X.org to completely configure itself. Atleast not under VMWare as it doesn't work.

 

First job is to create a 'xorg.conf.new' file in your home directory. This is done by...

Xorg -configure

 

Next job is to edit that file and set up to run properly...

pico ~/xorg.conf.new

Yay - 'pico' :)

 

Add [CTRL]-[ALT]-[bACKSPACE] support to dump out of X if something is wrong...

Section "Server Layout"
   ...
   ...
   Option "DontZap" "Off"
EndSection

 

and replace the entire screen section...

Section "Screen"
       Identifier "Screen0"
       Device     "Card0"
       Monitor    "Monitor0"
       DefaultDepth 24
       SubSection "Display"
               Viewport  0 0
               Depth     24
               Modes     "1024x768"
       EndSubSection
EndSection

 

Finally...

cp xorg.conf.new xorg.conf
startx

 

and you will see...(attached image)...

 

Well that's it for this time. It was a long one! Next time I pick up NetBSD (whenever that may be) I'll be looking at some important apps - pcmanfm, wbar (or another desktop icon manager), Opera (or maybe Chrome?) and eventually OpenOffice, Wine + iTunes?

Edited by tmcd35

3 Comments


Recommended Comments

powdarrmonkey

Posted

Strictly speaking, apt is only the package system on Debian-type distributions. Redhat has rpm, gentoo has portage, etc.
localzuk

Posted

Hmmm... So NetBSD doesn't go for 'ease of use' then :p
epsicot

Posted

Just can't type '@' :o

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...