pull down to refresh

OpenBSD is a great operating system, based on security and simplicity.
If you want to test this OS, you can run a virtual machine and install OpenBSD on it. And that's what we're going to do.
Many people like to use VirtualBox for these things, and that's great, but OpenBSD doesn't work very well there as there's no guest additions, so no full-screen there.
Instead, for this tutorial, we'll use the great QEMU which works great with OpenBSD, including full-screen support.

Install dependencies

sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager
Make sure your hardware can run virtualization OK:
sudo kvm-ok
It should say:
INFO: /dev/kvm exists KVM acceleration can be used

Get the installer

At the moment the latest version is 7.8, but check which is the latest and change the version accordingly (in two places):
wget https://cdn.openbsd.org/pub/OpenBSD/7.8/amd64/install78.iso

Prepare the disk

Now we create a hard disk for the OS with up to 20GB (it will only use up to that amount in your disk). The extension qcow2 is from "QEMU Copy On Write 2", a popular image disk format for QEMU:
qemu-img create -f qcow2 openbsd78.qcow2 20G
It should say something like:
Formatting 'openbsd78.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=21474836480 lazy_refcounts=off refcount_bits=16

Install the system

Now we can attach the ISO and the recently created disk image:
qemu-system-x86_64 -enable-kvm -m 2048 -hda openbsd78.qcow2 -cdrom install78.iso -boot d
QEMU will start, and boot the system. Now, wait for a few seconds until you see this screen:
Press I and enter. Then you will be asked about how you want the system to be configured, you can simply hit enter to accept the default options which are quite reasonable. Then specify the hostname you want (openbsd for example), continue accepting the defaults and then you'll setup the root password. Create a good one. Then continue accepting the defaults until you see:
"Do you want the X window System to be started by xenodm(1)?"
Answer yes (default is no). This is to have X on startup. Continue with defaults until they ask you to create a non-root user. Create one and setup a password for it, this is the user you will login with at the end. Continue with defaults.
You'll arrive to this screen:
Continue with the defaults, and specify cd0 for the sets. Then, say yes to "Continue without verification":
This is because it would make no sense for the installer to verify them. If someone were to make a rogue installation image, they could certainly change the installer to say the files were legitimate. If the image's signature has been verified beforehand, it is safe to answer "yes" at that prompt
After the sets are installed, simply press enter to accept the default (done).
That's it!, you now have OpenBSD installed, just reboot the system:
As you can see here, the installer is running again, that's because we still have the ISO in there:
We will now turn off the system and boot it with only the disk with OpenBSD in it (no ISO). Simply go to QEMU menu and select Machine->Quit. Now, let's start the system without the ISO:
qemu-system-x86_64 -enable-kvm -m 2048 -hda openbsd78.qcow2
CTRL-ALT-F switches from full-screen to window mode and vice-versa
CTRL-ALT-G switches your mouse and keyboard from your host to OpenBSD and vice-versa.
After you login with your non-root user you will now be in an OpenBSD system, with full-screen:
And that's it, you can now explore OpenBSD at full-screen in the comfort of a virtual machine.
It comes with a custom FVWM as the default window manager. You can customize it to your liking:
If you instead want a more fully featured desktop environment, you can even install Plasma as KDE6 is now supported in OpenBSD.
What are any practical experience benefits of OpenBSD? The DE looks very outdated, there are many convenient features missing, etc. What about terminal - is it POSIX compliant and so essentially the same as Linux experience?
reply
Yeah, OpenBSD is POSIX compliant.
OpenBSD is secure by default, so it comes with nothing extra. Actually the default is to not even start the window manager at startup (there's no desktop environment installed by default). It's fantastic for firewall setups and secure network applications.
But you can also use it on laptops for example, and run fully featured desktop environments such as Plasma, which is the one from KDE, Kubuntu, etc. And there are other DEs as well.
It's not the same as Linux, which is the kernel, which is then combined with distros, etc. OpenBSD comes with the entire OS, including the kernel.
There are many similarities, but the philosophy is different, as OpenBSD focuses on security, and they keep removing unused or unsafe code.
OpenSSH for example was developed in the OpenBSD project, and then ported to many others.
OpenBSD is not a distro of Linux for example, it is a completely different OS. Other BSDs like FreeBSD provided the foundation to create macOS for example.
reply
50 sats \ 3 replies \ @nout 16 Dec
But from practically user experience / ergonomy perspective - there are no differences? I'm guessing less software available compared to Linux?
(I hear you that there is a different philosophy, which may be introducing cleaner code and setup...)
reply
It's not practical as a desktop environment, its mostly used in secure appliances (headless).
Great for building your own firewall, HSM/signing server, etc.
reply
0 sats \ 1 reply \ @nout 16 Dec
And for those use cases - why is it great? Like is there some better config interface, or is it just eating less ram, or does it have less of a chance of some error? Or is there something different compared to Linux that introduces better security?
reply
It's what they prioritize... thats upstream of their release processes, surface minimization, isolation, they even make their own hardened networking tools (openssh you'd use in any linux or other BSD is made by them)
They put hardening above usability / compatibility, where linux distros and more friendly BSD's may compromise more on one or the other.
reply
I think there was one step missed here, and that's checking whether the BIOS is set to handle virtualization. It's a setting in the BIOS, not the Kernel, so it can't be changed in the CLI. You have to preset in the BIOS and then restart the machine. Then you set up the rest of the steps. Otherwise virtual box and similar VM tools won't work. This is a critical point for older machines because they older mother boards like the B450 tend to be wonky with virtualization settings. Usually boards afterwards at the B550 level handle it better.
reply
I would like to run and use it as daily driver in my M1 Mac, I’m not a dev, but I don’t care. I can’t learn if I don’t face it. By now I’m fine using Asahi Linux until I learn how to use OpenBSD.
reply
Yeah, OpenBSD is supported in M1/M2. You're even one step forward in that direction already:
Apple systems need to have a UEFI environment installed before OpenBSD can be booted. This can be done by running the Asahi Linux installer. Afterwards you can boot the installer from a USB device connected to one of the ports on the machine.
reply
0 sats \ 0 replies \ @Fenix 12h
I read and tried this, but I had problems with the booting from the USB drive part. I tried twice with different USB drives and couldn't do it. Maybe it's the method of creating the bootable USB drive, or maybe it's because I used a USB adapter to read the USB drive.
I’ll try again later.
reply
In the other thread here it sounds like OpenBSD isn't a good idea to use for personal computer and then my guess would be that it won't work on M1. Asahi had to do a lot of work to make it work.
reply