Discussion:
[CM] OpenBSD and the modern laptop
(too old to reply)
RS Wood
2018-06-03 14:35:12 UTC
Permalink
From the «COUBOM = cow bomb?» department:
Title: OpenBSD and the modern laptop
Author: Peter N. M. Hansteen
Date: Mon, 10 Jul 2017 15:53:00 -0400
Link: https://bsdly.blogspot.com/2017/07/openbsd-and-modern-laptop.html

Did you think that OpenBSD[1] is suitable only for firewalls and high-security
servers? Think again. Here are my steps to transform a modern mid to high range
laptop into a useful Unix workstation with OpenBSD.

One thing that never ceases to amaze me is that whenever I'm out and about with
my primary laptop at conferences and elsewhere geeks gather, a significant
subset of the people I meet have a hard time believing that my laptop runs
OpenBSD[1], and that it's the only system installed.

A typical exchange runs something like,

"So what system do you run on that laptop there?"
"It's OpenBSD. xfce is the window manager, and on this primary workstation I
tend to just upgrade from snapshot to snapshot."
"Really? But ..."

and then it takes a bit of demonstrating that yes, the graphics runs with the
best available resolution the hardware can offer, the wireless network is
functional, suspend and resume does work, and so forth. And of course, yes, I
do use that system when writing books and articles too. Apparently heavy users
of other free operating systems do not always run them on their primary
workstations.

I'm not sure at what time I permanently converted my then-primary workstation
to run OpenBSD exclusively, but I do remember that when I took delivery of the
ThinkPad R60 (mentioned in this piece[2]) in 2006, the only way forward was to
install the most recent OpenBSD snapshot. By mid-2014 the ThinkPad SL500
started falling to pieces, and its replacement was a Multicom[3] Ultrabook
W840, manufactured by Clevo[4]. The Clevo Ultrabook has weathered my daily
abuse and being dragged to various corners of the world for conferences well,
but on the trek to BSDCan 2017[5] cracks started appearing in the glass on the
display and the situation worsened on the return trip.

So the time came to shop around for a replacement. After a bit of shopping
around I came back to Multicom[3], a small computers and parts supplier outfit
in rural Åmli in southern Norway, the same place I had sourced the previous
one.

One of the things that attracted me to that particular shop and their
own-branded offerings is that they will let you buy those computers with no
operating system installed. That is of course what you want to do when you
source your operating system separately, as we OpenBSD users tend to do.

The last time around I had gone for a "Thin and lightweight" 14 inch model
(Thickness 20mm, weight 2.0kg) with 16GB RAM, 240GB SSD for system disk and 1TB
HD for /home (since swapped out for a same-size SSD, as the dmesg[6] will
show).

Three years later, the rough equivalent with some added oomph for me to stay
comfortable for some years to come ended me with a 13.3 inch model, 18mm thick
and advertised as 1.3kg (but actually weighing in at 1.5kg, possibly due to
extra components), 32GB RAM, 512GB SSD and 2TB harddisk. For now the
specification can be viewed online here[7] (the site language is Norwegian, but
product names and units of measure are not in fact different).

That system arrived today, in a slender box:
[image 9][9]

Here are the two machines, the old (2014-vintage) and the new side by side:
[image 11][11]

The OpenBSD installer is a wonder of straightforward, no-nonsense simplicity
that simply gets the job done. Even so, if you are not yet familiar with
OpenBSD, it is worth spending some time reading the OpenBSD FAQ[12]'s
installation guidelines[13] and the INSTALL.$platform file (in our case,
INSTALL.amd64[14]) to familiarize yourself with the procedure. If you're
following this article to the letter and will be installing a snapshot, it is
worth reading the notes on following -current[15] too.

The main hurdle back when I was installing the 2014-vintage 14" model was
getting the system to consider the SSD which showed up as sd1 the automatic
choice for booting (I solved that by removing the MBR, setting the size of the
MBR on the hard drive that showed up as sd0 to 0 and enlarging the OpenBSD part
to fill the entire drive).
Let's see how the new one is configured, then. I try running with the default
UEFI "Secure boot" option enabled, and it worked.
Here we see the last part of the messages that scroll across the screen when
the new laptop boots from the USB thumbdrive that has had the most recent
OpenBSD/amd64[16]install61.fsdd[17]'ed onto it:
[image 19][19]

And as the kernel messages showed us during boot (yes, that scrolled off the
top before I got around to taking the picture), the SSD came up as sd1 while
the hard drive registered as sd0. Keep that in mind for later.
[image 21][21]

