Modular Xorg on NetBSD from scratch


NetBSD Xorg Orange
That's a lot of orange! That reminds me, I need more F&N… Orange

NetBSD is one of the last Unix-like operating systems still shipping by default with the XFree86 X Window Server as opposed to the new de facto Xorg distribution. From what I've been able to find out doing a quick Google around is that given the system's strict requirement for portability it's going to take a lot of work to get Xorg working on every port. I respect that.

So enter pkgsrc and modular Xorg! Modular Xorg is an exciting new way of distributing Xorg because it allows you to cherry pick only the drivers, applications and other whatnot that you want instead of installing one huge package.

For me, I'm using a fresh install of NetBSD 3.1 in a VMware Fusion virtual machine, so you'll obviously have to take these steps as a guide for your own system.

During the initial install I chose the Custom Installation option and de-selected the X11 Distribution Set. This means I avoided any mess right from the beginning, just as I did when I changed from Monolithic Xorg to Modular Xorg on FreeBSD.

Once you've installed NetBSD, do your usual configuration of /etc/rc.conf to enable your network, and add X11_TYPE=modular to your /etc/mk.conf file. DON'T add a X11BASE line!

Then go grab yourself the latest pkgsrc tree and update it.

Now it's just a matter of make install clean clean-depends -ing each package we want. If you really wanted to, you could just install all the meta-packages:

… but that really defeats the purpose of going modular! For me, I installed the base server, the entire fonts meta-package, only the drivers I needed, and the minimum required apps:

Obviously when I said minimal I wasn't kidding! These packages are enough to get an X session started, but that's about it. If you're installing a desktop environment such as KDE, Xfce or GNOME you can go right ahead and install their respective packages, but if you're using a vanilla window manager such as OpenBox you'll really need to install at the very least a terminal emulator. I like urxvt.

It is defintely more work to install modular Xorg, and in many cases the default XFree86 distribution Is Good Enough™, but I like the added control this gives me, plus then I have the added convenience of using similar software on my other BSD and Linux machines. Right Mai?

Mai Hime angrily battling a monster.

Is she pissed off or distracted somehow? I don't know. Maybe she runs OpenBSD instead. It's 01:52, maybe I actually need to go to sleep now.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.