Skip to main content.

Building an OpenBSD desktop


Live demo in BSD Now Episode 031 | Originally written by TJ for | 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

PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=47 time=71.209 ms
64 bytes from icmp_seq=1 ttl=47 time=54.169 ms
--- 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=`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 ""' >> /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 @@
        :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\
-       :datasize-max=512M:\
-       :datasize-cur=512M:\
+       :datasize-max=1024M:\
+       :datasize-cur=1024M:\

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

Two Year Anniversary


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


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?


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...

EuroBSDCon 2014


As you might expect, both Allan and Kris will be at EuroBSDCon this year. They'll be busy hunting down various BSD developers and forcing them to do interviews, but don't hesitate to say hi if you're a listener!...

Episode 186: The Fast And the Firewall: Tokyo Drift


Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines AsiaBSDcon Reports and Reviews AsiaBSDcon schedule Schedule and slides from the 4th bhyvecon Michael Dexter’s trip report on the iXsystems blog NetBSD AsiaBSDcon booth report TrueOS Community Guidelines are here! TrueOS has published its new Community Guidelines The TrueOS Project has existed for over ten years. Until...

Episode 185: Exit Interview


Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Interview – Kris Moore – / @pcbsdKrisTrueOS founder, FreeNAS developer, BSD Now co-hostBenedict Reuschling – / @bsdbcrFreeBSD commiter & FreeBSD Foundation Vice President, BSD Now co-host Send questions, comments, show ideas/topics, or stories you want mentioned on the show...

Episode 184: Tokyo Dreaming


Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines OpenBSD A2k17 hackathon reports a2k17 hackathon report: Patrick Wildt on the arm64 port a2k17 hackathon report: Antoine Jacoutot on syspatch, rc.d improvements and more a2k17 hackathon report: Martin Pieuchot on NET_LOCK and much more a2k17 hackathon report: Kenneth Westerback on...

Episode 183: Getting Steamy Here


Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines playonbsd with TrueOS: It’s Getting Steamy in Here and I’ve Had Too Much Wine We’ve done a couple of tutorials in the past on using Steam and Wine with PC-BSD, but now with the addition of playonbsd to the...