top | item 18370327

OpenBSD on a Laptop

266 points| perlgod | 7 years ago |c0ffee.net

116 comments

order
[+] gigatexal|7 years ago|reply
This is probably the single coolest feature of OpenBSD: “Also, Chromium on OpenBSD recently got unveil support. If you run it with --enable-unveil, Chromium will be prevented (at the OS level) from accessing anything other than your ~/Downloads folder.”
[+] yjftsjthsd-h|7 years ago|reply
FWIW: On Linux, I use firejail to do this.

But it's sweet to have natively:)

[+] humblebee|7 years ago|reply
Does anyone know how this works with profiles / cache? Does this force something like incognito mode? Also does this mean you can't upload / select files outside of the Downloads folder?
[+] sydney6|7 years ago|reply
Does anybody know if FreeBSD has any form of sandboxing (e.g. seccomp) available for any of the available browsers?
[+] saagarjha|7 years ago|reply
How does this compare to the sandboxing on macOS? Is this just at the file level, currently?
[+] ATsch|7 years ago|reply
That's pretty cool. I wish Chromium supported this on Linux too. It seems more like a Chromium feature than an openbsd feature to me though? Linux programs installed via say flatpak have this on by default.
[+] floatboth|7 years ago|reply
> many features that require toil to achieve on FreeBSD, such as suspend on lid close, working volume buttons, and decent battery life, work out of the box on OpenBSD

Suspend on lid close worked out of the box for me on FreeBSD, on a ThinkPad X240. (Well, almost out of the box — had to disable the TPM in the firmware setup, otherwise the TPM would prevent it from waking up.)

There's NO WAY battery life could be better on OpenBSD though. OpenBSD is not even tickless!!

I measured the power consumption of the SoC with Intel's pcm tools, it's ~1W when idling in GUI on FreeBSD. Does OpenBSD even have pcm.x? ;)

[+] dijit|7 years ago|reply
> There's NO WAY battery life could be better on OpenBSD though. OpenBSD is not even tickless!!

FWIW FreeBSD idled hot on my thinkpad x201 and x201s, where openbsd did not. I got more battery from a slim Linux than openBSD, but FreeBSD was by far the worst for battery life if you're comparing them.

[+] throwaway2048|7 years ago|reply
I trust in god alone, all others must bring benchmarks.
[+] stragulus|7 years ago|reply
I like how most of the configuration in this setup is very similar to how I configured systems as far back as mid-nineties. Most applications have a simple single config file, and a single responsibility, true to Unix' philosophy. My window manager needs haven't really changed during all this time. Add a nice launcher that indexes your system and you have most of everything you will need.
[+] beefhash|7 years ago|reply
> Full Disk Encryption with SoftRAID

It's worth noting that SoftRAID for encryption is mutually exclusive with SoftRAID for redundancy: "Note that "stacking" softraid modes (mirrored drives and encryption, for example) is not supported at this time."[1]

[1] https://www.openbsd.org/faq/faq14.html#softraid

[+] accrual|7 years ago|reply
One can certainly stack softraid volumes but I think the FAQ indicates you won't receive support if something goes wrong.

    # bioctl -c 1 -l /dev/sd1a,/dev/sd2a
    softraid0: RAID 1 volume attached as sd3
    # ...
    # bioctl -c C -l /dev/sd3a softraid0
    New passphrase:
    Re-type passphrase:
    softraid0: CRYPTO volume attached as sd4
    # 
I've personally used a setup like this since around OpenBSD 6.0.
[+] brobdingnagians|7 years ago|reply
On my desktop, I tried installing TrueOS and FreeBSD but kept having trouble with the install, then the applications and KDE, then the drivers, things were wonkie. Installed OpenBSD a couple of times and it all (mainly) just worked. Eventually just stayed with OpenBSD and have been very happy, especially with the excellent documentation, ease of installation and ease of use. I heard the FreeBSD devs don't use it on their personal comps as much as OpenBSD devs do, and what kind of sealed the deal for me. Thinking back, it was even easier than most Linux installs I've done.
[+] geggam|7 years ago|reply
OpenBSD is the friendliest OS I know of. That said... it seems to be picky at who it calls friend :)
[+] gbrown_|7 years ago|reply
This should probably also mention running syspatch.

