/ OpenBSD

Setup a desktop environment under OpenBSD with XFCE

How many times I've heard : « OpenBSD is a system made for servers not desktops »
Well... that's so wrong !

This paper is not aiming to be very technical as the setup is really easy, its goal is to help you see OpenBSD as a system you can use everyday for almost everything you need.


Why should we use OpenBSD as a Desktop ?

  1. It's free...
  2. Stable, no crash, no surprise
  3. Secure by default, and you can still use Packet Filter to secure even more your desktop like a server
  4. Good performances with Xorg (the rest depends on your configuration)
  5. Very good hardware recognition
  6. Allows a full disk encryption, awesome when you go out with your laptop
  7. Good package system to find what you need (Desktop Environment, Web browser, Music Player, etc)

What Desktop Environment may I use ?

There is a lot of Desktop Environments you can install on OpenBSD :

Some of them (Gnome & KDE for example) will take more ressources than others (ie. Fluxbox). Finally, it depends on what environment you like, and your computer's performances.

In this paper, we'll focus on XFCE's setup. Why ?

  1. It runs smoothly on most configurations, as it's light it uses less battery
  2. It's beautiful, managing transparency for example, a lot of themes are available too
  3. It manages multiple virtual desktops easily
  4. It allows you to add hightly configurable panels making your desktop experience even better
  5. We can run it without needing root privileges

Ready, Steady, Go !

Configure and install what we need !

First of all, if you want an OpenBSD installation with Full Disk Encryption you should check this paper.

Then, depending on your hardware configuration you may need to set the machdep.allowaperture value to 2 on your system :

# vi /etc/sysctl.conf

# reboot

machdep.allowaperture grants access to the /dev/xf86 device driver which provides access to the memory and I/O ports of a VGA board and to the PCI configuration registers for use by the X servers when running with a kernel security level greater than 0. (More informations here.)

IMPORTANT : Since the 5.4 release it's not necessary to use it anymore on Intel/AMD architectures, but in some cases (if you use virtualization for example) you'll still need it.

Now, we'll install every components we need with the OpenBSD package tool pkg. In my case : XFCE and its tools, firefox to browse the web, vlc to watch movies & listen music.

# pkg_add xfce xfce-extras firefox vlc

My goal is to run everything unprivileged, I'll configure XFCE to start manually and as a simple user :

$ vi ~/.xinitrc
exec startxfce4

$ startx

Your Desktop Environment should be starting.
You can easily configure it by right-clicking and browsing options.


Automatically start XFCE at system startup :

If you want your system to start XFCE immediately without having to use startx, just make a crontab to launch it when the system starts :

$ crontab -e
@reboot /usr/X11R6/bin/startx > /dev/null 2>&1

Need help ?



« I know everyone I've been everywhere I know everything Because I'm everybody » Ether - Nothingface

Read More