NetBSD as a Desktop

Why NetBSD?

First of all, Linux is, by far, a more suitable desktop platform than any of the BSD UNIX’s. Including PC-BSD (which I love!). The reason is simply that Linux has the whole suspend/resume, wifi, video acceleration thing hashed out. The reason Linux has this hashed out is not because Linux is superior in any way to the BSD UNIX’s. Linux simply has a much larger division of labor working on it than any of the BSD projects. Where there is a larger body of labor, there are going to be greater improvements and faster responses to consumer needs than where there is a smaller body of labor (I am taking into account a “division of labor”, which is essential. It does no good if everyone were working on the same thing).

So why BSD UNIX at all? Why not just Linux?

I am already using Linux for home, and work. Kernel development for Linux is essentially, centrally controlled by one man, Linus Torvalds. Linus has done a magnificent job, but eventually, the task will outgrow his model. All the different flavors of BSD UNIX have a much broader distribution of power that directs the development of the kernel. Now this is not a good reason to stop using Linux and switch to BSD. But it is something, as a long term thinker, that is valuable to keep in mind.

Let me get to the skinny on this:

  1. Linux is just the kernel, BSD UNIX is the kernel and operating system tools.
  2. You cannot have a usable system by just installing a kernel. This is why Linux distributions exist, and each is different from the other.
  3. You can have a very usable system by installing BSD UNIX, plus nothing.
  4. Third party programs in BSD are kept totally separate from the base system, while Linux jumbles everything together.
  5. BSD UNIX has a “market-friendly” license, while Linux’s GPL license is very limiting.
  6. BSD UNIX carries on the old UNIX tradition.

Ok, so why didn’t you stick with BSD’s own desktop system, PC-BSD?

First of all, I love PC-BSD. If I were installing on a workstation, instead of a laptop, I would have stuck with PC-BSD. PC-BSD is essentially a repackaged FreeBSD with a graphical installer, that defaults to using ZFS filesystem (it even has the option of installing FreeBSD on top of ZFS), and is simple enough to use, your grandmother could install it. PC-BSD/FreeBSD, however, do not have very good out-of-the-box support for suspend/resume on laptops. I might come back to it and try and tweak it in the future. But I still have to overcome some of the other problems I have had with FreeBSD in general.

/usr/local

The space on /usr/local is my space. When I have compiled and installed my own programs on Solaris, AT&T SysV, HP/UX, or Linux, I install those programs under /usr/local. Where does FreeBSD’s package management put all the programs you install? Well, /usr/local (PC-BSD follows suite on this). This is just a no-no for me. Yeah, I am being picky. I could make a new directory for my custom stuff, but hey! /usr/local is just the wrong place for the OS to put it’s third-party stuff. Wrong, wrong, wrong!

pbi’s or ports?

PC-BSD has it’s own package management system, called “pbi”. Historically, it was disastrous to use a mixture of FreeBSD ports and PC-BSD pbi’s. It was advised to create a ports jail for PC-BSD. It was/is possible to really muck up your system combining the two package management systems, installing software from both. This is really unfortunate, as there are a lot of software programs available under FreeBSD ports that does not have a corresponding PBI package.

From what I can tell from the documentation for PC-BSD, the problem has not gone away. When I first tried out PC-BSD, it was version 8.1. On the default install, a ports jail was created for me. This was extremely handy. PC-BSD 9 and PC-BSD 10 do not create this ports jail by default, and the tool to do so, called Warden, is buggy (I even submitted a patch for it a year ago). Even with version 10, creating a jails port with Warden yields a jail I cannot access the internet from. This makes it impossible to use ports (that downloads source files from the FreeBSD servers to compile). There was no straight forward way to correct this through Warden.

There is a tool now for converting a port to a PBI, but you either have to install ports on the main system (that you use only for PBI conversions) or run the PBI converter from a ports jail (that is no longer created automatically for you, and is managed by a broken Warden).

Keeping in mind that none of this going to be much of a problem for someone who is enthusiastically using FreeBSD, already. But hey, I am just trying to get a usable BSD system on my laptop.

wifi

Wifi for PC-BSD is very nice. There is a graphical tool for setting up one’s wifi connections, and this is just as simple to use as it is on Windows, a Mac, or Ubuntu. There is no such app (that I am aware of) for NetBSD, however. Some would find this as a serious set-back for NetBSD. Even more serious the the suspend/resume issue with FreeBSD. I, however, do not. I am used to scanning for wifi networks from the command line, and editing the /etc/wpa_supplicant.conf file, and restarting the network. I did it when I used to run FreeBSD on my laptop four years ago.

NetBSD Strengths

Laptop suspend/resume

NetBSD has excellent suspend/resume support out of the box. I saw this “power-point-like” presentation on the web a couple years ago. It was published in 2008. NetBSD has had very good suspend/resume support built in for a while now. This is one area NetBSD leads all the other BSD’s in.

pkgsrc package management

NetBSD’s pkgsrc package management is my favorite package manager, hands-down. It downloads the sources, and their dependencies, and compiles them, much like FreeBSD’s ports. But it can be bootstrapped to be used on almost any other operating system, including FreeBSD, Linux, even Windows with Cygwin. And it puts all the programs under /usr/pkg (yeah! I get my /usr/local back!).

The Install

Several months ago, I purchased a refurbished laptop for the purpose of running NetBSD as a desktop. I purchased a Thinkpad T61 from Ebay with an 136 GB HHD and 3 GB RAM, with a built-in Intell graphics card, for only $130 and free shipping (sweet deal!).

NetBSD does not have a graphical installer. But I am used to these things, I still remember the days when Linux had no graphic installer. If you can plug in the laptop directly to your network for the configuration phase, it will simplify things. I did it this way, setup the network, and got pkgin installed and the pkgsrc sources installed all in the after-install configuration before rebooting the laptop. Once the laptop came back up, I got wifi working according to these instructions, and moved on to installing the desktop.

Now we need to get X Windows working. Run the following as root:

# X -configure

It will create a new file in /root/xorg.conf.new. Now to test it out type:

# X -config /root/xorg.conf.new

If it starts up X, you should see a crosshatched background and a cursor in the shape of an X. Try moving the cursor around to verify that the mouse is functional. To quit, press Ctrl-Alt-Backspace. Referenced from the doc. Be sure to refer to that doc, should you run into any trouble.

Installing the desktop on NetBSD was as simple as running:

# pkgin install gdm openbox tint2 hal dbus avahi

Next you need to copy the start up files to /etc/rc.d

cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/
cp /usr/pkg/share/examples/rc.d/hal /etc/rc.d/
cp /usr/pkg/share/examples/rc.d/avahidaemon /etc/rc.d/
cp /usr/pkg/share/examples/rc.d/gdm /etc/rc.d/

Then append /etc/rc.conf with the following:

rpcbind=YES
dbus=YES
hal=YES
avahidaemon=YES
gdm=YES

At this point you can start each service manually in the same order listed in your rc.conf, or just simply reboot your system.

# /etc/rc.d/rpcbind start
# /etc/rc.d/dbus start
# /etc/rc.d/hal start
# /etc/rc.d/avahidaemon start
# /etc/rc.d/gdm start

or just reboot.

If you have not yet done so, be sure to create your user account. If you are unfamiliar with NetBSD, you should familiarize yourself with the official docs: https://www.netbsd.org/docs/guide/en/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: