9 ms·
OpenBSD on a Laptop
- floatboth 8y ago> 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 8y ago> 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.
- floatboth 8y agoOdd. Did you load the GPU driver? Start powerd?
- dijit 8y agoYes. I was looking at power optimisations at the time and those were suggestions. The issue was an idle load of 1.0 (nothing was noticably taking cpu), and when I say idle I mean there was nothing being drawn on screen and the browser was closed.
- JdeBP 8y ago... but Sendmail was furiously trying to redeliver a massive mail queue of daily security run output messages? (-: There is more than just your WWW browser and X applications running on a FreeBSD system.
- dijit 8y agoYes, of course, but maybe that's part of the problem. FWIW, sendmail delivery to local mailboxes shouldn't need to retry, since it'll just dump in roots spool folder.
- throwaway2048 8y agoI trust in god alone, all others must bring benchmarks.
- gbrown_ 8y agoThis should probably also mention running syspatch. http://man.openbsd.org/syspatch http://man.openbsd.org/syspatch
- fiddlerwoaroof 8y agoCool, the biggest issue I’ve always had with FreeBSD is figuring out how to do routine updates when I’ve installed ports.
- floatboth 8y agoIf you're building some ports with custom options, check out Synth: https://github.com/jrmarino/synth https://github.com/jrmarino/synth It downloads binary packages when it can & builds ports in parallel while showing a very nice ncurses UI :)
- perlgod 8y agoCan second Synth. I always used it on laptops where a full poudriere setup would have been overkill. Also it’s written in Ada!
- fiddlerwoaroof 8y agoCool, as a Lisper I have to support niche languages :)
- perlgod 8y agoThanks for the feedback! I've added a tidbit about syspatch, and also warned users about the (somewhat unusual) state of updates for third-party packages on OpenBSD: https://www.c0ffee.net/blog/openbsd-on-a-laptop/#updates https://www.c0ffee.net/blog/openbsd-on-a-laptop/#updates
- beefhash 8y ago> 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 https://www.openbsd.org/faq/faq14.html#softraid
- accrual 8y agoOne 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.
- beefhash 8y agoInteresting, I didn't know it worked. A comment on another site by stsp@[1] suggested it doesn't. https://lobste.rs/s/ljdhug/install_openbsd_on_dedibox_with_full_disk#c_zgjnoa https://lobste.rs/s/ljdhug/install_openbsd_on_dedibox_with_f...
- ben_bai 8y agoIt does work if you do it manually. The nested softraid will not be assembled at boot. Thus oficially unsupported.
- brobdingnagians 8y agoOn 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 8y agoOpenBSD is the friendliest OS I know of. That said... it seems to be picky at who it calls friend :)
- openloop 8y agoThanks.
- gigatexal 8y agoGreat 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:”
- perlgod 8y agoThanks!
- floren 8y agoWhy 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.
- peatmoss 8y agoIt’s in the OpenBSD distribution, which presumably means it undergoes the same code auditing that the rest of OpenBSD does.
- sverige 8y agoYep, cwm is maintained by the OpenBSD devs and is part of base, so you don't have to download a package for it. If you want, though, i3 is only a quick dl away. I used to have a kind of complicated cwm setup, but I got tired of that and just use XFCE now. It runs great.
- anthk 8y agoDitto, but with JWM instead of XFCE. Minimalist, a rational set of functionalities, click-to-focus-and-raise, plus a CDE-like colorscheme borrowed from AIX. As for the file manager, I use noice, but I woudn't mind this ported to OpenBSD: http://www.musikwissenschaft.uni-mainz.de/~ag/xplore/ http://www.musikwissenschaft.uni-mainz.de/~ag/xplore/
- peatmoss 8y agoI can’t decide whether the old motif widgets are ugly as sin or not. But for whatever reason, I find the screenshot of that file manager to be salve for my soul. Probably just nostalgia. I must say though that I’m just as glad Motif has mostly faded into history. It was... a challenging widget set to work with. Now, I wish something like GNUStep had caught on. Maybe an independent BSD implementation.
- anthk 8y ago
- gigatexal 8y agoThis 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 8y agoFWIW: On Linux, I use firejail to do this. But it's sweet to have natively:)
- ATsch 8y agoThat'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.
- snazz 8y agounveil(2) is an OpenBSD-specific feature, although you could accomplish something very similar with Linux and another sandboxing tool (or SELinux, but that might be overkill). I highly recommend you read the man page for unveil(2), it's very cool: https://man.openbsd.org/unveil https://man.openbsd.org/unveil
- ATsch 8y ago> unveil(2) is an OpenBSD-specific feature Yes, I am aware. I thought it was pretty obvious that when I said "it's a chrome feature" I didn't mean "unveil(2)" but being able to restrict access to the filesystem. Which is possible with both linux and openbsd, of course. Alas, the downvoters seem to disagree.
- gigatexal 8y agoI think if you run a snap package without privileges it is pretty sandboxed too.
- 8y ago
- oneplane 8y agoWhile 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 :(
- LeoPanthera 8y agoYour specific examples are special cases. The Surface is essentially a “Windows 10 machine”, and while Apple permits installation of Windows on Macs, other operating systems are specifically not supported. (And macOS is already BSD-esque anyway.) These instructions will work fine on any normal, generic, PC laptop.
- tracker1 8y agoUnless you're on older unsupported macbooks, I'm not sure I'd run something that wasn't macOS unless under a VM. That's just me. Although, I don't like a lot of the direction, or lack of with macOS. I'll probably put a new system together around mid next year (leaning Ryzen 2 near release). Will decide on Hackintosh, Linux or BSD at that time. Most likely hackintosh, but who knows. Linux (Elementary and Ubuntu) are finally around where I would want it for a primary desktop.
- oneplane 8y agoI was merely stating the general work-machine distribution in my direct and indirect environment. Perhaps they are special cases from the OS standpoint, but from the people point of view, those are the devices they have.
- snazz 8y agoActually, OpenBSD does work on the Microsoft Surface Go, thanks to Joshua Stein's driver work [0]. You're right that many systems will require a more in-depth setup than the ThinkPad in the article (Broadcom wireless and NVIDIA graphics are a challenge in particular), but many laptops work much better than you would expect. I've had good luck getting it to boot on older Mac hardware; newer systems (especially with the T2 chip) may be harder. [0]: https://jcs.org/2018/08/31/surface_go https://jcs.org/2018/08/31/surface_go
- Philipp__ 8y agoHow’s the battery life? OpenBSD is nice and nifty little UNIX experience, definitely geared towards users who know what they are doing/wanting.
- perlgod 8y agoAbout 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)
- Philipp__ 8y agoWow that’s good! I want to get used x220 and new 9 cell battery. If I could pull of 7-9h battery life I would consider it a great success. Btw i would be using only StumpWM, Firefox and Emacs. For media consumption I got MacBooks.
- carlesfe 8y agoOn my x230 with the 44wh battery I get around 4-5 hrs with normal usage
- adictator 8y agoI was about to install Chromium OS on my wife's laptop. But now I think I'll try OpenBSD.
- ape4 8y agoA small detail, why do we still have to specify the blocksize (bs=1m) to dd. Can't it have a better default than 512 bytes.
- LeoPanthera 8y agoIn most cases, 128k is actually the optimal block size, and is (microscopically) faster than 1m. And also uses a tiny bit less ram.
- reason-mr 8y agoWriter spent ages on the window manager. XFCE is much easier : https://sohcahtoa.org.uk/openbsd.html https://sohcahtoa.org.uk/openbsd.html
- TurboHaskal 8y agoTo be fair, I use cwm as well and the only configuration I made to it was changing the font.
- keithpeter 8y agoI'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.
- nimbius 8y agoIve 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 8y ago- 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
- kotajacob 8y agoWhat's the reason for missing journaling file systems? Lack of developers? Design choice for code simplification? Security reasons? Or something else?
- trasz 8y agoI guess the same as with support for, say, NTFS, plus less incentive to work on it, since it’s less popular.
- trasz 8y agoSimilar with FreeBSD (use geli for encryption) and I believe ext4 read support works now.
- dredmorbius 8y agoIs there FS-wrapper support on OBSD?
- bitwize 8y agoNetBSD 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.
- simonebrunozzi 8y agoDoes anyone know if OpenBSD can run properly on a Macbook?
- ben_bai 8y agoMacBook 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 https://dmesgd.nycbug.org/index.cgi?do=index&fts=apple
- b3b0p 8y agoYou are tempting me to pick up my 1 of 2 favorite laptops (or both) of ever that I owned: The 12 and 17 inch Aluminum Powerbook G4. Makes me wonder what kind of mods I can do to it now?
- watersb 8y agoRuns great on my iBook G3. I know that isn't what you asked, but FWIW OpenBSD works on my old laptops.
- snazz 8y agoJust 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.
- anthk 8y agoNice, but if you like click to focus and raise VM's you can try JWM, is great and with very few deps, almost NIL.
- stragulus 8y agoI 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.
- quickben 8y ago"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 8y agoYou 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 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 https://www.openbsd.org/amd64.html
- quickben 8y agoThanks, I'll check that out.
- brynet 8y agoRyzen 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 https://brynet.biz.tm/article-ryzenbuild.html
- vtail 8y agoAmazing guide! You have a typo - a second ‘chown’ in mail setup section should be ‘chmod’
- perlgod 8y agoThank you!
- vtail 8y agoSome more: 1) .cwmrc has a parse error around chrome command - fixed by adding quotes around “chrome —enable-unveil” 2) I copied your fonts.conf exactly, and see “Fontconfig error, line 2: syntax error”. Can’t figure out yet what’s going on.
- vtail 8y agoI've fixed Fontconfig error by properly capitalizing DOCTYPE and SYSTEM and using double quotes: <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
- perlgod 8y agoThanks. I think the issue is DOCTYPE, here’s the real file that I use hosted on GitHub, haven’t had any problems with it. https://github.com/cullum/dotfiles/blob/master/fontconfig/.config/fontconfig/fonts.conf https://github.com/cullum/dotfiles/blob/master/fontconfig/.c...
- robotmay 8y agoI was just thinking of swapping my largely-unused ThinkPad over to OpenBSD yesterday, so this is extremely timely and useful :D
- DanBC 8y agoThis 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.
- j7ake 8y agoI 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 8y agothe problem is with your previous operating system, not ours. I wish I could flip the mac laptop to not use that command key.
- leadingthenet 8y agoWhy? It's much, much more comfortable once you get used to it.
- gjs278 8y agodoubtful. the command key does not need to exist. every other operating system gets along fine without it. apple is not even consistent either. as soon as you open up their terminal, you’re stuck in this bizarre land where you have to ctrl+c and cmd+c for different tasks. linux splits paste into either a mouse click or shift+insert to avoid all this.
- saagarjha 8y ago> you’re stuck in this bizarre land where you have to ctrl+c and cmd+c for different tasks Which I find quite reasonable, personally. If I want to copy text, it's Command-C everywhere in the system, even in the terminal–no Command-Shift-C or similar "hack". If I want to send a SIGINT to a program it's Control-C, as it should be.
- JdeBP 8y ago
- waterhouse 8y agoQuestion. 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?