After the initial greeting from the installer, the first menu asks what we want
to do. This is a new system, so only (A)utoinstall and (I)nstall would have any
chance of working. I had not set up for automatic install this time around, so
choosing (I)nstall was the obvious thing to do.
The next item the installer wants to know is which keyboard layout to use and
to set as the default on the installed system. I'm used to using Norwegian
keyboards, so no is the obvious choice for me here. If you want to see the list
of available options, you press ? and then choose the one you find the must
suitable.
Once you've chosen the keyboard layout, the installer prompts you for the
system's host name. This is only the host part, the domain part comes later.
I'm sure your site or organization has some kind of policy in place for choice
of host names. Make sure you stay inside any local norms, the one illustrated
here conforms with what we have here.
Next up the installer asks which network interfaces to configure. A modern
laptop such as this one comes with at least two network interfaces: a wireless
interface, in this case an Intel part that is supported in OpenBSD with the
iwm(4)[22] driver, and a wired gigabit ethernet interface which the installer
kernel recognized as re0[23].
Quite a few pieces the hardware in a typical modern laptop requires the
operating system to load firmware onto the device before it can start
interacting meaningfully with the kernel. The Intel wireless network parts
supported by the iwm(4)[22] driver and the earlier iwn(4)[24] all have that
requirement. However, for some reason the OpenBSD project has not been granted
permission to distribute the Intel firmware files, so with only the OpenBSD
installer it is not possible to use iwm(4)[22] devices during an initial
install. So in this initial round I only configure the re0[23] interface.
During the initial post-install boot the rc.firsttime[25] script will run
fw_update(1)[26] command that will identify devices that require firmware files
and download them from the most convenient OpenBSD firmware mirror site.
My network here has a DHCP server in place, so I simply choose the default dhcp
for IPv4 address assignment and autoconf for IPv6.
With the IPv4 and IPv6 addresses set, the installer prompts for the domain
name. Once again, the choice was not terribly hard in my case.
[image 28][28]

On OpenBSD, root is a real user, and you need to set that user's password even
if you will rarely if ever log in directly as root. You will need to type that
password twice, and as the install documentation states, the installer will
only check that the passwords match. It's up to you to set a usefully strong
password, and this too is one of the things organizations are likely to have
specific guidelines for.
Once root's password is set, the installer asks whether you want to start
sshd(8)[29] by default. The default is the sensible yes, but if you answer no
here, the installed system will not have any services listening on the system's
reachable interfaces.
The next question is whether the machine will run the X Windows system. This is
a laptop with a "Full HD" display and well supported hardware to drive it, so
the obvious choice here is yes.
I've gotten used to running with xenodm(1)[30] display manager and xfce as the
windowing environment, so the question about xenodm is a clear yes too, in my
case.
The next question is whether to create at least one regular user during the
install. Creating a user for your systems adminstrator during install has one
important advantage: the user you create at this point will be a member of the
wheel group, which makes it slightly easier to move to other privilege levels
via doas(1)[31] or similar.
Here I create a user for myself, and it is added, behind the scenes, to the
wheel group.
With a user in place, it is time to decide whether root will be able to log in
via ssh. The sensible default is no, which means you too should just press
enter here.
The installer guessed correctly for my time zone, so it's another Enter to move
forward.
Next up is the part that people have traditionally found the most scary in
OpenBSD installing: Disk setup.
If the machine had come with only one storage device, this would have been a
no-brainer. But I have a fast SSD that I want to use as the system disk, and a
slightly slower and roomier rotating rust device aka hard disk that I want
primarily as the /home partition.
I noted during the bsd.rd boot that the SSD came up as sd1 and the hard drive
came up as sd0, so we turn to the SSD (sd1) first.
Since the system successfully booted with the "Secure boot" options in place, I
go for the Whole disk GPT option and move on to setting partition sizes.
The default suggestion for disk layout makes a lot of sense and will set
sensible mount options, but I will be storing /home on a separate device, so I
choose the (E)dit auto layout option and use the R for Resize option to
redistribute the space left over to the other partitions.
Here is also where you decide the size of the swap space, traditionally on the
boot device's b partition. Both crashdumps and suspend to disk use swap space
for their storage needs, so if you care about any of these, you will need to
allocate at least as much space as the amount of physical RAM installed in the
system. Because I could, I allocated the double of that, or 64GB.

