First look on OpenBSD

So for the past few months, I've been using FreeBSD. After some thoughts documented here, I decided to switch to OpenBSD.

Before mentioning anything else, I think I talk about what I ended that entry with. Why is absence of VMs no longer a issue for me? Well, I kinda expanded my setup. Back then, I only had single ThinkPad. Now I got a second monitor (good for multitasking/documentation, bad for keeping attention) and a second thinkpad. This one tho, I removed most parts from and it runs hedless Windows install that I then connect to using moonlight over a network cable. It needs a bit more setup that I'll do later, but It means I no longer need a VM.

(And yes, I added a extra power button, as it sits undr my monitor)

OK, now to the actual OS.

Install

Install went very smoothly. It does not have a TUI installer, but it does not need one. It's very straight forward and intuitive. I encoutered a few obstacles tho.

First was that There are no wifi drivers included in the install image for license reasons. Not really a problem tho, as you can put them on a separate (or even the same) USB stick and install later. All the packages are in the image, so you don't need them during the istall anyways. You will have to configure network manually, but the OpenBSD documentation is good, so it should not be a problem.

Second problem was completly on me. By default OpenBSD suggests to make a bunch of partitions for different directories. I, being used to linux and having no idea of how much space which directory needs, have decided to make one swap and one big root partition instead. It didn't boot afterwards.

After consulting the manual, I found out that partition names have meaning. 'a' needs to be boot partition, 'b' needs to be swap, and 'c' (which you can't change) needs to point to the entire disk. I made swap first and root second. The manual also said that it is better to have multiple partitions for everything to work properly, so I went with the default setup.

Lets see how it turns out.

Desktop

OpenBSD is often regarded as a server OS. It is however also used as a desktop by all it's devs and it even has its own window manager: CWM (which I use) and X fork called Xenocara.

Even knowing all this, I was still surprised that after selecting to enable xenodm(1), in the installer, it booted right into GUI. I logged in and was greeted with a familiar sight. FVWM, which I used in the past, is the default WM and there is no preinstalled software by default, it has some nice starting configuration.

When you open the context menu, it offers you to switch to various WMs, but only FVWM, TWM, and CWM are preinstalled.

I quickly copied my old dotfiles and relogged to CWM, which I've been using for some time now. Or so I thought. After some searching, I figured out that OpenBSD does not look for .xinit file, but only for .xsession. Well, I just renamed the symlink and all works now.

My setup still looks the same as my evilwm setup from FreeBSD install (CWM is actuall inspired by evilwm), so just go look there for pics.

Shell

If you ever wondered why did Apple chose to use zsh as the default shell in MacOS, it's because bash is GPL licensed, so you can't distribute it on a non-GPL OS. The same goes for BSDs. Truly free software indeed. FreeBSD ships with tcsh, which I quickly replaced with fish. OpenBSD ships with ksh. (pdksh to be more precise) I could continue using fish, but I was struck with the usual inspiration to use some obscure ancient pice of software, so I'll try using ksh for a while.

I will probably also try finally learn some shell scripting. Expect some entries on ksh in the future. And yes, I know that it would be better to learn bash and all, but it's my life and I get to choose how to waste it!

Needless to say, I spent the next few hours figuring out how ksh works and how to configure it properly. There is not much new sources on ksh (go figure), but all the old guides are still relevant. Also the manpage is nice. After you finish this, go read manpage for your shell. Even if you don't script, there is a bunch of cool interactive features you probably don't know about.

Also just reading these old manuals is a lot of fun. "If you need inspiration, run this command to get .profile of all your coworkers." "best way to determine what $TERM to set, outside of contacting your local guru, is this." It sometimes feels like a alternative reality, rather than the past we lost.

Well, back to OpenBSD

Package management

Package management on OpenBSD is handled by 'pkg_*' set of commands. you mostly use pkg_add(1), pkg_delete(1), and pkg_info(1). They work. They have most of what you need. There is no flag for looking up dependencies, but you can use:

pkg_info -f <package> | grep @depend

You also use doas(1) instead of sudo.

I did however not find some software I use in the repos. There is no librewolf, so I'll try runing (not so) regular firefox for now. There is also no KDE spectacle, so I'll have to do with flameshot.

It can't do screenshot of current window, but it seems like the best one out there. Even on linux, I haven't find anything that works better than spectacle. Oh, well, it's not like I use screenshot that much anyways.

Other

Firefox uses unveil(2), which is a OpenBSD feature that restricts which files it can see. Quite shocking when you try upload a file and there is nothing. I have allowed it access to few folders and when it opens file select window, you just type the path to folder you want to use.

Also, I'm not sure if this is a regular firefox thing or OpenBSD addition, but you can have multiple profiles.

Turning off your computer is quite a culture shock. First I tried to run 'poweroff', but there is none! Then I tried 'shutdown now', but that just thrown me into a root tty? From there, it rebooted... long story short, you need to run

shutdown -p now
or
halt -p

Also, note that the flag is before 'now'. It needs to be there.

I tried to connect to a android device via 'simple-mtpfs', but to no success.

'rcctl' seems nice and minimal, 'sysctl' seems usable. More research is needed.

EOF

It's a OS, lets see if it's better that Linux.