OpenBSD

Things to do after installing OpenBSD


1. Set up user permissions

Login as root to configure doas for other users.
First, install a text editor:

pkg_add vim
usermod -G operator <user name>
usermod -G wheel <user name> # To use doas

Edit the doas configuration file:

vim /etc/doas.conf

Add the following line:

permit persist :wheel

If you don't want to type your password every time when using doas, you can instead use:

permit nopass :wheel

2. Update firmware and OpenBSD base system

fw_update # To install missing driver
syspatch # Apply system patches

3. Install a Desktop Environment (DE) / Window Manager (WM) and enable services

In this setup, we will install OpenBox and some useful extras:

pkg_add openbox tint2 chromium sakura git noto-cjk noto-emoji picom feh

Enable and start necessary daemons:

rcctl enable apmd
rcctl enable messagebus
rcctl enable xenodm

Exit the root user and longin as your user:

Create or edit your .xsession file in your home directory:

vim ~/.xsession

Add the following line to start OpenBox:

picom &
tint2 &
sakura &
feh --bg-fill somewallpaper &
exec openbox

Finally, reboot:

doas shutdown -r now

4. How to install obmenu-generator

NOTE: The package obmenu-generator is not available in OpenBSD's package repositories, so you will need to install it from source.
  1. To build it, we need to install some dependencies.
  2. doas pkg_add py-gtk2 cmake curl gtar p5-Gtk3
  3. Installing cpanm.
  4. cd /usr/local/bin/
    doas curl -L https://cpanmin.us/ -o cpanm
    doas chmod +x cpanm
  5. Create a folder in ~/.config/ name it obmenu-genrator.
  6. mkdir -p ~/.config/obmenu-generator
  7. Clone obmenu-generator.
  8. git clone --depth=1 https://github.com/trizen/obmenu-generator
    cp obmenu-generator/schema.pl ~/.config/obmenu-generator/
    doas cp obmenu-generator/obmenu-generator /usr/local/bin/
    doas chmod +x /usr/local/bin/obmenu-generator
  9. Running cpanm.
  10. doas cpanm Linux::DesktopFiles
    doas cpanm Data::Dump
    doas cpanm File::DesktopEntry
  11. Running obmenu-generator with -p and -i to have a menu with icons.
  12. obmenu-generator -p -i

5. How to Remove the xconsole Window After Login

NOTE: After you log in, a small window may pop up with xenodm. That is the xconsole.

To get rid of it, follow these steps:

  1. Open the file /etc/X11/xenodm/Xsetup_0 with vim (using doas for permission):
  2. doas vim /etc/X11/xenodm/Xsetup_0
  3. Find the line that mentions xconsole.
  4. Comment out that line by adding a # at the beginning.
  5. Save the file and exit vim.
  6. Reboot your system:
  7. doas shutdown -r now

After rebooting, the xconsole window will no longer appear.