For sd0, I once again choose the Whole disk GPT option and make one honking big
/home partition for myself.
The installer then goes on to create the file systems, and returns with the
prompt to specify where to find install sets.
The USB drive that I dd[17]'ed the install61.fs image to is the system's third
sd[32] device (sd2), so choosing disk and specifying sd2 with the subdirectory
6.1/amd64 makes sense here. On the other hand, if your network and the path to
the nearest mirror is fast enough, you may actually save time choosing a http
network install over installing from a relatively slow USB drive.
Anyway, the sets install proceeds and trundles through what is likely the
longest period of forced inactivity that you will have during an OpenBSD
install.
The installer verifies the signed sets and installs them.
[image 34][34]

Once the sets install is done, you get the offer of specifying more sets --
your site could have a site-specific items in an install set -- but I don't
have any of those handy, so I just press enter to accept the default done.
If you get the option to correct system time here, accept it and have ntpd(8)[35]
set your system clock to a sane setting gleaned from well known NTP servers.
With everything else in place, the installer links the kernel with a unique
layout, in what is right now a -current-only feature, but one that will most
likely be one of the more talked-about items in the OpenBSD 6.2 release some
time in the not too distant future.
With all items on the installer's agenda done, the installer exits and leaves
you at a root shell prompt where the only useful action is to type reboot and
press enter. Unless, of course you have specific items you know will need to be
edited into the configuration before the reboot.
After completing the reboot, the system did unfortunately not, as expected,
immediately present the xenodm[30] login screen, but rather the text login
prompt.

Looking at the /var/log/Xorg.0.log file pointed to driver problems, but after a
little web searching on the obvious keywords, I found this gist note[36] from
notable OpenBSD developer Reyk Flöter that gave me the things to paste into my
/etc/xorg.conf[37] to yield a usable graphics display for now.

Update 2017-09-27: Kaby Lake[38] support is now available. I installed the
2017-09-27 snapshot, and I am now running the machine with no xorg.conf[37].
I preserved updated dmesg(8)[39] output[40] and xdpyinfo(1)[41] output[42].
It is worth noting that what is in that snapshot is likely very close to what
will be in OpenBSD[43] 6.2.


My task for this evening is to move my working environment to new hardware, so
after install there are really only two items remaining, in no particular
order:

* move my (too large) accumulation of /home/ data to the new system, and
* install the same selection of packages on the old machine to the new
system.

The first item will take longer, so I shut down all the stuff I normally have
running on the laptop such as web browsers, editors and various other client
programs, and use pkg_info(1)[44] to create the list of installed packages on
the 'from' system:
$ pkg_info -mz >installed_packages
then I transfer the installed_packages file to the fresh system, but not before
recording the df[45]-h status of the pristine fresh install:
$ df -hFilesystem Size Used Avail Capacity Mounted on/dev/sd1a 1005M 76.4M 878M
8% //dev/sd0d 1.8T 552K 1.7T 0% /home/dev/sd1d 31.5G 12.0K 29.9G 0% /tmp
/dev/sd1f 98.4G 629M 92.9G 1% /usr/dev/sd1g 9.8G 177M 9.2G 2% /usr/X11R6
/dev/sd1h 108G 218K 103G 0% /usr/local/dev/sd1k 9.8G 2.0K 9.3G 0% /usr/obj
/dev/sd1j 49.2G 2.0K 46.7G 0% /usr/src/dev/sd1e 98.4G 5.6M 93.5G 0% /var
Not directly visible here is the amount of swap configured in the sd1b
partition. As I mentioned earlier, crashdumps and suspend to disk both use swap
space for their storage needs, so if you care about any of these, you will need
to allocate at least as much space as the amount of physical RAM installed in
the system. Because I could, I allocated the double of that, or 64GB.

I also take a peek at the old system's /etc/doas.conf[46] and enter the same
content on the new system to get the same path to higher privilege that I'm
used to having. With those in hand, recreating the set of installed packages on
the fresh system is then a matter of a single command:
$ doas pkg_add -l installed_packages
and pkg_add(1)[47] proceeds to fetch and install the same packages I had on the
old system.
Then there is the matter of transferring the
I-refuse-to-admit-the-actual-number-of gigabytes that make up the content of my
home directory. In many environments it would make sense to just restore from
the most recent backup, but in my case where the source and destination sit
side by side, i chose to go with a simple rsync transfer:

$ rsync -rcpPCavu 192.168.103.69:/home/peter . | tee -a
20170710-transferlog.txt
(Yes, I'm aware that I could have done something similar with nc[48] and tar[49]
, which are both in the base system. But rsync wins by being more easily
resumable.)

