在基于 Arm 的 Thinkpad X13S 笔记本上运行 Linux
Linux 笔记本电脑 Armbian Arm
![](/data/attachment/album/202309/10/094539zbhccmbzcndjdn7c.jpg)



> 
> Armbian 23.08 版本已出炉，初步开始为这款轻薄的 Snapdragon 笔记本提供支持。
> 
> 
> 


最新发布的 Armbian 有助于解决在 Arm 计算机上安装并运行 Linux 发行版的困难 —— 这是一项不小的挑战。


今年 3 月我们 [评测](https://www.theregister.com/2023/03/21/lenovo_thinkpad_x13s_the_stealth/) 的联想 Thinkpad X13S 第一代，是我们评估的首款主流 Arm 驱动笔记本电脑。当然，市面上确实还有其他的 Arm 笔记本，如 Pine64 的 [Pinebook Pro](https://www.theregister.com/2022/08/02/pinebook_pro_finally_starts_shipping/) 和多款基于 Arm 的 ChromeBook 等。然而，X13S 更接近常规的基于 x86 的笔记本电脑：具备优质的配置，配有 16GB 内存和 256GB 的 NVMe SSD，更重要的是，它搭载了 PC 行业标准的 UEFI 固件，这在消费级 Arm 计算机上尚属罕见。另一个好消息是，你可以禁用安全启动，这是许多 Arm 设备不支持的。十年前，这是最初的微软 Surface RT 的一个 [关键问题](https://www.theregister.com/2013/11/14/microsoft_surface_rt_stockpile/)：Windows RT 一团糟，而它的固件不让你运行其他的系统。


虽然 X13S 从 2022 年 5 月就开始发售，但要让这个机器支持运行 Linux，却花费了一段不短的时间。一篇 [博客文章](https://openwebcraft.com/linux-on-thinkpad-x13s-gen-1/) 列出一些相关问题，文章副标题 “拥抱苦难” 已经透露出难度之大。这篇文章链接了一篇有关如何在该机器上安装 Debian 的 [很老的指南](https://docs.google.com/document/d/1WuxE-42ZeOkKAft5FuUk6C2fonkQ8sqNZ56ZmZ49hGI/edit#heading=h.d1689esafsky)。我们按照指南操作，尝试安装中间版的 Debian，定制内核，看起来安装成功了。


将其从 SSD 启动，着实需要巨大的努力，这涉及到进入 UEFI 固件 Shell，并手动逐个查阅 30 到 40 个条目才能找出并启用正确的 UEFI 启动条目，但经过数小时的寻找和无数次的重启，它成功工作了，Debian 能够启动。不幸的是，在启动已经安装的操作系统时，屏幕在输出几行以后就变黑了，再也没亮过。虽然操作系统还在运行，例如，按下电源键会在几秒后干净地关闭电源，但由于没有显示，甚至是文本显示也没有，我们无法配置 Wi-Fi 连接，而且该机器并没有内建的以太网接口。


![](/data/attachment/album/202309/10/094729vaji8oaedfcf5jry.jpg)


*随着最新固件和更新的支持，现在已经能在基于 Arm 的 Thinkpad 上使用 Ubuntu Lunar 的 GNOME 桌面环境。*


此外，尚有一种 “概念版” 的 Ubuntu 23.04 “Lunar Lobster”，其开发并未完成，该公司要求我们不公开相关链接。自从我们拿到这台机器以来，已经进行了多次固件更新：最初其固件版本为 1.25，如今已经更新至 1.57。在固件版本更新到 [1.49](https://download.lenovo.com/pccbbs/mobiles/n3huj12w.txt) 时，固件设置程序增加了一个处于测试阶段的 “Linux” 选项，并随着下一次更新，机器首次成功通过我们的 Ubuntu USB 启动盘启动。但引导过程极慢，开机至少需要 10-15 分钟，甚至更久，而且当它运行在<ruby> 立付 <rt>  Live </rt></ruby>系统模式下时，设备功能有显著限制：比如无法发出声音，Wi-Fi 仅支持 2.4GHz 等。尽管如此，它的运行效果尚可，足以完成安装。初次启动进入的是空白屏幕，然而，你可以切换到虚拟控制台，登录并从 Shell 提示符下更新操作系统。在更新并重启后，图形登录界面出现，此时我们可以正常登录，5GHz Wi-Fi 也开始正常工作。


在固件 1.56 更新阶段，Ubuntu 在这款硬件上仍有诸多限制：无声音，仅支持 Wayland，不支持 X.org。按照我们的惯例，我们安装时将 `/home` 挂载在独立的磁盘分区中，Ubuntu 在一个只读的主目录上启动，但这导致 Ubuntu 无法保存任何设置，也未能创建常用的文件夹（如 `~/Documents` 等）。然而，执行了一条手动的 `chown` 命令后，权限问题得以解决，`/home` 目录也得以写入。 


![](/data/attachment/album/202309/10/094729g5h6vz6oe5zep9pr.jpg)


*全面更新后，就连 X.org 也能正常运行，这意味着非 GNOME 桌面可能最终也能被成功运行。*


固件版本 1.57 出现在上个月，重新安装并更新 Ubuntu “Lunar” 后，声音和 X11 功能得以正常工作，这意味着非 Wayland 桌面现在也变得可行。尽管仍有一些困难，但是配备一个 USB-C 以太网适配器会有很大帮助，现在的 X13S 笔记本已经可以很好地运行 Ubuntu。相较于 Windows 运行下的状态，一个显著的差异在于，没有了 x86 模拟环境，只有原生的 Arm64 应用，机器的运行状况变得没那么热了。尽管底座会变热，但它可以放在白白的大腿上使用而不会烫到你。


 


![](/data/attachment/album/202309/10/094729dpa6vpzp2kk29xm4.jpg)


*甚至连声音芯片也得到了支持，我们可以播放音频并调整音量。*


### 一个（相对）更加简单的选择是——Armbian


在 Arm 笔记本上运行 Linux 的问题在于，基于 Arm 的计算机并不仅仅是一台 CPU 类型不同的 x86 个人电脑。标准的主板和芯片组以及可替换的 GPU 是相当稀有的。大部分机器都是围绕一种高度集成的 SoC 构建的，它包含了 CPU、GPU 以及所有其他组件。


在 x86 个人电脑上，操作系统可以依赖标准固件来启动计算机，但并非所有的 Arm 设备都拥有这样的固件。制造商为每种 Arm 设备打造适合运行特定操作系统的设备，替换为另一种操作系统可能非常棘手。这就是为什么树莓派计算机系列成功的原因之一：不是因为它们特别简单，它们并不是，而是因为它们的销售量大，因此得到广泛的支持。


Armbian 项目就是对这个问题的答案。它为大量的单板计算机（SBC）——主要是 Arm 架构的，正如名字暗示的那样，虽然并非只有这些——编译了特殊的内核。在 [23.08 版本](https://docs.armbian.com/Release_Changelog/#v23081-2023-09-01)（代号为 [Colobus](https://www.armbian.com/newsflash/armbian-23-8/)）的发布时，已经列出了支持的 59 个 Arm64 设备，以及 8 个 RISC-V 的板卡，还有一个 [通用的 x86-64/UEFI](https://www.armbian.com/uefi-x86/) 版本。我们在去年 3 月时点评了 [Armbian 22.02](https://www.theregister.com/2022/03/03/armbian_project_releases_version_2202/)，但我们重新回顾它，是因为这次发布包含了一个在 X13S 上的 [版本](https://www.armbian.com/lenovo-x13s/)，即使支持仍在 [持续进行](https://armbian.atlassian.net/browse/AR-1842)。


对于 x86 PC 来说，你通常从安装介质启动，然后将操作系统安装到机器的内部硬盘上。但对于 SBC 来说，更常见的是将镜像写入内存卡，然后从内存卡启动电脑，因此并无特定的安装进程。Armbian 为 X13S 提供的下载压缩后只有大约 2GB，但它包含了一个完全安装的系统，因此你至少需要一个 16GB 的 U 盘。第一次启动时，它会进入文本模式提示并要求 root 密码、用户账户的凭据，时区以及地区信息。只有在这些信息输入完毕之后，它才会加载图形桌面。


![](/data/attachment/album/202309/10/094730l3l0vnb0tkesyd33.jpg)


*Armbian 的 Cinnamon 桌面实际上是专为 Arm64 设计的 Debian 12.1，额外附加的驱动及微调使其符合 X13s 的需要。*


这套方案成功地创建了一个工作正常的系统，包括屏幕亮度调节等功能。系统重启后，我们可以连接 2.4GHz 和 5GHz 的 Wi-Fi，并以典型的 Debian 方式进行更新：使用 `sudo apt update && sudo apt full-upgrade -y` 命令。然而，系统没有声音，而且电池支持也尚未到位：不能充电，并且电量指示器不能工作。而且，我们的 Planet Computers USB-C 集线器上的以太网端口也未被检测到。我们试图使用 armbian-installer 脚本将 Armbian 安装到 SSD，但尽管 Ubuntu 找到并将其添加到 GRUB 菜单中，Armbian 仍无法从 SSD 启动。


### 总结


随着时间推移，高通 Snapdragon 8cx Gen 3 平台的 Linux 支持得到了改善。在最新版本上，Ubuntu 在 X13S（内核版本 6.2）上已经可用，我们预期，随着下个月 Ubuntu 新版的发布，这种设备可能变成一个受到支持的平台。


与此同时，一些其他的发行版也在进行支持工作。虽然 Fedora 有一个 [内核镜像](https://copr.fedorainfracloud.org/coprs/jforbes/fedora-x13s/)，但目前只是停留在这个阶段。另外，openSUSE Tumbleweed 也有一个预发布 [镜像](https://en.opensuse.org/HCL:ThinkpadX13s)，但还没有安装程序，对声音以及电池也尚无支持。


OpenBSD 可以直接支持高通芯片，但是这个操作系统的常规限制，如蓝牙的全面缺失仍然存在。我们已经验证了其可以从 USB 启动并成功配置 Wi-Fi 及 USB 以太网卡，但我们并未深入尝试，因为对于删除我们当时唯一能够完全运行的操作系统——Windows，我们持保守态度。 


![](/data/attachment/album/202309/10/094730qj0i8zlp8m8imkil.jpg)


*在 Windows 11 Arm64 上的 Ubuntu 22.04 上运行的 GNOME 网络浏览器 Epiphany*


当然，还有 <ruby> Windows 的 Linux 服务 <rt>  Windows Services for Linux </rt></ruby>（WSL）。这目前是最快捷到达可工作的 Linux 系统的途径：我们试验了在 Windows 11 下的 WSL2 中运行 Ubuntu，它工作得相当完美——且带来附加优势，你明确知道你正在运行的是原生 Arm 应用，而非在耗电的模拟环境下运行的 x86 代码。然而，要注意运行 Windows 本身并不高效，如果你在后台有一些 X86 的应用，你的电池续航会严重受影响。


如果你乐意从 U 盘启动——此处我们推荐使用一个高速 USB-C 盘——那么 Armbian 就能很轻松地帮你启动，虽然有一些限制。随着新内核支持的提升，Armbian 的功能也将随之增强。


X13S 并未准备好全面采纳任何自由和开源的操作系统——例如，网络摄像头尤其仍未得到支持——但 Ubuntu 已经差不多准备好了。目前的镜像并非官方版本，但你可以在你信任的搜索引擎上找到它。如果这个方式失败，那么 Armbian 将是你的第二选择。


*（题图：MJ/701d8523-f00b-4ac4-b559-428a9ab2746f）*




---


via: <https://www.theregister.com/2023/09/08/linux_on_the_thinkpad_x13s/> 


作者：[Liam Proven](https://www.theregister.com/Author/Liam-Proven) 译者：ChatGPT 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](/article-16174-1.html) 荣誉推出


OK
This article is more than **1 year old**

# Linux on the Arm-based Thinkpad X13S: It's getting there

## Armbian 23.08 is out, and adds preliminary support for this ultralight Snapdragon laptop

Review The latest release of Armbian helps with the non-trivial problem of installing and running an arbitrary Linux distro on Arm computers.

The Lenovo Thinkpad X13S Generation 1 which we [reviewed back in March](https://www.theregister.com/2023/03/21/lenovo_thinkpad_x13s_the_stealth/) is the first mainstream Arm-powered laptop that the Reg FOSS Desk has got to evaluate. There are other Arm-based laptops out there, such as [Pine64's Pinebook Pro](https://www.theregister.com/2022/08/02/pinebook_pro_finally_starts_shipping/) and various Arm-powered ChromeBooks, but the X13S is closer to an ordinary X86-based laptop: it has a decent spec, with 16GB of RAM, a 256GB NVMe SSD – plus PC-industry-standard UEFI firmware, which is still relatively unusual on consumer Arm computers. Better still, you can disable Secure Boot, which many Arm-powered devices don't allow. A decade ago, this [was a critical problem](https://www.theregister.com/2013/11/14/microsoft_surface_rt_stockpile/) with the original Microsoft Surface RT: Windows RT was a flop, and the firmware wouldn't let you run anything else.

Although the X13S went on sale in May 2022, it took some time for the machine to get any Linux support. This [blog post](https://openwebcraft.com/linux-on-thinkpad-x13s-gen-1/) lists some of the issues, and its subtitle "Embrace the Suck" should give you a general hint. The post points to this lengthy [how-to](https://docs.google.com/document/d/1WuxE-42ZeOkKAft5FuUk6C2fonkQ8sqNZ56ZmZ49hGI/edit#heading=h.d1689esafsky) guide for getting Debian onto the machine. We tried that, and the interim Debian build, with a custom kernel, *did* install.

Getting it to boot from SSD is an epic undertaking, involving entering a UEFI firmware shell and manually going through 30 or 40 entries to find and enable the right UEFI boot entry, but after hours of searching and countless reboots, it worked, and Debian would start. Unfortunately, when booting the installed OS, the screen blanked after just a few lines of output, never to return. The OS was running – for instance, pressing the power button led to a clean shutdown after a few seconds – but with no display, not even a text one, we couldn't configure a Wi-Fi connection, and the machine has no built-in Ethernet port.

There is also a "concept" build of Ubuntu 23.04 "Lunar Lobster", but it's unfinished and the company asked us not to share the link. Since we've had this machine, there have been multiple firmware updates: it came with version 1.25 and it's now on 1.57. Around firmware [version 1.49](https://download.lenovo.com/pccbbs/mobiles/n3huj12w.txt), the firmware setup program gained a beta "Linux" option, and with the next update, it successfully booted our Ubuntu USB key for the first time. The bootup process is extremely slow: the machine takes 10-15 minutes or more to start up, and when it's running the live system, there are significant limitations: no sound, only 2.4GHz Wi-Fi, and so on. However, it does just about work well enough to install it. The first boot goes to a blank screen, but you can switch to a virtual console, log in, and update the OS from a shell prompt. Once updated and rebooted, the graphical login screen appears, and we could log in. 5GHz Wi-Fi starts working, too.

Around the time that firmware 1.56 was current, Ubuntu still had significant limitations on this hardware: no sound, and only Wayland working – no X.org. As is our standard practice, we installed with `/home`

on a separate disk partition, and Ubuntu started with a read-only home directory, meaning that it couldn't save any settings and none of the standard directories (`~/Documents`

and so on) were created. A manual `chown`

command fixed the permissions error and made our home directory writeable.

![Fully updated, even X.org works, so non-GNOME desktops should finally be feasible too. Fully updated, even X.org works, so non-GNOME desktops should finally be feasible too.](https://regmedia.co.uk/2023/09/06/ubuntu-x13-gnome-x11.jpg?x=648&y=701&infer_y=1)

Fully updated, even X.org works, so non-GNOME desktops should finally be feasible too

Firmware version 1.57 appeared last month, and reinstalling and updating Ubuntu "Lunar" yielded working sound and X11, so non-Wayland desktops are now feasible. It's still not easy, and a USB-C Ethernet adaptor is a useful thing to have around, but the X13S is now usable as an Ubuntu laptop. A noticeable difference from running under Windows is that, with no x86 emulation and only native Arm64 apps, the machine runs cooler. Although its base does become warm, it's usable on bare legs without discomfort.

![Even the sound chip is supported, and we were able to play audio and adjust the volume. Even the sound chip is supported, and we were able to play audio and adjust the volume.](https://regmedia.co.uk/2023/09/06/ubuntu-x13-sound.jpg?x=648&y=517&infer_y=1)

Even the sound chip is supported, and we were able to play audio and adjust the volume

### A (somewhat) easier option: Armbian

The problem with Linux on an Arm laptop is that Arm-powered computers are *not* just x86 PCs with a different kind of CPU. Standard motherboards and chipsets, and interchangeable GPUs, are rare. Most machines are based around a highly-integrated System-on-a-Chip, containing CPU, GPU, and all the other components.

On an x86 PC, the OS can rely on the presence of standard firmware to start the computer, but not all Arm kit has that. Manufacturers build each Arm device to run one specific OS, and replacing that OS with a different one can be a very tricky thing to do. This is one of the reasons for the success of the Raspberry Pi line of computers: not because they are especially simple machines – they aren't – but simply because they have sold in such large quantities that they're widely supported.

The Armbian project is a response to this. It builds specially-configured kernels tailored for a wide variety of single-board computers (SBCs) – mostly Arm based ones, as the name implies, but not exclusively. As of the [23.08 release](https://docs.armbian.com/Release_Changelog/#v23081-2023-09-01), codenamed [Colobus](https://www.armbian.com/newsflash/armbian-23-8/), it lists 59 Arm64 devices supported, but also eight RISC-V boards – and a generic [x86-64/UEFI version](https://www.armbian.com/uefi-x86/). We [looked at Armbian 22.02](https://www.theregister.com/2022/03/03/armbian_project_releases_version_2202/) in March last year, but we are revisiting it because this release includes a [version](https://www.armbian.com/lenovo-x13s/) for the X13S – although the support is still [work-in-progress](https://armbian.atlassian.net/browse/AR-1842).

With an x86 PC, you generally boot from an installation medium and then install the OS onto the machine's internal drive. With an SBC, though, it's more common to write the image onto a memory card, then boot the computer from the card; there's no installation process as such. The Armbian download for the X13S is only some 2GB compressed, but it contains a complete installed system, so you'll need at least a 16GB USB key. On the first boot, it drops to a text-mode prompt, and asks for a root password, some credentials for a user account, timezone and locale information. Only then does it load the graphical desktop.

The result was a working system, with screen brightness controls and so on. After a reboot, we could connect to Wi-Fi – both 2.4GHz and 5GHz – and run an update in the usual Debian way: `sudo apt update && sudo apt full-upgrade -y`

. However, there was no sound, and battery support isn't there yet: it doesn't charge, and the indicator doesn't work. It also didn't detect the Ethernet port on our Planet Computers USB-C hub. We tried installing Armbian to the SSD using the `armbian-installer`

script, but although Ubuntu found the resulting OS and added it to its GRUB menu, Armbian wouldn't boot from the SSD.

### Summing up

Linux support for the Qualcomm Snapdragon 8cx Gen 3 is visibly improving with time. As of the latest updates, Ubuntu on the X13S is usable with kernel 6.2, and we suspect the machine *might* become a supported platform when the next release of Ubuntu appears next month.

Some of the other distros are working on support, as well. There's a [kernel image](https://copr.fedorainfracloud.org/coprs/jforbes/fedora-x13s/) for Fedora, but so far, that's about it. There's also a pre-release [image](https://en.opensuse.org/HCL:ThinkpadX13s) for openSUSE Tumbleweed, but there's no installer, and no support for sound or battery yet.

[Had enough of Android? First 'Focal' based Ubuntu Touch is out](https://www.theregister.com/2023/03/29/first_focal_based_ubuntu_touch/)[Not all vendors' Arm-powered kit is created equally, benchmark fan finds](https://www.theregister.com/2022/12/06/arm64_laptops/)[Juno offering Linux-powered tablet PC for pre-order](https://www.theregister.com/2022/10/17/juno_tablet/)[End-of-life smartphone? Penguins at postmarketOS aim to revive it](https://www.theregister.com/2022/06/15/postmarketos_2206/)

OpenBSD directly supports the Qualcomm chip, with the usual caveats around that OS – such as no Bluetooth support whatsoever. We've verified that it can boot from USB and configure both Wi-Fi and USB Ethernet successfully, but so far, not much more, as we were nervous about removing Windows, the only completely-working OS on the machine at the time.

And, of course, there's Windows Subsystem for Linux. That's currently the easiest route to a working Linux system: we tried Ubuntu in WSL2 under Windows 11, and it works perfectly fine – with the added benefit that you know you're running native Arm apps, not x86 code under power-sapping emulation. However, running under Windows isn't very efficient, and if you have some X86 stuff in the background, it will badly impact battery life.

If you're content to run from a USB key – we suggest a fast USB-C one – then Armbian will get you up and running easily, with some limitations. As support in newer kernels improves, then so will Armbian's functionality.

The X13S is not yet ready for prime time with any FOSS OS – notably, the webcam remains unsupported – but Ubuntu is very nearly there. The image isn't official yet, but your preferred search engine will find it. Failing that, Armbian is close behind. ®

41