Skip to main content.

Building an OpenBSD desktop

2014-04-01

Live demo in BSD Now Episode 031 | Originally written by TJ for bsdnow.tv | Last updated: 2015/05/01

NOTE: the author/maintainer of the tutorial(s) is no longer with the show, so the information below may be outdated or incorrect.

While the BSD family of operating systems are known around the world for their stability, scalability, performance and security in the server space, they can actually make a pretty nice desktop as well. This tutorial will show you how to go from a fresh, minimal install of OpenBSD to a stylish graphical desktop. Once you've got the system up after the install, log in as root and we'll get started. Be sure you included all the X sets in your install! A good first thing to verify is that your network connectivity is working properly.

# ping -c 2 bsdnow.tv

PING bsdnow.tv (65.39.148.220): 56 data bytes
64 bytes from 65.39.148.220: icmp_seq=0 ttl=47 time=71.209 ms
64 bytes from 65.39.148.220: icmp_seq=1 ttl=47 time=54.169 ms
--- bsdnow.tv ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 54.169/62.689/71.209/8.520 ms

Assuming your network is functioning properly, the next thing to check whether there are any updates to the base system. If there were any issues that affect your version, you should go ahead and patch them. Even desktop systems should have a firewall, so we'll use a basic pf configuration.

# vi /etc/pf.conf

You might want something like:

set block-policy drop
set skip on lo0
match in all scrub (no-df random-id max-mss 1440)
antispoof quick for (egress)
block in quick on egress from { no-route urpf-failed } to any
block in all
pass out quick inet keep state

Since X11 is included with OpenBSD, we just need to install the other graphical utilities that we're going to need. Which desktop environment or window manager you use is up to you, but we'll be doing GNOME for this tutorial. Note that GNOME3 requires 3D acceleration, so this will not work in VirtualBox. XFCE doesn't have that requirement, so you may want to try it if you don't have a supported graphics card. Select a mirror close to you for the best speeds. I'm going to install GNOME and a few other packages that you'll probably want. TOAD is a daemon that allows hotplugging of CD/DVD drives. Even with emulation, Adobe Flash is not available for OpenBSD. The "youtube-dl" tool will let you download flash videos and play them in mplayer. The HTML5 versions of YouTube and some other sites will work normally.

# export PKG_PATH=http://ftp.usa.openbsd.org/pub/OpenBSD/`uname -r`/packages/`uname -m`/
# pkg_add -I gnome toadd firefox youtube-dl vim irssi scrot gstreamer-plugins-ugly mplayer ubuntu-fonts

You can also use ports to install everything if you prefer, but this is much faster. As of 5.5, binary packages are even signed, hooray! After everything installs, we'll add a few items to start up on boot and change a few settings.

# echo 'multicast_host=YES' >> /etc/rc.conf.local 
# echo 'ntpd_flags="-s"' >> /etc/rc.conf.local
# echo 'hotplugd_flags=""' >> /etc/rc.conf.local
# echo 'pkg_scripts="dbus_daemon avahi_daemon toad gdm"' >> /etc/rc.conf.local
# cp /etc/examples/ntpd.conf /etc
# echo 'constraint from "https://example.com"' >> /etc/ntpd.conf

If you're going to be using programs like Firefox, you're probably going to need to adjust some values in /etc/login.conf. By default, OpenBSD will kill any process your user runs after it takes up 512MB of RAM. Firefox can (and will) take a lot more, so let's up that a little bit.

# vi /etc/login.conf

A diff to show what you may want to change:

--- /etc/login.conf     Fri Mar  7 19:28:16 2014
+++ /etc/login.conf     Fri Mar  7 19:32:31 2014
@@ -43,8 +43,8 @@
 default:\
        :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\
        :umask=022:\
-       :datasize-max=512M:\
-       :datasize-cur=512M:\
+       :datasize-max=1024M:\
+       :datasize-cur=1024M:\
        :maxproc-max=256:\
        :maxproc-cur=128:\
        :openfiles-cur=512:\

I also recommend using soft updates and enabling the "noatime" flag on your root device.

# vi /etc/fstab

For example, if you installed / to /dev/wd0a, change the line to:

/dev/wd0a / ffs rw,noatime,softdep 1 1

Finally, apply all the changes. Make sure you do not have XDM set to start automatically.

# reboot

The system will restart and present you with a graphical login manager. You can log in as this regular user (not root!) and begin configuring things how you like through the graphical utilities. A couple nice screenshots from Antoine Jacoutot:

Latest News

New announcement

2017-05-25

We understand that Michael Dexter, Brad Davis, and George Rosamond think there should be more real news....

Two Year Anniversary

2015-08-08

We're quickly approaching our two-year anniversary, which will be on episode 105. To celebrate, we've created a unique t-shirt design, available for purchase until the end of August. Shirts will be shipped out around September 1st. Most of the proceeds will support the show, and specifically allow us to buy...

New discussion segment

2015-01-17

We're thinking about adding a new segment to the show where we discuss a topic that the listeners suggest. It's meant to be informative like a tutorial, but more of a "free discussion" format. If you have any subjects you want us to explore, or even just a good name...

How did you get into BSD?

2014-11-26

We've got a fun idea for the holidays this year: just like we ask during the interviews, we want to hear how all the viewers and listeners first got into BSD. Email us your story, either written or a video version, and we'll read and play some of them for...


Episode 261: FreeBSDcon flashback

2018-08-29

Direct Download:MP3 AudioVideo This episode was brought to you by Headlines An Insight into the Future of TrueOS BSD and Project Trident Last month, TrueOS announced that they would be spinning off their desktop offering. The team behind the new project, named Project Trident, have been working furiously towards their first release....

Episode 260: Hacking Tour of Europe

2018-08-22

Direct Download:MP3 AudioVideo This episode was brought to you by Headlines Essen Hackathon & BSDCam 2018 trip report Allan and Benedict met at FRA airport and then headed to the Air Rail terminal for our train to Essen where the Hackathon would happen over the weekend of Aug 10 - 12, 2018. Once there,...

Episode 259: Long Live Unix

2018-08-15

Direct Download:MP3 AudioVideo This episode was brought to you by Picking the contest winner 1) Vincent 2) Bostjan 3) Andrew 4) Klaus-Hendrik 5) Will 6) Toby 7) Johnny 8) David 9) manfrom 10) Niclas 11) Gary 12) Eddy 13) Bruce 14) Lizz 15) Jim Random number generator Headlines The Strange Birth and Long Life of Unix They say that when one door closes on you, another opens. People generally...

Episode 258: OS Foundations

2018-08-08

Direct Download:MP3 AudioVideo This episode was brought to you by Headlines FreeBSD Foundation Update, July 2018 MESSAGE FROM THE EXECUTIVE DIRECTOR We’re in the middle of summer here, in Boulder, CO. While the days are typically hot, they can also be quite unpredictable. Thanks to the Rocky Mountains, waking up to 50-degree (~10...