While the data transfers, there is ample time to check for parts of the old
system's configuration that should be transferred to the new one. Setting up
the hostname.iwm0 file to hold the config for the wireless networks (see the
hostname.if[50] man page) by essentially copying across the previous one is an
obvious thing, and this is the time when you discover tweaks you love that were
not part of that package's default configuration.
Some time went by while the content transferred, and I can now announce that
I'm typing away on the machine that is at the same time both the most
lightweight and the most powerful machine I have ever owned.

I am slowly checking and finding that the stuff I care about just works, though
I haven't bothered to check whether the webcam works yet. I know you've been
dying to see the dmesg[39], which can be found here[51]. I'm sure I'll get to
the bottom of the 'not configured' items (yes, there are some) fairly soon.
Look for updates that will be added to the end of this column.
And after all these years, I finally have a machine that matches my beard
color:

[image 53][53]

If you have any questions on running OpenBSD[1] as a primary working
environment, I'm generally happy to answer but in almost all cases I would
prefer that you use the mailing lists[54] such as ***@openbsd.org or the
OpenBSD Facebook group[55] so the question and hopefully useful answers become
available to the general public. Browsing the slides for my recent OpenBSD and
you[56] user group talk might be beneficial if you're not yet familiar with the
system. And of course, comments on this article are welcome.

------------------------------------------------------------------------------
Update 2017-07-18: One useful thing to do once you have your system up and
running is to submit your dmesg[57] to the NYCBUG dmesg database.[58] The one
for the system described here is up as
http://dmesgd.nycbug.org/index.cgi?do=view&id=3227[59].

Update 2017-08-18: Ars Technica reviews the same model, in a skinnier
configuration, with a focus on Linux, in Review: System76’s Galago Pro solves
“just works” Linux’s Goldilocks problem[60].

Update 2017-08-24: After questions about how the OpenBSD installer handles UEFI
and the 'Secure boot' options, I recorded the output of fdisk[61] -v in this
file[62], which I hope clears up any ambiguity left by the original article.

Update 2017-09-27:Kaby Lake[38] support is now available. I installed the
2017-09-27 snapshot, and I am now running the machine with no xorg.conf[37]. I
preserved updated dmesg(8)[39]output[40] and xdpyinfo(1)[41] output[42]. It is
worth noting that what is in that snapshot is likely very close to what will be
in OpenBSD[43] 6.2.

Links:
[1]: http://www.openbsd.org/ (link)
[2]: https://bsdly.blogspot.com/2010/01/goodness-of-men-and-machinery.html (link)
[3]: http://www.multicom.no/ (link)
[4]: http://www.clevo.com/ (link)
[5]: http://www.bsdcan.org/2017/ (link)
[6]: https://home.nuug.no/~peter/dmesg.elke.20170709.txt (link)
[7]: https://www.multicom.no/systemconfigurator.aspx?q=st:10637291;c:100559;fl:0#4091-10500502-1;4086-10637290-1;4087-8562157-2;4088-9101982-1;4089-9101991-1 (link)
[8]: Loading Image... (link)
[9]: Loading Image... (image)
[10]: Loading Image... (link)
[11]: Loading Image... (image)
[12]: https://www.openbsd.org/faq/ (link)
[13]: https://www.openbsd.org/faq/faq4.html (link)
[14]: http://ftp.eu.openbsd.org/pub/OpenBSD/snapshots/amd64/INSTALL.amd64 (link)
[15]: https://www.openbsd.org/faq/current.html (link)
[16]: https://www.openbsd.org/amd64.html (link)
[17]: http://man.openbsd.org/dd (link)
[18]: Loading Image... (link)
[19]: Loading Image... (image)
[20]: Loading Image... (link)
[21]: Loading Image... (image)
[22]: http://man.openbsd.org/iwm (link)
[23]: http://man.openbsd.org/re (link)
[24]: http://man.openbsd.org/iwn (link)
[25]: http://man.openbsd.org/rc.firsttime (link)
[26]: http://man.openbsd.org/fw_update (link)
[27]: Loading Image... (link)
[28]: Loading Image... (image)
[29]: http://man.openbsd.org/sshd (link)
[30]: http://man.openbsd.org/xenodm (link)
[31]: http://man.openbsd.org/doas (link)
[32]: http://man.openbsd.org/sd (link)
[33]: Loading Image... (link)
[34]: Loading Image... (image)
[35]: http://man.openbsd.org/ntpd (link)
[36]: https://gist.github.com/reyk/80dca43c8bcfa76d2a7ff147ea64d442 (link)
[37]: http://man.openbsd.org/xorg.conf (link)
[38]: https://www.google.no/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwjMo4L46cXWAhVkSZoKHS-4DeQQFggsMAE&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FKaby_Lake&usg=AFQjCNGP7zo_7WN5BwTOq410HoV_J7QYdg (link)
[39]: http://man.openbsd.org/dmesg (link)
[40]: https://home.nuug.no/~peter/20170927_dmesg_greyhame.txt (link)
[41]: http://man.openbsd.org/xdpyinfo (link)
[42]: https://home.nuug.no/~peter/20170927_xdpyinfo_greyhame.txt (link)
[43]: https://www.openbsd.org/ (link)
[44]: http://man.openbsd.org/pkg_info (link)
[45]: http://man.openbsd.org/df (link)
[46]: http://man.openbsd.org/doas.conf (link)
[47]: http://man.openbsd.org/pkg_add (link)
[48]: http://man.openbsd.org/nc (link)
[49]: http://man.openbsd.org/tar (link)
[50]: http://man.openbsd.org/hostname.if (link)
[51]: https://home.nuug.no/~peter/dmesg.greyhame.bsdly.net_20170710.txt (link)
[52]: Loading Image... (link)
[53]: Loading Image... (image)
[54]: https://www.openbsd.org/mail.html (link)
[55]: https://www.facebook.com/groups/2210554563/ (link)
[56]: https://home.nuug.no/~peter/openbsd_and_you/ (link)
[57]: https://man.openbsd.org/dmesg (link)
[58]: http://dmesgd.nycbug.org/ (link)
[59]: http://dmesgd.nycbug.org/index.cgi?do=view&id=3227 (link)
[60]: https://arstechnica.com/gadgets/2017/08/review-system76s-galago-pro-solves-just-works-linuxs-goldilocks-problem/ (link)
[61]: https://man.openbsd.org/fdisk (link)
[62]: https://home.nuug.no/~peter/greyhame.fdisk_-v.txt (link)
Oregonian Haruspex
2018-06-04 08:50:54 UTC
Permalink
I'm running OpenBSD on a Toughbook CF-U1 and a Toughbook CF-C1 and
everything works great. With its great documentation, super stability, and
the philosophy of doing things correctly instead of chasing the novelty
ferret it is a bit more boring than Linux.

