Setup OpenBSD as a daily driver using only the included, core programs. Based on OpenBSD 7.6.
---
{{TOC}}
## Requirements
- USB device
- Ethernet connection (with active internet)
- A cup of coffee
The real requirements are having patience and a passion for keeping things minimal. It's important to remeber that this setup isn't the most user-friendly. There will be no config files to edit or download in this guide. We will be using the `xenodm` login manager paired with the default stacked window manager `fvwm`. And that's it.
You have been warned!
## Installation
Make sure you have the latest OpenBSD image formatted on a USB device (or burned to a CD if that's your cup of tea!) and that your computer/laptop is set to boot from USB via the BIOS. Also make sure you are connected to the internet via ethernet cable (don't worry, we'll setup WiFi in a minute!)
Boot into the device and input the following when guided through the installer:
1. Boot from USB
2. Choose `Install`
3. Keyboard layout: `us`
4. Hostname: `x220` (or whatever you choose)
5. Network: `em0`
6. IPv4: `autoconf`
7. IPv6: `none`
8. Network interface: `done`
9. Password for root
10. Start sshd by default? `yes`
11. X Window System start with xenodm? `no`
12. Setup user? `username` (follow setup user steps)
13. Allow root ssh login? `no`
14. Timezone
15. Which disk? Use internal (`sd0` etc.)
16. Encrypt root disk? `no`
17. Use `WHOLE` disk
18. Use `AUTO` layout
19. Which disk to initialize: `done`
20. Location of sets: `http`
21. HTTP Proxy URL? `none`
22. HTTP Server? `1` (Toronto)
23. Confirm again
24. Server directory? `pub/OpenBSD/7.6/amd64`
25. Set names? `done`
26. Drink some coffee while it verifies (depends on network speed)
27. Location of sets? `done`
28. Congrats!
29. Reboot and remove USB device
## First Boot Tweaks
### User Permissions
Before we do anything, we should give our main user full access via `doas`. Login as `root` and run the following:
su -
echo "permit nopass :wheel" >> /etc/doas.conf
exit
### Firmware
The next steps will help you ensure you have the latest firmware.
Simply run the command: `fw_update`
### WiFi
To enable wifi on your device, run the following command (filling in the proper details where need be)
ifconfig iwn0 up
ifconfig iwn0 scan
echo "join WIFI-NAME wpakey PASSPHRASE" >> /etc/hostname.iwn0
echo "dhcp" >> /etc/hostname.iwn0
echo "inet6 autoconf" >> /etc/hostname.iwn0
echo "up powersave" >> /etc/hostname.iwn0
dhclient iwn0
Take note of the `iwn0`, as this might differ on your machine. (You can check this by running `ifconfig`)
You might also need to run `doas sh /etc/netstart` after.
### Performance Boost
This step is optional and targeted towards devices with batteries (laptops, IoT devices etc). Properly setup apmd:
rcctl enable apmd
rcctl set apmd flags -A
rcctl start apmd
## Login Manager
Remember when we chose `No` when the installer asked us "X Window System start with xenodm?". Well, now we want to enable that before our next reboot:
doas rcctl enable xenodm
Now reboot your device.
doas reboot
## The First *Real* Login
Now you will be presented with the glorious `xenodm` login screen.
The beautiful, default xenodm login screen. Image taken from tumfatig.net (who has some wonderful OpenBSD guides you should check out!)
Login with your created user details and you should see something like this:
Taken from the main OpenBSD Wikipedia page. (Some applications will not be opened by default)
Absolutely glorious. You'll also notice a 3x3 grid box in the bottom right corner:
This is called the "workspace pager" or "pager". Each section represents an individual *desktop* (or workspace if your more familiar with MacOS terminology). You can click on any grid item to instantly move to that desktop.
You can also navigate around using the Ctl + ↑→↓← keys.
## Playing with Default Packages
This section isn't going to explain each and every single useful package included with the base install of OpenBSD. Instead, I highly recommend that you read the documentation associated with each program. You can read these manual pages from your terminal by running `man `. Teach a man to fish and all that jazz...
### File & System Management
* `cp`, `mv`, `rm`, `mkdir`, `find`, `xargs`, `diff`, `patch`, `file`, `tar`, `gzip`, `bzip2`, `xz`, `mt` – typical file manipulation tools.
* `ls`, `du`, `df`, `stat` – for listing and inspecting files and disk usage.
* `vi`, `mg` – text editors (both included; `mg` is like Emacs-lite, `vi` is the classic).
* `ed`, `sed`, `awk`, `cut`, `tr`, `sort`, `uniq`, `paste`, `tee` – text processing tools.
* `rcctl`, `sysctl`, `top`, `ps`, `kill`, `nice`, `renice` – process and system control.
* `pkg_add`, `pkg_info`, `pkg_delete`, `pkg_check` – package management.
### User Tools
* `lpr`, `lpq`, `lprm` – basic printing.
* `xterm`, `xcalc`, `xedit`, `xmessage`, `xlock`, `xwd` - great "daily driver" tools shipped with `xbase`
* `xset`, `xrandr`, `xmodmap` – useful for configuring displays and keyboard/mouse.
### Networking
* `ftp` is a full-featured command-line downloader
* `scp`, `sftp`, `ssh`, `telnet` – for remote access and file transfers.
* `ifconfig`, `hostname`, `route`, `netstat`, `tcpdump` – network configuration and inspection.
### Security
* `unveil`, `pledge` – available for programs to restrict access and system calls (helpful for programs like Firefox, 3rd party editors).
## Additional Packages
I would suggest the following packages once you feel like installing "additional", non-base software:
- aerc (email client)
- Firefox (browser)
- ffmpeg (media player/converter)
- picom (compositor)
These can be installed by running `doas pkg_add ` in the terminal.
## Support OpenBSD
If you've found this guide helpful or even sparked an interest in OpenBSD, please consider [donating directly to the OpenBSD Project](https://www.openbsd.org/donations.html). A little goes a long way, and the OpenBSD Project is a volunteer-driven software group funded by donations!
## Contribute to OpenBASED
I'm far from an OpenBSD expert! Please [help improve this project](https://git.sr.ht/~bt/openbased)!