• NetBSD
  • Running NetBSD 9.1 on a Thinkpad X250

Brief technical overview

See link to dmesg output below for full details.

  • Lenovo Thinkpad X250
  • 8GB RAM
  • 480Gb SSD
  • 2x USB-3 ports
  • SD Card reader
  • Intel Dual Band Wireless-AC 7265

The good:

Overall, I have a very favorable impression of NetBSD. The system feels very stable and fast. It's highly configurable, bloat-free, and has that "do-it-yourself" attitude, with helpful man pages and pretty good documentation to get you started. I also managed to set up an encrypted home and swap partition using cgd. I did opt for full disk encryption at first but then my wifi driver wouldn't load at boot so I just reinstalled and went for an encrypted home/swap setup instead.

I experienced no issues connecting over WiFi (wpa_supplicant + dhcpcd) or ethernet. Wireless worked thanks to the iwm driver. Connecting to a Linux machine over ssh, sftp or setting up nfs? No problem at all. Thanks to hplip and cups I was able to set up printing as well. Virtually all of the applications I use on a daily basis (including some that are dispensable, like Strawberry music player) are available with pkgin. Much to like there.

Suspend-to-RAM + resume (which I lazily tend to refer to as "hibernation") worked out of the box. The only caveat here is that the mouse seemed to be disabled after resuming a session although the touchpad kept working just fine.

Speaking of the touchpad, that also worked out of the box, including mouse tapping so no need for any additional configuration there.

Audio mostly just works but, as you'll see below, it does have issues of its own. I only tested audio output and did not attempt to record anything.

Bluetooth seems to work although I didn't venture beyond activating the controller and scanning for pairable devices using the official documentation (see here). I generally dislike bluetooth and avoid it but for those who need it, it seems to me it worked on this machine.

The bad:

On the other hand, I'm afraid it's not going to cut it as a daily driver for me, at least not on this laptop. I'm not sure if the fact that I set up an encrypted swap & home partition with cgd (aes-xts 512) has had any impact on performance. I imagine it has, though I'm not sure to what degree. At any rate, memory and CPU usage is problematic. Audio is also clunky, whether listening to music on the console or during an X11 session.

I do have to note one thing: I started out with LXQT since many applications I use are QT-based. I switched back to good, "old" XFCE4 and discovered that memory handling was much better when running XFCE compared to LXQT. By far. Yet even with LXQT entirely removed and running XFCE exclusively, memory usage was still pretty high and it would just keep accumulating RAM.

For instance, even after closing an X11 session or on a cold boot, memory would sit at around 700Mb easily. On a cold boot, around 100Mb at least, and that would easily go up to 200Mb when installing packages or connecting to a remote machine over ssh. I also noticed I'd get memory usage up to like three to four GB of RAM when installing packages with pkgin (even with no X11 session running), and it would just stay there and never be freed up.

An overview:

  • AUDIO:

Good at first but eventually it ends up distorted. Whether listening to music on the console or during an X11 session, listening to a stream in a browser or watching a video, output would lag and get distorted and the CPU fan would kick in. Sometimes it would "settle" after a while, only to reappear when opening a new tab, firing up another program, or simply opening the XFCE menu. At times I'd get a nice little "reverb" effect. I can appreciate that but I'd prefer it didn't try to act as a deejay and let me remain in control of the mix, thank you very much. 😉

  • CPU & Memory:

Overall, CPU usage seemed rather high and core temperatures would be around 10 °C higher than on Linux, easily sitting at 50 °C and rarely going below 40 °C.

As mentioned, RAM usage is problematic. Firefox, Libreoffice and the likes are resource-heavy, but even after closing them, memory would not be deallocated. Closing the X11 session doesn't free up memory, either. It easily keeps hanging at 700Mb.

It was much worse after using LXQT, though, which seemed to eat RAM for breakfast. And, as mentioned, even installing software with pkgin would lead to excessively high memory usage, and once the job was done, it would remain just as high. I had to power off the machine and reboot to get it back to normal levels.

  • Software:

Something is up with Libreoffice. It refuses to respect any theming. Kvantum, QT5Ct, GTK themes? No use. Under Devuan/Debian you'd install libreoffice-gtk3 in that case but no such option seems to be available from pkgin.

  • XFCE & LXQT

As some have stated here before, xfce4-battery-plugin does not detect the battery. LXQT actually does, but it displayed two batteries in my case: the internal Thinkpad battery (which is simply not present) and the removable one. I haven't tested LXQT on bare metal under Linux so far so I'm not sure if this is a general problem or specific to the NetBSD implementation.

Another problem was LXQT's terminal: qterminal. I set my locale manually (/etc/profile & .xinitrc)and switched to bash for convenience but qterminal doesn't display certain accent characters even though xterm does. xfce4-terminal has no issues with that and it actually allows you to use UTF-8 encoding just fine. Clear win for XFCE there.