I do keep a Debian laptop because I need Mathematica though.
Theo
2018-06-04 21:51:13 UTC
Permalink
Post by Oregonian Haruspex
I'm running OpenBSD on a Toughbook CF-U1 and a Toughbook CF-C1 and
everything works great. With its great documentation, super stability, and
the philosophy of doing things correctly instead of chasing the novelty
ferret it is a bit more boring than Linux.
How does the power management go? It's something Linux distros generally
don't do very well out of the box, needing tweaking, and FreeBSD barely does
at all.

How does the battery life look in comparison to Windows on the same
hardware? Do suspend and hibernate work?

Theo
Oregonian Haruspex
2018-06-07 20:17:48 UTC
Permalink
Post by Theo
How does the power management go? It's something Linux distros generally
don't do very well out of the box, needing tweaking, and FreeBSD barely does
at all.
Suspend and hibernate work fine on the C1, the U1 needs a bit of tweaking
because the screen won’t wake back up after suspend / hibernate but it is
apparently fixable according to some guy on the Internet.
Post by Theo
How does the battery life look in comparison to Windows on the same
hardware? Do suspend and hibernate work?
I haven’t used Windows since the XP days so I wouldn’t know. Both machines
give about 6 hours with the batteries they came with.
RS Wood
2018-06-10 19:47:41 UTC
Permalink
chasing the novelty ferret
Great quote!
Huge
2018-06-11 09:25:12 UTC
Permalink
Post by RS Wood
chasing the novelty ferret
Great quote!
Isn't it!

I shall steal that forthwith.
--
Today is Boomtime, the 16th day of Confusion in the YOLD 3184
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn.
Conceited Jerk
2018-06-10 18:19:58 UTC
Permalink
Post by RS Wood
Did you think that OpenBSD[1] is suitable only for firewalls and
high-security servers? Think again. Here are my steps to transform a
modern mid to high range laptop into a useful Unix workstation with
OpenBSD.
One thing that never ceases to amaze me is that whenever I'm out and
about with my primary laptop at conferences and elsewhere geeks gather,
a significant subset of the people I meet have a hard time believing
that my laptop runs OpenBSD[1], and that it's the only system installed.
While not a modern laptop, I installed OpenBSD on my Presario 2100 last
weekend. It took a little bit of research to get it up and going the way
I like, but I have it running quite well.

When I upgrade to a 64-bit laptop later this year, I'll be running OpenBSD
on it.
Loading...