http://man.openbsd.org/syspatch

[+] fiddlerwoaroof|7 years ago|reply
Cool, the biggest issue I’ve always had with FreeBSD is figuring out how to do routine updates when I’ve installed ports.
[+] nimbius|7 years ago|reply
Ive tried a BSD laptop before, and my concerns always boil down to the same nonsense...can anyone offer some advice?:

- how do i read ext4/fat/etc usb sticks from coworkers. - is 3d or video support good with AMD? - soundcard and full disk encryption? what about EFI boot?

[+] snazz|7 years ago|reply
- reading ext4 is possible but hard (OpenBSD doesn’t support journaling filesystems); you’re better off with ext2 or FAT - video support with AMD GPUs is good, much better than NVIDIA - OpenBSD has a good sound stack that supports most audio systems - full disk encryption is easy to set up and mentioned in the article - UEFI and GPT work wonderfully on recent versions
[+] bitwize|7 years ago|reply
NetBSD can read ext3/4 with a puffs filesystem driver... these days it can support ext4 extents natively as well, just not journalling.

Puffs is the NetBSD version of FUSE, and there is even a FUSE-to-puffs adapter so you can mount FUSE filesystems under NetBSD.

[+] waterhouse|7 years ago|reply
Question. I find it exceedingly useful that Mac OS has readline keybindings enabled in most (all? I can't think of any counterexamples, including the Spotlight overlay) of its text fields: control-A is head of line, control-E is end of line, etc. I've been using control-N and control-P to move between lines while editing this comment; it's simply a text field in Firefox.

Is it possible to turn on this functionality in OpenBSD?

[+] floren|7 years ago|reply
Why configure cwm to emulate i3 when you could just run i3?

Still, cool to see people running a BSD on a laptop, IIRC I ran NetBSD on my old Thinkpad in college.

[+] robotmay|7 years ago|reply
I was just thinking of swapping my largely-unused ThinkPad over to OpenBSD yesterday, so this is extremely timely and useful :D
[+] gigatexal|7 years ago|reply
Great article. Been thinking of doing the same. Typo in the first paragraph under “Installation”:

“Grab a USB stick and download the the the amd64 disk image:”

[+] Philipp__|7 years ago|reply
How’s the battery life? OpenBSD is nice and nifty little UNIX experience, definitely geared towards users who know what they are doing/wanting.
[+] perlgod|7 years ago|reply
About 7 hours on an oldish ThinkPad (T530) on a full charge:

  $ apm
  Battery state: high, 99% remaining, 430 minutes life estimate
  A/C adapter state: not connected
  Performance adjustment mode: auto (1200 MHz)
[+] oneplane|7 years ago|reply
While this is a nice setup in case of a ThinkPad, this doesn't really work out on practically anything else. I get that a lot of the FOSS, or somewhat more specifically, the hardcore users use a ThinkPad, but the rest of the world pretty much doesn't (at least no longer since Lenovo bought IBM's spun-off computer bits). None of this stuff works on the generic MS Surface or Apple Mac stuff you see in 99% of the use cases where people are capable of installing an OS at all.

As nice as mobile support in OpenBSD is, and as nice as this guide is, it's still super niche :(

[+] reason-mr|7 years ago|reply
Writer spent ages on the window manager. XFCE is much easier : https://sohcahtoa.org.uk/openbsd.html
[+] TurboHaskal|7 years ago|reply
To be fair, I use cwm as well and the only configuration I made to it was changing the font.
[+] keithpeter|7 years ago|reply
I've not updated that page for the new release as yet. The first paragraph summarises the changes.

OA has an example of the new wifi autofind feature which I need to bottom out.

[+] j7ake|7 years ago|reply
I am interested in moving from OSX to Linux.

However, my muscle memory have made it difficult to use ctrl + key versus command + key.

Is there an easy way (for example in Ubuntu?) to remap shortcuts so the copy and paste is command + C and command + V? Also, the ctrl + C should still stop processes in the terminal, so it's not as simple as swapping ctrl and command for all processes... This problem has been bugging me a lot with linux and I finding a solid solution would help a lot of OSX people switch to linux more easily.

[+] gjs278|7 years ago|reply
the problem is with your previous operating system, not ours. I wish I could flip the mac laptop to not use that command key.
[+] dredmorbius|7 years ago|reply
xmodmap for keys.

Most desktop environments allow remapping hotkey bindings and combos, though I strongly recomment sticking to defaults.

Well, except for ctrl-capslock swapping, of course.

[+] DanBC|7 years ago|reply
This looks like a useful guide.

> If you're even a little paranoid, you should start by overwriting the disk with random data. We'll assume your hard disk is sd0—you can use dmesg to check. The c suffix is OpenBSD's way of specifying the entire disk.

   dd if=/dev/urandom of=/dev/rsd0c bs=1m
Can I check: why would you do this rather than using ATA SECURE ERASE command?

Having a blob of random data on my drive would mean crossing international borders is potentially unpleasant.

[+] simonebrunozzi|7 years ago|reply
Does anyone know if OpenBSD can run properly on a Macbook?
[+] ben_bai|7 years ago|reply
MacBook G4 sure... newer ones may have problems. To new users/new hardware I would recommend an usb stick with the network installer and then try to install to the usb stick and check what is working.

Also check if you PC is listed here. https://dmesgd.nycbug.org/index.cgi?do=index&fts=apple

[+] snazz|7 years ago|reply
Just installed it on a late 2009 MacBook A1342 and everything works except the Broadcom Wi-Fi. Using an external Belkin stick supported by rum(4). Even the NVIDIA GeForce 9400m is functional both on the command line and in Xorg. The touchpad works out of the box with gestures and right-click and scrolling and the whole nine yards.

Newer Macs might be more challenging, with fancy proprietary chips and whatnot.

Be sure to enable apm(4) to not melt through your motherboard.

[+] watersb|7 years ago|reply
Runs great on my iBook G3. I know that isn't what you asked, but FWIW OpenBSD works on my old laptops.
[+] anthk|7 years ago|reply
Nice, but if you like click to focus and raise VM's you can try JWM, is great and with very few deps, almost NIL.
[+] vtail|7 years ago|reply
Amazing guide! You have a typo - a second ‘chown’ in mail setup section should be ‘chmod’
[+] quickben|7 years ago|reply
"You won't find nearly as many online resources about setting up OpenBSD, because honestly, you really don't need any. "

That was the the last thing I wanted to read when wondering if openbsd will fit on my Ryzen machine.

[+] ori_b|7 years ago|reply
You don't need a third party blog, it's in the documentation[1]: "All versions of the AMD Athlon 64 processors and their clones are supported."

The other drivers are the ones you need to worry about -- check the man pages, which list the supported hardware. For example: https://man.openbsd.org/radeon.4

The attitude isn't "You shouldn't need documentation". The attitude is "OpenBSD should ship with documentation good enough that nobody feels the need to write up the results of sleuthing around".

[1]https://www.openbsd.org/amd64.html

[+] brynet|7 years ago|reply
Ryzen works great, and will likely improve over time. The Vega GPU that accompanies some models is unsupported, however, if you can get a slightly older AMD card things will be better on the graphics side, but this is only important if you care about some light gaming or desktop frills.

My OpenBSD Ryzen build:

https://brynet.biz.tm/article-ryzenbuild.html