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

Hi, Mr. Dexter...

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 198: BSDNorth or You can’t handle the libtruth

2017-06-14

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines Pre-conference activities: Goat BoF, FreeBSD Foundation Board Meeting, and FreeBSD Journal Editorial Board Meeting The FreeBSD Foundation has a new President as Justin Gibbs is busy this year with building a house, so George Neville-Neil took up the task to serve as...

Episode 197: Relaying the good news

2017-06-07

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines We are off to BSDCan but we have an interview and news roundup for you. Interview - Michael W. Lucas - mwlucas@michaelwlucas.com / @mwlauthor Books, conferences & how these two combine News Roundup In The Name Of Sane Email: Setting Up OpenBSD's spamd(8) With Secondary...

Episode 196: PostgreZFS

2017-05-31

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines EuroBSDcon 2017 - Talks & Schedule published The EuroBSDcon website was updated with the tutorial and talk schedule for the upcoming September conference in Paris, France. Tutorials on the 1st day: Kirk McKusick - An Introduction to the FreeBSD Open-Source Operating System, George...

Episode 195: I don’t WannaCry

2017-05-24

Direct Download:HD VideoMP3 AudioTorrent This episode was brought to you by Headlines ino64 project committed to FreeBSD 12-CURRENT The ino64 project has been completed and merged into FreeBSD 12-CURRENT Extend the inot, devt, nlinkt types to 64-bit ints. Modify struct dirent layout to add doff, increase the size of dfileno to 64-bits,...