Conclusion

That being said, I will definitely keep following NetBSD. I've taken lots of notes and learned much in the process. Much of the knowledge I gained is "transferable" and can be applied to other Unix or certain unnamed "Unix-like" systems. 😉

On this machine, though, I can't commit myself to it at this stage. I'm thinking perhaps the safest option will be FreeBSD on this particular device. OpenBSD is not much of an option in this case (audio won't work, it's just too slow and not my preferred BSD). DflyBSD may also be an option though I've only tested the latest release in a VM so far.

Overall, a very worthwhile experience but not convincing enough to really make a permanent switch just yet. Too bad I don't have any other spare machines at the moment. Nevertheless, the experiment will go on!

Here are some pastebins:

dmesg output
rc.conf settings
RAM after cold boot
RAM under lxqt with firefox-esr going berserk
RAM under xfce4 after closing firefox-esr, libreoffice, vlc, etc

EDIT (2021-05-15): added a few notes on suspend/resume, audio, touchpad, bluetooth

    As mentioned, RAM usage is problematic. Firefox, Libreoffice and the likes are resource-heavy, but even after closing them, memory would not be deallocated. Closing the X11 session doesn't free up memory, either. It easily keeps hanging at 700Mb.

    NetBSD uses basically all of your system RAM for file caching. There's no reason letting RAM sit around unused, it's terrible for performance.

    The kernel knows best when it comes to managing memory. It frees it as required by applications, having to dedicate time to freeing it when nothing needs to use it would be a waste of its time.

    You can see a clear breakdown of what memory is currently being used for in "top", tools outside of the base system will be much less clever.

    Audio: Good at first but eventually it ends up distorted.

    The audio stack is interrupt driven. This is great for performance and latency, but can mean if there's little CPU time available to the kernel the stream can get mixed up. If you reset the encoding with "audiocfg set" it will re-initialize the stream. The NetBSD 10 kernel will also use much less system time than 9.

      Unfortunately, virtual memory and shared objects make memory usage benchmarking a headache, even under rigorous test conditions. This equally applies to any OS with those features, including Linux.
      As a consequence, evaluating an OS is better done with user experience metrics (i.e. what concretely matters in your everyday use of the system). These may be purely qualitative (e.g. what you did for audio) and possibly subjective, or quantitative (e.g. measuring the time to open a reference document, or whatever is meaningful to you).

      If you're to follow NetBSD, and possibly test other BSD, you may want to create such a standardized and reproducible set of metrics matching your use case, so you can usefully compare several OS on the same basis, as well as successive versions of the same OS.

      And of course, it would be interesting for us if you posted your findings in this thread. 🙂

      netneo Good at first but eventually it ends up distorted. Whether listening to music on the console or during an X11 session, listening to a stream in a browser or watching a video, output would lag and get distorted and the CPU fan would kick in.

      Never had any issues with audio on NetBSD.

      netneo Overall, CPU usage seemed rather high and core temperatures would be around 10 °C higher than on Linux,

      Yes, this is true. NetBSD runs about 15 C hotter than Linux. This is explained in acpicpu (See CAVEATS).

      netneo As some have stated here before, xfce4-battery-plugin does not detect the battery.

      The NetBSD support in xfce4-battery-plugin needs to be re-written to use proplib. (It will, currently, work on an i386.)

      I can do this if someone can test it for me--I don't use XFCE.

        Thanks @nia and @20-100 for your thoughts & comments on this! I just added a few more things to the "good" list to make this as balanced as possible. I'm writing this as an end user coming from Devuan Linux so my impressions are certainly influenced by my experience with that system. I figured NetBSD would handle memory differently. I thought maybe it was the file system or encryption as it didn't just affect X11 sessions. It did get to a point where the system felt slow and applications would have trouble opening, CPU going wild and such.

        Anyway, the X250 is basically meant as a backup laptop for casual use but also as a bit of a testing ground for my mixed workstation/server use on other machines.

        I briefly tried DflyBSD 6 (released just days ago) on it last night out of sheer curiosity but ended up installing FreeBSD 13 (with UFS as the file system though) + XFCE and the same basic set of applications I typically use. Performance-wise, it's really much snappier and lighter on resources for me than NetBSD 9.1 on this machine. It may even be better than when I run Devuan on it. But that's just my first impression. I'll stick with it for a week or so and report back in another review.

        My basic guiding principle is "use the right tool for the right use case" so just because it didn't perform well enough for me on the X250 doesn't mean it's "bad" of course. There's much I liked and I hope I'll be able to test it on my main machines some day as well.

        • Jay likes this.

        rvp Never had any issues with audio on NetBSD.

        It could just be this particular machine. It does seem to work most of the time, when sitting idle. But as soon as you do some multitasking, it just begins to crackle... The "reverb" I get happens when I launch some other program or fire up a browser tab, for instance. It's not that it stutters necessarily, just "hangs" or "reverbs" for a split second and then just goes on playing, but with some crackling...

        rvp Yes, this is true. NetBSD runs about 15 C hotter than Linux. This is explained in acpicpu (See CAVEATS).

        Thanks, will check that out.

        rvp I can do this if someone can test it for me--I don't use XFCE.

        I'm currently testing FreeBSD on it (no RAM or audio issues there so far it seems) but I might reinstall to give it a second chance so just PM me if you want me to test it, I'd be glad to!

        • rvp replied to this.

          rvp The information isn't entirely accurate for modern CPUs, which can do thermal and frequency scaling in hardware. This is usually expressed as an available ACPI frequency ending in 01 (visible in sysctl -a), e.g. sysctl -w machdep.cpu.frequency.target=2301. On older hardware this isn't available, but you can use estd from pkgsrc for the same effect from userspace (although it's obviously slightly less smart).

          • rvp replied to this.
          • Jay likes this.

            nia The NetBSD 10 kernel will also use much less system time than 9.

            Just out of curiosity, when is NetBSD 10 scheduled to be released?

            • nia replied to this.

              netneo Something is up with Libreoffice. It refuses to respect any theming.

              As shown on the other thread (https://www.unitedbsd.com/d/285-linux-user-and-netbsd-enthusiast-hoping-to-migrate-some-day/13), nothing is wrong with libreoffice. It accepted the theme and icons I told it to use, which btw was not the theme I'm using myself, I just picked one gtk-3 theme and applyed it.

              netneo LXQT, though, which seemed to eat RAM for breakfast.

              As @nia already mentioned, it will be released when needed. Btw, looking at the output you've posted you seem to be using several instances of qterminal. Every instance will use the same amount of RAM but, if you use tabs instead, it won't do that.

              All in all, the choice of what you use or not, it's obviously yours but just because... here's the output of top after 13h uptime right now,

              load averages:  0.10,  0.07,  0.03;               up 0+13:04:14        23:38:32
              32 processes: 31 sleeping, 1 on CPU
              CPU states:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
              Memory: 1222M Act, 4K Inact, 36M Wired, 32M Exec, 1153M File, 4842M Free
              Swap: 2000M Total, 2000M Free
              
                PID USERNAME PRI NICE   SIZE   RES STATE       TIME   WCPU    CPU COMMAND
                  0 root      96    0     0K   70M smtask/3    2:36  0.00%  0.00% [system]
                823 pin       85    0   215M   43M poll/0      1:34  0.00%  0.00% X
                325 pin       85    0    38M 2400K nanosl/0    0:05  0.00%  0.00% redshift
                775 pin       85    0    89M 6348K poll/1      0:03  0.00%  0.00% at-spi2-registry
               9041 pin       85    0    78M 5796K poll/1      0:02  0.00%  0.00% at-spi-bus-launc
               8795 pin       85    0    29M 2652K poll/0      0:01  0.00%  0.00% dbus-daemon
                573 _dhcpcd   85    0    19M 2300K poll/0      0:01  0.00%  0.00% dhcpcd
                639 _dhcpcd   85    0    19M 1416K poll/2      0:01  0.00%  0.00% dhcpcd
               5240 pin       43    0    25M 1984K CPU/2       0:00  0.00%  0.00% top
              11838 pin       85    0    86M   11M select/2    0:00  0.00%  0.00% xterm
               1952 root      85    0    75M 4576K wait/2      0:00  0.00%  0.00% login
                760 root      85    0    31M 2952K kqueue/0    0:00  0.00%  0.00% wpa_supplicant
               1907 root      85    0    26M 2804K select/3    0:00  0.00%  0.00% famd
                825 root      85    0    34M 2400K kqueue/2    0:00  0.00%  0.00% syslogd
               1846 pin       85    0    35M 2288K wait/2      0:00  0.00%  0.00% xinit
               5188 pin       85    0    29M 2212K poll/3      0:00  0.00%  0.00% dbus-daemon
               5190 pin       85    0    40M 2204K select/3    0:00  0.00%  0.00% dbus-launch
               1964 dbus      85    0    29M 2180K poll/2      0:00  0.00%  0.00% dbus-daemon
               2491 pin       85    0    37M 2172K poll/0      0:00  0.00%  0.00% frankenwm
               5671 pin       85    0    18M 1884K pause/2     0:00  0.00%  0.00% ksh
                291 pin       85    0    20M 1848K wait/0      0:00  0.00%  0.00% sh
                946 root      85    0    22M 1760K poll/0      0:00  0.00%  0.00% rpcbind
               1969 root      85    0    20M 1756K nanosl/2    0:00  0.00%  0.00% cron
               1982 pin       85    0    17M 1752K pause/2     0:00  0.00%  0.00% ksh
                630 root      85    0    19M 1660K poll/2      0:00  0.00%  0.00% dhcpcd
                  1 root      85    0    20M 1656K wait/0      0:00  0.00%  0.00% init
               2142 root      85    0    20M 1656K ttyraw/2    0:00  0.00%  0.00% getty
               2091 root      85    0    20M 1652K ttyraw/0    0:00  0.00%  0.00% getty
               2101 root      85    0    20M 1652K ttyraw/2    0:00  0.00%  0.00% getty
               1631 root      85    0    20M 1568K kqueue/2    0:00  0.00%  0.00% powerd
                625 _dhcpcd   85    0    19M 1484K poll/2      0:00  0.00%  0.00% dhcpcd
               2039 root      85    0    24M 1476K kqueue/2    0:00  0.00%  0.00% inetd

                pin I just picked one gtk-3 theme and applyed it

                I'll gladly check this in a VM again but so far any attempt at making it accept my theme settings has failed. Perhaps I have overlooked something. At any rate, I do want to stress that libreoffice itself does work fine.

                pin As @nia already mentioned, it will be released when needed. Btw, looking at the output you've posted you seem to be using several instances of qterminal.

                I'm far from an expert on system internals but I do get your and nia's point. Still, having been used to very low RAM usage on this system it does stress me out seeing RAM accumulate at such a high rate. As long as it doesn't impact performance, I can live with that. Trouble is, I have machines with similar if not identical hardware with at least twice as much RAM that I reserve for VMs and heavier applications. This sort of thing makes me reluctant to migrate those systems to NetBSD at this stage.

                That said, the real issue here for me is that the system actually did slow down to the point where multitasking became difficult. This significantly improved under XFCE somehow but not enough for me to be comfortable with. By way of comparison, I've been running FreeBSD 13 on this very same machine now (with UFS) with a near-identical setup and RAM is nowhere near as high. That said, this is just a first impression so I remain cautious. But I admit I'm pretty amazed so far. I'll report back on my findings with FreeBSD as soon as I can (in a different thread).

                I will definitely be revisiting NetBSD on the X250 as soon as I can, though. Perhaps installing it without encryption this time and having a closer look at X11 settings also. I'm wondering if there's any issue with the graphics driver since I had to make some adjustments under FreeBSD as well. Will report back duly.

                pin here's the output of top after 13h uptime right now

                Looks pretty good to me! Unfortunately, that was not exactly my experience...

                What system do you use if I may ask?

                • pin replied to this.

                  rvp I can test it for you, as far as battery monitor on xfce. I am using XFCE4 on pretty much all my BSD Systems. So I can test it across multiple machines to, to be sure.

                  • rvp replied to this.

                    nia The information isn't entirely accurate for modern CPUs, which can do thermal and frequency scaling in hardware. This is usually expressed as an available ACPI frequency ending in 01 (visible in sysctl -a), e.g. sysctl -w machdep.cpu.frequency.target=2301.

                    Cool--I didn't know this. However, even with the CPU freq. set to 1801, NetBSD runs 15-20 C hotter than FreeBSD at the same freq. I have to use estd to bring the temperture down (about 5 C).

                    netneo It could just be this particular machine.

                    Or, the encryption. Same for your mem. usage.

                    netneo so just PM me if you want me to test it

                    tcmart14 I can test it for you, as far as battery monitor on xfce.

                    I'm on the road right now. I'll be back home later this week. I'll send a patch then.

                      rvp FreeBSD is tickless, is it not? My laptop also runs hotter when plugged in regardless of whether an OS is running, there's an option in the firmware to change that, though.

                      • rvp replied to this.
                      • Jay likes this.

                        rvp That's great, I'll probably have reinstalled NetBSD 9.1 on the X250 by then so do keep me posted! I'll go about it slightly differently this time. Fingers crossed.

                        Thanks everyone for your comments and remarks so far, all of that is interesting and helpful to me one way or another!

                        • Jay likes this.

                        nia FreeBSD is tickless, is it not?

                        More likely it's these settings--which I had put in last year and then forgotten about:

                        /etc/rc.conf
                        performance_cx_lowest="Cmax"
                        economy_cx_lowest="Cmax"
                        /etc/sysctl.conf
                        hw.pci.do_power_nodriver=3
                        hw.acpi.cpu.cx_lowest=Cmax

                        And with NetBSD 9.2 having just been released (a pleasant surprise!), I guess I'll be testing this new version on the X250 asap!

                          6 days later