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

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

EuroBSDCon 2014

2014-09-18

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 160: EuroBSD-Dreamin

2016-09-21

Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines Performance Improvements for FreeBSD Kernel Debugging “We previously explored FreeBSD userspace coredumps. Backtrace’s debugging platform supports FreeBSD kernel coredumps too, and their traces share many features. They are constructed somewhat differently, and in the process of adding support for them, we...

Episode 159: Net Scaling Privacy (Flix Style)

2016-09-14

Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines Protecting Netflix Viewing Privacy at Scale, with FreeBSD This blog post from Netflix tells the story of how Netflix developed in-kernel TLS to speed up delivery of video via HTTPS Since the beginning of the Open Connect program we have...

Episode 158: Ham, Radio and Pie (oh my)

2016-09-07

Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines PC-BSD is now TrueOS If you’ve been watching this show the past few months, I’ve been dropping little hints about the upcoming rename of PC-BSD -> TrueOS. We’ve made that more official finally, and are asking folks to test out the...

Episode 157: ZFS, The “Universal” File-system

2016-08-31

Direct Download:VideoHD VideoMP3 AudioOGG AudioTorrent This episode was brought to you by Headlines Registration for MeetBSD 2016 is now Open “Beastie’s coming home!” This year, MeetBSD will be held at UC Berkeley’s Clark Kerr Campus November 11th and 12th, preceded by a two day FreeBSD Vendor/Dev Summit (Nov 9th and 10th) MeetBSD can...