<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Sipeed · Jared Lynskey</title>
    <link>https://jared.lynskey.co.nz/en/tags/sipeed/</link>
    <description>Short stories of value on software engineering and engineering leadership — performance reviews, hiring and scaling teams, CI/CD, DevOps monitoring and agentic AI. Written from Seoul.</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>© 2026 Jared Lynskey</copyright>
    <lastBuildDate>Mon, 30 Nov 2026 14:00:00 +1300</lastBuildDate>
    <atom:link href="https://jared.lynskey.co.nz/en/tags/sipeed/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Axera Chips Explained: AX630C, AX8850, AX8860, and How Open They Are</title>
      <link>https://jared.lynskey.co.nz/en/posts/2026/axera-chips-ax630c-ax8850-ax8860/</link>
      <guid isPermaLink="true">https://jared.lynskey.co.nz/en/posts/2026/axera-chips-ax630c-ax8850-ax8860/</guid>
      <pubDate>Mon, 30 Nov 2026 14:00:00 +1300</pubDate>
      <dc:creator>Jared Lynskey</dc:creator>
      <category>Axera</category>
      <category>NPU</category>
      <category>Edge AI</category>
      <category>On-Device AI</category>
      <category>LLM</category>
      <category>Embedded</category>
      <category>Linux</category>
      <category>Sipeed</category>
      <category>NanoKVM</category>
      <category>Open Source</category>
      <description>Axera&#39;s chip lineup from someone who rebuilt the software on one: what the AX630C, AX8850 and new AX8860 are for, what runs on them, and how open each is.</description>
      <content:encoded><![CDATA[<p>My NanoKVM Pro runs on an Axera AX630C. After a weekend replacing every piece of software on it, from the boot chain up (<a href="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/" >the whole story is here</a>), I wanted to know what else Axera makes, which of it you can actually buy, and how much of each chip you could own the way I now own that one.</p>
<p>The answers were scattered across Chinese product pages, model cards on Hugging Face, vendor wikis and a kernel mailing list, so this is the tidied-up version. Specs come from Axera&rsquo;s own pages unless I say otherwise, and speed figures are always someone&rsquo;s published benchmark, not mine.</p>

<h2 class="relative group">Who Axera is
    <div id="who-axera-is" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#who-axera-is" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Axera (爱芯元智 in Chinese) is a fabless chip company founded in 2019 by Qiu Xiaoxin, previously CTO of Unisoc. It listed on the Hong Kong stock exchange in February 2026. It sells into three markets: vision chips for cameras, chips for cars, and what it calls edge AI inference.</p>
<p>What most of its chips share is an NPU of Axera&rsquo;s own design, which it calls a &ldquo;mixed-precision&rdquo; NPU (Neutron in the toolchain docs), plus a model toolchain called Pulsar2. The vision chips also carry an AI image signal processor that Axera sells on low-light camera quality.</p>

<h2 class="relative group">The lineup at a glance
    <div id="the-lineup-at-a-glance" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-lineup-at-a-glance" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>These are the chips you&rsquo;ll find on boards a person can buy, plus the one that&rsquo;s just been announced.</p>
<table>
	<thead>
			<tr>
					<th>Chip</th>
					<th>Launched</th>
					<th>CPU</th>
					<th>NPU, INT8 (Axera&rsquo;s figure)</th>
					<th>Where you&rsquo;ll find it</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>AX620A</td>
					<td>2021</td>
					<td>4× Cortex-A7</td>
					<td>3.6 TOPS</td>
					<td>Sipeed Maix-III AXera-Pi</td>
			</tr>
			<tr>
					<td>AX630C</td>
					<td>2023</td>
					<td>2× Cortex-A53, 1.2 GHz</td>
					<td>3.2 TOPS</td>
					<td>Sipeed NanoKVM Pro and MaixCAM2, M5Stack Module LLM and LLM630 Compute Kit</td>
			</tr>
			<tr>
					<td>AX650N</td>
					<td>2023</td>
					<td>8× Cortex-A55</td>
					<td>10.8 TOPS at launch, 18 TOPS now</td>
					<td>Sipeed M4N-Dock and Maix4-HAT</td>
			</tr>
			<tr>
					<td>AX8850</td>
					<td>2025</td>
					<td>8× Cortex-A55</td>
					<td>24 TOPS</td>
					<td>M5Stack LLM-8850 card and AI Pyramid, Radxa AX-M1</td>
			</tr>
			<tr>
					<td>AX8860</td>
					<td>October 2026</td>
					<td>16× Cortex-A55, 1.65 GHz</td>
					<td>&ldquo;256 TOPS equivalent&rdquo;</td>
					<td>Nothing on sale yet</td>
			</tr>
	</tbody>
</table>
<p>One thing to know before comparing numbers: Axera usually leads with INT4 figures, which are four times the INT8 ones. The AX630C is &ldquo;12.8 TOPS&rdquo; on the box and 3.2 TOPS at INT8. I&rsquo;ve put INT8 everywhere so the rows compare.</p>

<h2 class="relative group">AX630C: the one I know
    <div id="ax630c-the-one-i-know" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#ax630c-the-one-i-know" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The AX630C has two Cortex-A53 cores at 1.2 GHz, a 3.2 TOPS NPU, a 4K30 image signal processor and a hardware H.264/H.265 encoder that does 4K30 plus two smaller streams at once. In the SDK it&rsquo;s one member of a family Axera calls AX620E, with siblings that use the same NPU generation: the AX620Q (2.4 TOPS), the AX620QE, and the AX631 (1.5 GHz, 4.0 TOPS). If you see one of those on a cheaper board, it&rsquo;s the same platform with different clocks and NPU ratings.</p>
<p>On my NanoKVM Pro, which has 1 GB of memory, the part that earns its keep is the video encoder. It turns the HDMI input into the H.264 or H.265 stream my browser watches, at 4K or 1080p. The NPU sits idle, because nothing I run needs it.</p>
<p>Other people build around the NPU. M5Stack&rsquo;s Module LLM ($49.90 at launch) and LLM630 Compute Kit ($69.90) are sold for running small models offline, and Axera publishes ports for this chip. Its model cards give these figures:</p>
<ul>
<li>MiniCPM4-0.5B at about 12 tokens a second, and SmolVLM-256M at about 31;</li>
<li>Whisper Base at a real-time factor of 0.35, so roughly three times faster than speech;</li>
<li>YOLO11n at 113 frames a second at 640×640 (from Sipeed&rsquo;s MaixCAM2 page).</li>
</ul>
<p>That&rsquo;s the honest size of it: a sub-billion-parameter language model, speech recognition, or real-time object detection, on a chip that also runs a 4K camera and costs very little.</p>

<h2 class="relative group">AX650N and AX8850: one chip, several names
    <div id="ax650n-and-ax8850-one-chip-several-names" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#ax650n-and-ax8850-one-chip-several-names" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The AX650N launched in March 2023 with eight Cortex-A55 cores, an 8K30 image signal processor, decoding for 32 streams of 1080p, and an NPU rated 43.2 TOPS INT4, or 10.8 TOPS INT8. In May 2025 Axera launched the AX8850 for consumer electronics: also eight A55s, 24 TOPS INT8, no image signal processor listed. The AX650N no longer has a page on Axera&rsquo;s site, and the page for a third name, AX8850N, carries the AX650N&rsquo;s old description with 72 TOPS INT4 and 18 TOPS INT8. Sipeed now quotes the AX650N at 72/18 too. A <a href="https://habr.com/ru/articles/1035776/"  target="_blank" rel="noreferrer">hands-on review on Habr</a> argues 72/18 adds up several units on the chip and the NPU alone is still 43.2/10.8.</p>
<p>Axera never says these are the same silicon, but everything in the software says they are. Pulsar2 compiles AX650A, AX650N and AX8850 as a single target. Radxa&rsquo;s AX8850 card reports itself as an AX650N in Axera&rsquo;s status tool, and Axera&rsquo;s driver code knows the chip types AX650A, AX650N, AX650C and AX750. For software purposes they&rsquo;re one chip. I&rsquo;d treat the different TOPS figures as marketing until someone runs the same model on each.</p>
<p>Most of the boards are accelerators for another computer:</p>
<ul>
<li>the <a href="https://docs.m5stack.com/en/ai_hardware/LLM-8850_Card"  target="_blank" rel="noreferrer">M5Stack LLM-8850 card</a>: M.2 2242, 8 GB, 7 W, $99, aimed at the Raspberry Pi 5;</li>
<li>the <a href="https://docs.radxa.com/en/aicore/ax-m1"  target="_blank" rel="noreferrer">Radxa AICore AX-M1</a>: M.2 2280, up to 8 W;</li>
<li>Sipeed&rsquo;s Maix4-HAT for the Raspberry Pi 5, and the M4N-Dock board.</li>
</ul>
<p>M5Stack&rsquo;s AI Pyramid is the exception, a small Linux computer built on the AX8850: $199 with 4 GB, or $249 for the 8 GB AI Pyramid Pro.</p>
<p>Published speeds for this tier: Axera&rsquo;s Qwen3 ports run 0.6B, 1.7B and 4B models at 16.9, 8.6 and 4.0 tokens a second. Radxa&rsquo;s benchmarks on the AX-M1 give Qwen2.5-0.5B at 28 tokens a second, Whisper Small at a real-time factor of 0.18 and YOLO11s at 305 frames a second. So a 1.7B model runs at about reading speed on a card that plugs into a Raspberry Pi.</p>

<h2 class="relative group">AX8860 and AX8860P: the new big one
    <div id="ax8860-and-ax8860p-the-new-big-one" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#ax8860-and-ax8860p-the-new-big-one" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Axera launched the AX8860 at the China International Industry Fair on 13 October 2026. It&rsquo;s a 6 nm chip with 16 Cortex-A55 cores and an NPU rated &ldquo;256 TOPS&rdquo;, with an asterisk that says equivalent TOPS. The NPU lists low-precision floating-point formats alongside integers: FP4, FP8, FP16 and BF16. The <a href="https://www.axera-tech.com/en/product/3294.html"  target="_blank" rel="noreferrer">AX8860</a> takes up to 64 GB of LPDDR5 or LPDDR5X at 136 GB/s. The AX8860P doubles the memory bus, takes up to 128 GB at 273 GB/s, and two or four of them can be linked together.</p>
<p>The software changes with it. There&rsquo;s no Pulsar2 compile step for language models any more: the AX8860 runs llama.cpp, through an Axera backend, and SGLang. Axera&rsquo;s model card for Qwen3.5-35B-A3B, a mixture-of-experts model, gives 78 tokens a second in a 4-bit format, and 97 with speculative decoding. Sipeed has announced a MaixStation built on the AX8860P, estimated at under $2,000 with 32 GB and under $4,000 with 128 GB, and says it beats NVIDIA&rsquo;s DGX Spark on a 27B Qwen model. <a href="https://www.cnx-software.com/2026/10/19/axera-ax8860p-16-core-cortex-a55-soc-takes-on-nvidia-dgx-spark-at-fraction-of-the-cost/"  target="_blank" rel="noreferrer">CNX Software&rsquo;s write-up</a> has the details.</p>
<p>Those are vendor numbers for a product nobody can buy yet. If they hold up, this is the most interesting thing Axera makes for people like me: a box that runs a 30B-class model at home without a GPU. I&rsquo;ll believe it when there are independent benchmarks.</p>

<h2 class="relative group">Everything else
    <div id="everything-else" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#everything-else" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The rest of the range is chips you&rsquo;ll own without knowing it. The AX615, AX520 and AX513 have one or two Cortex-A7 cores and between half a TOPS and two, and go into IP cameras and doorbells. The AX8910 is a machine-vision part with four A55s and a real-time core. The AX637 shows up in Pulsar2 and in Axera&rsquo;s model zoo (Qwen3-0.6B at 6.5 to 8.1 tokens a second on its development board) but has no product page yet.</p>
<p>Then there are cars. The M55H, M57 and M76H cover driver-assistance cameras up to 60 TOPS, and the M9 series announced in September 2026 goes much bigger: the M97 has 16 Cortex-A78AE cores and 720 TOPS (equivalent) on 5 nm. Axera says it had shipped 1.6 million car chips by August 2026. None of these are on boards you can buy.</p>

<h2 class="relative group">How open is each one?
    <div id="how-open-is-each-one" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#how-open-is-each-one" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>This is the part a spec sheet won&rsquo;t tell you, and the reason I could do what I did with my KVM.</p>
<p>What Axera publishes is better than I expected:</p>
<ul>
<li><strong>Pulsar2</strong>, the toolchain that converts and quantises ONNX models for the NPU, is a free download from <a href="https://huggingface.co/AXERA-TECH"  target="_blank" rel="noreferrer">Axera&rsquo;s Hugging Face organisation</a> with no registration. It&rsquo;s binary only: a Docker image of about 3.8 GB.</li>
<li><strong>Runtimes and examples</strong> are on <a href="https://github.com/AXERA-TECH"  target="_blank" rel="noreferrer">GitHub</a> under a BSD licence, including <a href="https://github.com/AXERA-TECH/ax-llm"  target="_blank" rel="noreferrer">ax-llm</a>, which serves ported models behind an OpenAI-compatible API. Hundreds of ported models sit on Hugging Face.</li>
<li><strong>Full SDK releases and datasheets</strong> appeared in 2026 as &ldquo;community hub&rdquo; repositories on Hugging Face, for the AX620E family (the <a href="https://huggingface.co/AXERA-TECH/AX620E-Community-Hub"  target="_blank" rel="noreferrer">AX620E hub</a>), the AX650 and the AX637. The AX630C datasheet runs to 228 pages in English and Chinese. It has no register maps for the NPU, the encoder or the image signal processor, though, and most of the SDK guides are Chinese only.</li>
</ul>
<p>What stays closed is the part that makes the chip special. The NPU runtime and the media and image libraries are prebuilt <code>.so</code> files. The kernel drivers for the NPU, video codec and image signal processor are prebuilt modules for exactly one kernel: 4.19.125 for the AX620E family, which went out of support in December 2024, and 5.15.73 for the AX650. There&rsquo;s also a firmware blob for the chip&rsquo;s crypto engine, which the stock boot loader carries.</p>
<p>Mainline Linux has nothing for any of them. No patch for the AX620E family has ever been posted. For the AX650, an Axera engineer posted a six-patch skeleton in August 2026, its device tree bindings were sent back for changes in September, and there&rsquo;s been no new version since.</p>
<p>For the AX620E family the community has filled most of the gap:</p>
<ul>
<li><a href="https://github.com/onekvm/linux-6.18-ax620e"  target="_blank" rel="noreferrer">OneKVM</a> runs Linux 6.18 with open drivers for HDMI capture, the hardware encoder and the NPU. They say the NPU driver was written from observed hardware behaviour and contains no vendor code. My KVM runs on their work, ported to 7.3.</li>
<li><a href="https://github.com/GoogleBot42/open-nanokvm-pro"  target="_blank" rel="noreferrer">open-nanokvm-pro</a> runs Linux 7.1 with a current TF-A and U-Boot, and builds the first-stage loader without the crypto blob.</li>
<li><a href="https://github.com/cocoa-xu/axera_npu"  target="_blank" rel="noreferrer">axera_npu</a> is a GPL NPU driver plus an Apache-licensed runtime that runs Pulsar2&rsquo;s compiled models with no vendor libraries at all. It&rsquo;s early: it handles only models that run entirely on the NPU.</li>
</ul>
<p>And secure boot? The first-stage loader can check images against a key hash burnt into the chip, but Sipeed&rsquo;s public SDK includes a development signing key. On my unit, images signed with that key boot fine, so whatever the fuses say, secure boot doesn&rsquo;t stand between an owner and their own firmware.</p>
<p>Put together, by chip:</p>
<ul>
<li><strong>AX630C and the AX620E family</strong> are the most open. The boot chain source is public, community kernels run up to 7.3, and the encoder and NPU have open drivers. You can own the whole stack, and I do.</li>
<li><strong>AX650N and AX8850</strong> are mostly closed below the application layer: a 5.15 vendor kernel, prebuilt drivers, a mainline skeleton stuck in review. As a PCIe card you&rsquo;ll install Axera&rsquo;s host driver and runtime and use it like any other accelerator.</li>
<li><strong>AX8860</strong> is too new to say. llama.cpp itself is open, but how open the kernel and drivers underneath will be, nobody can tell yet.</li>
</ul>

<h2 class="relative group">Which one I&rsquo;d pick
    <div id="which-one-id-pick" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#which-one-id-pick" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>For a KVM, a camera, or anything else you want to own from the boot loader up, an AX630C board like the NanoKVM Pro or MaixCAM2. The community work is real, and it&rsquo;s the only Axera platform where you can rebuild every layer.</p>
<p>For small local models next to a Raspberry Pi 5, an AX8850 card like the LLM-8850 or the AX-M1. You&rsquo;ll be running Axera&rsquo;s closed runtime, but for an accelerator that&rsquo;s normal.</p>
<p>For 30B-class models at home, I&rsquo;d wait for AX8860 boards to ship and for someone other than the vendors to benchmark them.</p>
]]></content:encoded>
      <media:content url="https://jared.lynskey.co.nz/en/posts/2026/axera-chips-ax630c-ax8850-ax8860/featured.jpg" medium="image" type="image/jpeg" />
    </item>
    <item>
      <title>Sipeed NanoKVM Pro: My Own Firmware, Rust Services and Passkeys</title>
      <link>https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/</link>
      <guid isPermaLink="true">https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/</guid>
      <pubDate>Mon, 30 Nov 2026 12:00:00 +1300</pubDate>
      <dc:creator>Jared Lynskey</dc:creator>
      <category>NanoKVM</category>
      <category>Sipeed</category>
      <category>Rust</category>
      <category>Linux</category>
      <category>Embedded</category>
      <category>Firmware</category>
      <category>U-Boot</category>
      <category>Reverse Engineering</category>
      <category>Passkeys</category>
      <category>WebAuthn</category>
      <category>Tailscale</category>
      <category>Self-Hosting</category>
      <category>Homelab</category>
      <category>Security</category>
      <category>Claude Code</category>
      <description>How I replaced every layer of Sipeed&#39;s software on my NanoKVM Pro: the boot chain rebuilt from source, Linux 7.3, Rust services, and passkey sign-in.</description>
      <content:encoded><![CDATA[<p>A KVM over IP is a small computer that sits next to a bigger one and puts its screen, keyboard and mouse in a browser tab. Mine is a Sipeed NanoKVM Pro. It has an <a href="https://jared.lynskey.co.nz/en/posts/2026/axera-chips-ax630c-ax8850-ax8860/" >Axera AX630C</a> chip, an HDMI capture bridge, a small LCD with a knob, and Wi-Fi, and I reach it over Tailscale. Whoever controls it can do anything that computer&rsquo;s own keyboard can, BIOS included. That&rsquo;s a lot of trust to hand to software I can&rsquo;t read.</p>
<p><figure><span class="mc-img" style="--lqip:url('data:image/webp;base64,UklGRpAAAABXRUJQVlA4IIQAAAAQBQCdASogABEAPw1mpkemIqGYBABjEMTgC3uCdEZYSrUuRxGCe1LJl85dDzAXVdYAAP6tNGdTcIVzaZnsTR3hhXgAbIeQ6W7Ppvlsy4iX8i2Pn4Mjf4L/zcrwb8CqY86MlK1zTUDadl0sbmFgZ5Up/wnWaAWViiMO6Gk8o5DmomYAAAA=')"><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="The Sipeed NanoKVM Pro on a desk: a small black box with a colour LCD showing the time, a CPU gauge, the HDMI input at 1920×1080 60Hz and the stream state, a knurled knob with a red ring, and &lsquo;KVM Pro&rsquo; printed on the front; the address and name on the screen are blurred"
    width="1690"
    height="888"
    src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/device-front_hu_25ca756e50b57cd0.webp"
    srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/device-front_hu_25ca756e50b57cd0.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/device-front_hu_d411ec94ba7cd472.webp 1280w"
    sizes="(min-width: 768px) 50vw, 65vw"
    data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/device-front_hu_5820a7abe2be7a4b.webp"></span><figcaption>My NanoKVM Pro, running everything in this post. The screen is my Rust LCD app (address and name blurred).</figcaption></figure>
</p>
<p>So I replaced it. Every layer that runs on the device in normal use is now built from source by me: the boot chain, the Linux kernel, the operating system, and every service, rewritten in Rust. Sipeed&rsquo;s software is still on the eMMC, but only as a fallback that boots if mine ever fails to load. The latest step, and how this post started, was signing in with passkeys and turning the password off.</p>
<p>This is the whole process, in the order I did it: what I found, what broke, and what I&rsquo;d tell anyone thinking about doing the same to theirs.</p>

<h2 class="relative group">What came in the box
    <div id="what-came-in-the-box" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-came-in-the-box" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Out of the box the NanoKVM Pro runs Ubuntu 22.04 on Axera&rsquo;s Linux 4.19.125, a kernel that went end of life years ago. Sipeed&rsquo;s software on top is a mix of open and closed parts:</p>
<ul>
<li>Closed: the video library that grabs and encodes the HDMI picture, the app that drives the LCD, Axera&rsquo;s media drivers (built for 4.19 only), a firmware blob for the chip&rsquo;s crypto engine, and OP-TEE, a &ldquo;trusted OS&rdquo; running beside Linux.</li>
<li>Talking to the outside world: app and firmware updates come from Sipeed&rsquo;s CDN, and the firmware I had shipped an AI &ldquo;computer use&rdquo; agent wired to Alibaba&rsquo;s DashScope service.</li>
</ul>
<p>None of that is unusual for a cheap embedded device. But I wanted two things: nothing on it I can&rsquo;t build from source, and nothing leaving it that I didn&rsquo;t ask for.</p>

<h2 class="relative group">Rules before touching anything
    <div id="rules-before-touching-anything" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#rules-before-touching-anything" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>A KVM you&rsquo;ve bricked is a paperweight next to a computer you can no longer reach. So before changing anything I set some rules, and kept them the whole way:</p>
<ol>
<li><strong>Slot B stays Sipeed&rsquo;s.</strong> The NanoKVM Pro has two copies of everything after the first boot stage, slot A and slot B. The first-stage loader (the SPL) arms a watchdog while it loads a slot, and if loading fails the chip resets and tries the other slot. As long as slot B is untouched stock firmware, a broken slot A heals itself in about two minutes.</li>
<li><strong>Try in RAM first.</strong> Until the last few steps, every new kernel ran as a temporary session: started from the stock system with kexec, root filesystem in a RAM overlay, eMMC untouched, and any reset going back to stock.</li>
<li><strong>A full backup and a way back over USB.</strong> I copied all fifteen boot partitions off the device and checked them against on-device checksums. Then I proved the chip&rsquo;s USB download mode works: hold the User button for ten seconds at power-on, and an open-source flasher (<a href="https://github.com/ciniml/axdl-rs"  target="_blank" rel="noreferrer">axdl-rs</a>) can write it from a Mac. I tested that with nothing written, before I needed it.</li>
<li><strong>A new boot has to confirm itself.</strong> About 75 seconds after boot, once the web server and network are up, the system marks its slot as good. A boot that never gets there falls back to slot B on the next warm reset.</li>
</ol>

<h2 class="relative group">Day zero: lock the doors
    <div id="day-zero-lock-the-doors" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#day-zero-lock-the-doors" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Before any rebuilding, I stopped the device talking to anything I hadn&rsquo;t approved. An outbound allowlist firewall lets through Tailscale, the local network, DNS and NTP, and drops everything else. A DNS blackhole makes Sipeed&rsquo;s update hosts and DashScope resolve to addresses with unreachable routes, so the apps fail fast instead of hanging. I removed the computer-use agent and masked its service. That first version was a shell script. It&rsquo;s now a subcommand of my Rust device tool, <code>kvm-l3 egress</code>, and still one of the first things that starts at boot.</p>

<h2 class="relative group">A modern kernel: Linux 6.18, then 7.3
    <div id="a-modern-kernel-linux-618-then-73" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#a-modern-kernel-linux-618-then-73" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Neither Sipeed nor Axera has anything newer than 4.19 for this chip, and mainline Linux has no AX630C support. Two community projects do: <a href="https://github.com/GoogleBot42/open-nanokvm-pro"  target="_blank" rel="noreferrer">open-nanokvm-pro</a>, which runs this board on Linux 7.1, and <a href="https://github.com/onekvm/linux-6.18-ax620e"  target="_blank" rel="noreferrer">OneKVM</a>, whose 6.18 tree supports the HDMI bridge my unit has. I started from OneKVM&rsquo;s tree.</p>
<p>OneKVM&rsquo;s kernel is upstream 6.18.57 plus their AX630C changes: 136 files, about 30,500 added lines. I didn&rsquo;t want my kernel to be &ldquo;whatever was in someone&rsquo;s branch&rdquo;, so I replayed their changes onto Greg Kroah-Hartman&rsquo;s signed stable tag, verified with <code>gpgv</code> against his published key. Moving to a new stable release is now a fetch, a signature check and a cherry-pick. Most of this post happened on 6.18.65. Since then I&rsquo;ve ported the same changes up to Linux 7.3, where a few kernel interfaces under OneKVM&rsquo;s drivers had moved (clocks, video buffers, Ethernet, I²C and Wi-Fi), and the device now runs 7.3.6. The 6.18 trees stay in the build, so going back is a checkout and a rebuild.</p>
<p>The kernel config is mine too:</p>
<ul>
<li>Lockdown in integrity mode, and <code>/dev/mem</code> closed.</li>
<li>Module signing enforced, with a fresh key per build. Axera&rsquo;s closed modules and anything unsigned are refused.</li>
<li>Wi-Fi from an open driver for the AIC8800 chip. Its firmware is the one closed piece left, along with the chip&rsquo;s boot ROM.</li>
<li>HDMI audio, which turned out to be only a config change. The driver was already in OneKVM&rsquo;s tree.</li>
</ul>
<p>A few things only showed up on hardware. The stock boot arms two watchdogs and Linux 6.18 only knows about one, so the early init stops the second before it bites. OneKVM&rsquo;s out-of-tree media drivers must be rebuilt after every config change, or a stale struct layout crashes the boot. And a kernel with a built-in initramfs has no <code>/dev/console</code>, so my Rust init died on its very first boot, before printing anything, for lack of somewhere to print.</p>

<h2 class="relative group">A small Debian and a state store
    <div id="a-small-debian-and-a-state-store" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#a-small-debian-and-a-state-store" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The root filesystem is now Debian 12, built from scratch by a script: a minimal debootstrap plus 27 packages, packed as a 56 MB read-only squashfs. At boot it gets a RAM overlay, so the running system can write anywhere and nothing sticks. What makes a unit itself lives in a separate 32 MB state store that&rsquo;s bind-mounted into place: Wi-Fi networks, Tailscale identity, SSH host keys and the web login. On a new unit, the first boot copies that identity across from the stock system, on the device, so no secret ever leaves it.</p>
<p>Tailscale is built from source too, trimmed to the features the KVM uses. It comes back later in this story.</p>

<h2 class="relative group">Rewriting it in Rust, service by service
    <div id="rewriting-it-in-rust-service-by-service" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#rewriting-it-in-rust-service-by-service" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>With my own kernel and OS underneath, the remaining Sipeed code was the services. The goal was to minimise Sipeed&rsquo;s code, not to make anything faster, so I went in order of how much each step removed and checked every service on the device before starting the next.</p>
<ul>
<li><strong>Video library.</strong> I rewrote the closed library that captures HDMI and drives the hardware H.264/H.265 encoder as a Rust crate with the same C interface. It now rides out resolution changes: switching the source between 4K and 1080p used to kill the browser stream, and now costs nothing. Software MJPEG got about 30% faster on libjpeg-turbo 3.</li>
<li><strong>LCD app.</strong> The front screen with its knob and touch panel was a closed app. The Rust one draws its own pages, uses 3.7% CPU instead of 12%, and 4.9 MB of memory instead of 20.5 MB.</li>
<li><strong>Web server.</strong> Sipeed&rsquo;s Go server had 141 API routes. The Rust one (axum and rustls) implements all of them natively.
<ul>
<li>Video to the browser goes out as MJPEG, as H.264/H.265 over a WebSocket into WebCodecs, or over WebRTC with webrtc-rs.</li>
<li>HDMI audio is encoded to Opus.</li>
<li>WebRTC tuning: a playout-delay header extension took the browser&rsquo;s jitter buffer from 30 to 78 ms down to 2 to 5 ms. Google&rsquo;s congestion control looked fine in tests, but on my real phone it pinned the bitrate at its floor, so I replaced it with simple loss-based control.</li>
</ul>
</li>
<li><strong>Device tool.</strong> <code>kvm-l3</code> replaced a pile of shell and Python. It covers the USB gadget the host computer sees as a keyboard and mouse, the firewall, slot selection, the boot confirmation, and (as you&rsquo;ll see below) certificates.</li>
<li><strong>Init.</strong> The initramfs <code>/init</code> is a static Rust binary. It mounts the boot partition, sets up the root image and its overlay, copies the payload over it, mounts the state store and hands over to systemd. On its first real boot it handed over 7.3 seconds after the kernel started.</li>
<li><strong>Browser UI.</strong> Sipeed&rsquo;s React app was replaced by one written in Rust with Leptos and compiled to WebAssembly: a &ldquo;Liquid Glass&rdquo; look, a touch mode for phones, and an on-screen keyboard.</li>
</ul>

<h2 class="relative group">The boot chain: rebuilt from source
    <div id="the-boot-chain-rebuilt-from-source" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-boot-chain-rebuilt-from-source" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>That left the code that runs before Linux. I&rsquo;d assumed the boot chain was a closed blob and left it alone. Then I found that Sipeed publishes the whole SDK for this chip, <a href="https://github.com/sipeed/maix_ax620e_sdk"  target="_blank" rel="noreferrer">maix_ax620e_sdk</a>, with the source of the SPL, ARM Trusted Firmware 2.7, OP-TEE and U-Boot 2020.04.</p>
<figure class="diagram">
  <div role="img" aria-label="Diagram: the chip&#39;s boot ROM loads the SPL, now mine, which initialises memory and picks slot A or B without loading OP-TEE. Slot A, mine: ATF 2.7 without OP-TEE, U-Boot 2020.04 with my logo, Linux 7.3, kvm-init in Rust, then Debian 12 and the Rust services. Slot B, Sipeed&#39;s and only a fallback: stock ATF with OP-TEE, stock U-Boot, Linux 4.19, Ubuntu 22.04 with Sipeed&#39;s apps. A slot that fails to load resets the chip and the SPL boots the other one."><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 760" aria-hidden="true" focusable="false">
<defs><marker id="bc-ah" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="d-head" d="M0,0 L10,5 L0,10 z"/></marker></defs>
<rect class="d-box" x="490" y="20" width="300" height="74" rx="12"/>
<text class="d-label" x="640.0" y="53" text-anchor="middle" font-size="21">Boot ROM</text>
<text class="d-sub" x="640.0" y="79" text-anchor="middle" font-size="16">in the chip (Axera)</text>
<path class="d-line" d="M640,94 L640,128" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="390" y="130" width="500" height="80" rx="12"/>
<text class="d-label d-mono" x="640.0" y="166" text-anchor="middle" font-size="24">SPL</text>
<text class="d-sub" x="640.0" y="192" text-anchor="middle" font-size="16">mine: DDR, picks slot A or B, no OP-TEE</text>
<rect class="d-panel" x="60" y="250" width="520" height="440" rx="26"/>
<text class="d-title" x="320" y="290" text-anchor="middle" font-size="24">Slot A: mine</text>
<rect class="d-group" x="700" y="250" width="520" height="440" rx="26"/>
<text class="d-title" x="960" y="290" text-anchor="middle" font-size="24">Slot B: Sipeed's, fallback only</text>
<path class="d-line" d="M560,210 L340,248" marker-end="url(#bc-ah)"/>
<path class="d-line" d="M720,210 L940,248" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="110" y="310" width="420" height="52" rx="12"/>
<text class="d-label" x="320.0" y="343" text-anchor="middle" font-size="19">ATF 2.7, no OP-TEE</text>
<rect class="d-box" x="110" y="380" width="420" height="52" rx="12"/>
<text class="d-label" x="320.0" y="413" text-anchor="middle" font-size="19">U-Boot 2020.04, my logo</text>
<path class="d-line" d="M320,362 L320,378" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="110" y="450" width="420" height="52" rx="12"/>
<text class="d-label" x="320.0" y="483" text-anchor="middle" font-size="19">Linux 7.3</text>
<path class="d-line" d="M320,432 L320,448" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="110" y="520" width="420" height="52" rx="12"/>
<text class="d-label" x="320.0" y="553" text-anchor="middle" font-size="19">kvm-init (Rust)</text>
<path class="d-line" d="M320,502 L320,518" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="110" y="590" width="420" height="52" rx="12"/>
<text class="d-label" x="320.0" y="623" text-anchor="middle" font-size="19">Debian 12 + Rust services</text>
<path class="d-line" d="M320,572 L320,588" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="750" y="310" width="420" height="52" rx="12"/>
<text class="d-label" x="960.0" y="343" text-anchor="middle" font-size="19">stock ATF + OP-TEE</text>
<rect class="d-box" x="750" y="380" width="420" height="52" rx="12"/>
<text class="d-label" x="960.0" y="413" text-anchor="middle" font-size="19">stock U-Boot</text>
<path class="d-line" d="M960,362 L960,378" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="750" y="450" width="420" height="52" rx="12"/>
<text class="d-label" x="960.0" y="483" text-anchor="middle" font-size="19">Linux 4.19</text>
<path class="d-line" d="M960,432 L960,448" marker-end="url(#bc-ah)"/>
<rect class="d-box" x="750" y="520" width="420" height="52" rx="12"/>
<text class="d-label" x="960.0" y="553" text-anchor="middle" font-size="19">Ubuntu 22.04 + Sipeed apps</text>
<path class="d-line" d="M960,502 L960,518" marker-end="url(#bc-ah)"/>
<text class="d-sub" x="640" y="730" text-anchor="middle" font-size="17">A slot that fails to load resets the chip; the SPL then boots the other one.</text>
</svg>
</div><figcaption>What runs now. Sipeed&#39;s software only boots if slot A fails to load.</figcaption>
</figure>


<h3 class="relative group">A compression format nobody documented
    <div id="a-compression-format-nobody-documented" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#a-compression-format-nobody-documented" aria-label="Anchor">#</a>
    </span>
    
</h3>
<p>Every boot image on the device is a 1 KB header followed by a payload compressed in Axera&rsquo;s own format, which I call axgzip. The header carries an RSA signature from Axera&rsquo;s published test key; secure boot isn&rsquo;t fused on this chip. The chip has a hardware engine that decompresses the payloads, and the tool that creates them ships only as a prebuilt binary. I don&rsquo;t run vendor binaries in my builds, so the format had to be worked out.</p>
<p>The trick was to use the hardware itself as an oracle. From a 6.18 session I could hand the decompression engine a buffer and read back what it made of it; its registers are described in U-Boot&rsquo;s source. Feeding it stock images and carefully varied streams showed the layout:</p>
<ul>
<li>Blocks: a 16-byte stream header, then blocks of a 736-byte header (two Huffman tables, CRCs, a symbol-group count) and an MSB-first bit stream.</li>
<li>Symbols: DEFLATE-like literals and lengths, with a history window of 4,095 bytes.</li>
</ul>
<p>The Rust decoder reproduces the stock kernel and device tree byte for byte, and the encoder&rsquo;s output decompresses correctly on the hardware.</p>

<h3 class="relative group">Building it exactly
    <div id="building-it-exactly" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#building-it-exactly" aria-label="Anchor">#</a>
    </span>
    
</h3>
<p>The first goal was to build the SDK with the stock configuration and get the same bytes as the device. The device&rsquo;s U-Boot matched to within 440 bytes, which was the compiler. The SPL was harder: Debian&rsquo;s GCC 9.3 and 12 both produced slightly different code. The exact SPL on the device came out of the SDK at a commit from March 2026 built with ARM&rsquo;s own GCC 9.2-2019.12 toolchain: byte for byte, all 47,248 bytes. Once the stock build reproduced, I knew any difference in my build was a change I&rsquo;d made.</p>
<p>My build drops OP-TEE from the SPL and ATF, and leaves out the crypto engine&rsquo;s closed firmware. It turns off U-Boot&rsquo;s secure-boot and cipher commands, which had that same blob compiled in, and it draws my own boot logo on the LCD. It&rsquo;s reproducible: two builds give identical files, equal to what&rsquo;s on the device.</p>

<h3 class="relative group">The bug only the first stage could see
    <div id="the-bug-only-the-first-stage-could-see" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-bug-only-the-first-stage-could-see" aria-label="Anchor">#</a>
    </span>
    
</h3>
<p>The first test of my ATF and U-Boot in slot B failed. The device sat in USB download mode for a while, reset, and came back up on slot A by itself: exactly the self-healing I&rsquo;d counted on. To see how far it got, I added breadcrumbs. My ATF and U-Boot wrote progress codes into a chip register that survives a warm reset. After the next failure the register was untouched, so my code had never run at all.</p>
<p>Two control tests split it. Stock images in slot B booted. Stock code compressed with my encoder failed. So the bug was in my compressor, and it turned out to be the end of the stream. Every stock stream ends with a deliberately impossible instruction: a copy from 4,096 bytes back, one more than the engine&rsquo;s history holds. That&rsquo;s how the engine knows to stop. Without it, my streams decoded on into the padding after the real data, and the engine set its &ldquo;output larger than expected&rdquo; status bit.</p>
<p>U-Boot ignores that bit, which is why my kernels had been booting fine for days through the same compressor. The SPL treats it as fatal. With the end marker added, slot B booted my ATF and U-Boot, then slot A did.</p>

<h3 class="relative group">The SPL, the one stage with no fallback
    <div id="the-spl-the-one-stage-with-no-fallback" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-spl-the-one-stage-with-no-fallback" aria-label="Anchor">#</a>
    </span>
    
</h3>
<p>The SPL has no slot B. It lives in one partition as two copies, and if both are bad the only way back is USB download mode with someone at the device. So it went last, in two steps:</p>
<ol>
<li>Mine as the primary copy, Sipeed&rsquo;s left as the backup. I knew mine had run because the kernel log said so. With OP-TEE loaded, Linux prints that the trusted OS needs no migration. With my SPL nothing is handed to ATF, and it prints <code>psci: MIGRATE_INFO_TYPE not supported.</code> instead.</li>
<li>Both copies mine.</li>
</ol>
<p>With no OP-TEE anywhere, its 32 MB of reserved memory went back to Linux: 758 MB to 790 MB on a 1 GB device. The unused OP-TEE partitions are zeroed, and Axera&rsquo;s &ldquo;Create an Intelligent Future&rdquo; splash screen is gone.</p>
<p><figure><span class="mc-img" style="--lqip:url('data:image/webp;base64,UklGRowAAABXRUJQVlA4IIAAAADQAwCdASogAAcAPw1yrUemI6IYBABjEMT0gGJyCAD6AFNehtWKc+AA/v91GnhzX0dnTPd/0XSmv8naiukZHovHqb190YZnw2jx8q9fP1fWsVX2e7Dr3KF70TbC6YyRSSYPfHe7BM9tjnvb18dFuvO6usdPcn1nf4GLGsQOmgAAAA==')"><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Three captures of the NanoKVM Pro&rsquo;s front LCD: a blue monitor icon with &lsquo;starting&hellip;&rsquo; while it boots; an amber icon with &lsquo;Maintenance, hold USER 10 s at power-on for USB recovery&rsquo;; and the running Home page with the time, a CPU gauge, the HDMI input 1920×1080 59Hz and the stream state, with the address and name blurred"
    width="2000"
    height="433"
    src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/lcd-screens_hu_9992973c8b1d38d0.webp"
    srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/lcd-screens_hu_9992973c8b1d38d0.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/lcd-screens_hu_ad61ebd78a7cbf67.webp 1280w"
    sizes="(min-width: 768px) 50vw, 65vw"
    data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/lcd-screens_hu_4a48d1284750de2c.webp"></span><figcaption>The front screen: my boot logo, the maintenance screen shown while the User button is held, and my Rust LCD app once the system is up (address and name blurred).</figcaption></figure>
</p>

<h2 class="relative group">Packaging it for the next unit
    <div id="packaging-it-for-the-next-unit" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#packaging-it-for-the-next-unit" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>All of this is now one git repository with a Makefile. <code>make all</code> builds everything in Docker, and the provisioning steps take a new NanoKVM Pro from stock to this, in stages. Each stage checks the one before it, writes with read-back verification and reboots to prove itself. The firmware steps refuse to run if the new unit&rsquo;s stock firmware differs from the version my builds were checked against, because a newer SPL might support different memory chips.</p>
<p>That left the part I touch every day: the web UI.</p>

<h2 class="relative group">A more compact UI
    <div id="a-more-compact-ui" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#a-more-compact-ui" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The controls covered too much of the remote screen. The toolbar was a row of labelled tabs plus two round buttons, 539×60 pixels, right on top of the remote computer&rsquo;s menu bar. It&rsquo;s now one capsule of icon buttons, 309×42, and the menus are single-line. (The &ldquo;before&rdquo; here is my own earlier Rust UI; Sipeed&rsquo;s was long gone by then.)</p>
<p><figure><span class="mc-img" style="--lqip:url('data:image/webp;base64,UklGRqAAAABXRUJQVlA4IJQAAADwBQCdASogABUAPw12qUmmI6GYDAQAYxDE4AvzgTnRpbbWICVb+0mZNW1CFJjzX+4VX7QW8PxzXAD+5gCCdc5KUjn7AOt60g9uZbKnPoF+ZL5UiB72T+kvsstk1PnlrN5uy46YNaJvjAmrAKnUyWjaaBqFp+FjOvL5eA/MSTY9jxHuMerIlBPiU9eAs6Pwg/RbHAAA')"><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="Before: the old toolbar with labelled tabs (MJPEG, Absolute, Paste, Keyboard, Power, Settings) plus round full-screen and log-out buttons, and a video menu with a two-line description under every mode"
    width="1280"
    height="840"
    src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-toolbar_hu_4fc38af17d9da4e6.webp"
    srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-toolbar_hu_4fc38af17d9da4e6.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-toolbar_hu_625c8297e5dd25d2.webp 1280w"
    sizes="(min-width: 768px) 50vw, 65vw"
    data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-toolbar_hu_625c8297e5dd25d2.webp"></span><figcaption>Before: 539×60 toolbar, two-line menu rows.</figcaption></figure>
</p>
<p><figure><span class="mc-img" style="--lqip:url('data:image/webp;base64,UklGRogAAABXRUJQVlA4IHwAAABQBQCdASogABUAPvVYn0elIqEb/VQAUw9E4nABLgA/xUde+f1g8lnGExSrIdEPTDT1pNAA/u7v5MtPgd8KFAEuzxAzgO/3lwh+gGL9AgfyxWuD2wGb43oR6rIql5gkqi9JtksYUg3jrq/ePvmFrJH/yR12vOvDkyUtHAAA')"><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="auto"
    alt="After: one capsule of icon buttons with a separator before full screen and log out, and a video menu with one line per mode"
    width="1280"
    height="840"
    src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-toolbar_hu_999d298dfe2c35eb.webp"
    srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-toolbar_hu_999d298dfe2c35eb.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-toolbar_hu_5ba048e0afe6e9de.webp 1280w"
    sizes="(min-width: 768px) 50vw, 65vw"
    data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-toolbar_hu_5ba048e0afe6e9de.webp"></span><figcaption>After: 309×42, one line per mode.</figcaption></figure>
</p>
<p>The settings went from iOS sizing to Mac sizing on a laptop: 36-pixel rows instead of 50, a 720×540 sheet instead of 840×640, and each slider&rsquo;s label, track and value on one line.</p>
<figure>
  <div class="browser-frame">
    <div class="browser-frame__bar" aria-hidden="true">
      <span class="browser-frame__dots"><i></i><i></i><i></i></span>
      <span class="browser-frame__url">kvm-1234.tailXXXX.ts.net</span>
    </div><span class="browser-frame__shot" style="background:url('data:image/webp;base64,UklGRpoAAABXRUJQVlA4II4AAAAQBQCdASogABQAPw1qp0emIyGYBABjEMTxAFh2E51A7J10gr7mlRaA3b2Nl2RLdCzUAP68l3rlUYnht49dcJUr4lxb4/IQ50PsFagQWtCe6ruCfEDMgB8/ejdiR/i2hNbtiKmt3+qHX/JJnh5+kLLyq9Eu5tChhxPsW4YmkTxwE50ZqVqFyVFdJ0zjgAAA') center/cover no-repeat"><img
      class="browser-frame__page"
      src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-settings_hu_ae432914bac86456.webp"
      srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-settings_hu_ae432914bac86456.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-settings_hu_44ba52ebab7f27ef.webp 1280w"
      sizes="(min-width: 768px) 50vw, 65vw"
      width="2000" height="1250"
      alt="Before: a large settings sheet with big rows and sliders whose value sits under the label"
      loading="lazy" decoding="async"
      data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-settings_hu_d281dd4da62eebf1.webp"></span></div>
  <figcaption>Before.</figcaption>
</figure>

<figure>
  <div class="browser-frame">
    <div class="browser-frame__bar" aria-hidden="true">
      <span class="browser-frame__dots"><i></i><i></i><i></i></span>
      <span class="browser-frame__url">kvm-1234.tailXXXX.ts.net</span>
    </div><span class="browser-frame__shot" style="background:url('data:image/webp;base64,UklGRpYAAABXRUJQVlA4IIoAAABQBQCdASogABQAPw1opUemIyGYBABjEMTxAFh2E54rzerGEaduAv7Deqm3vSqLm9y3KAAA/ryXeNaEV9RVs1k9EkSCXPD64FJYKTMh34EOMSkFu80L/KBcQCM2EWbdX9mmu2lsw5fKv+4fpk8jZmtyMQscdAT+apmHzUcLIw3OUPyeBLhCBh7MAAA=') center/cover no-repeat"><img
      class="browser-frame__page"
      src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-settings_hu_d3e5a8f133b498f.webp"
      srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-settings_hu_d3e5a8f133b498f.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-settings_hu_b24f5b89182e6e5c.webp 1280w"
      sizes="(min-width: 768px) 50vw, 65vw"
      width="2000" height="1250"
      alt="After: a smaller settings sheet with compact rows, sliders with label, track and value on one line, and small switches"
      loading="lazy" decoding="async"
      data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-settings_hu_626b6a0daac0e35e.webp"></span></div>
  <figcaption>After: the same page in about half the area.</figcaption>
</figure>

<p>On a phone the rows stay 44 pixels high, because fingers didn&rsquo;t shrink, but each slider now puts its label and value on one line above the track.</p>
<figure>
  <div class="phone-frame" style="aspect-ratio: 900 / 1840; --screen-radius: 15.7% / 7.2%"><span class="phone-frame__screen phone-frame__ph" aria-hidden="true" style="left: 5.3333%; top: 2.5%; width: 89.3333%; height: 95%; background:url('data:image/webp;base64,UklGRjIBAABXRUJQVlA4ICYBAAAwCgCdASogAEYAPw1yq0kmI6IWbf1UYxDE9IBlPtr7Q24OY2K76/cGLdWFs0YTvswNPDAaSb8wczc4/EXEY4G9EwvGfKQsgxjqKuSzdlnAkMUYB7kSc72V2QAA/u9ouwT4x6/KzXtaylG1SFhQNwts76S3Kf65PmUE+J8q5+yzwHpg8GFAPr/w0F+y22jN+q76ep7f47VudZvC4ZkqxCrSqnMG8d8Qbd/Oj+ODgcgeB2D4F3yR8C1sEXzp7XGsa/z/FAU81u0MaZVLbJrHC4OUeTnDzlKQDZFEYAIYrDXQ7O8Ds5+luYaaqFeLekXlGWXGhd/RRtDSf2tFGzWLsKRqfEmFsBYYZ83WjKdO0GyU3dy7+UhHsfCCqABavgsGFmJmIJ4AAAA=') center/cover no-repeat"></span>
    <img
      class="phone-frame__screen"
      style="left: 5.3333%; top: 2.5%; width: 89.3333%; height: 95%"
      src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-phone_hu_1ad89e73ad16ebd1.webp"
      width="1206" height="2622"
      alt="Before, on an iPhone: video settings with tall slider rows"
      loading="lazy" decoding="async"
      data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/before-phone_hu_606d7af19fa60eaa.webp">
    <img class="phone-frame__bezel nozoom" src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/iphone-17-frame_hu_492bde446de4e1d1.webp" width="900" height="1840" alt="" aria-hidden="true" decoding="async">
  </div>
  <figcaption>Before.</figcaption>
</figure>

<figure>
  <div class="phone-frame" style="aspect-ratio: 900 / 1840; --screen-radius: 15.7% / 7.2%"><span class="phone-frame__screen phone-frame__ph" aria-hidden="true" style="left: 5.3333%; top: 2.5%; width: 89.3333%; height: 95%; background:url('data:image/webp;base64,UklGRvYAAABXRUJQVlA4IOoAAADQBwCdASogAEYAPw1sqEomIqGYDMwAYxDE9IBlPAvFejht4k4vXcqbLXuCYmRQgdu1NxfEFMJjJfXmbmO7o03/MlNCrX7qUAD+5fayLZ2NDWpDzmV6uTvH9LG6LL4Np/zFGgs+BmU8iEmm5Of2hWjGaVEDmTIdgXTVaZyV3bp2boOpyqVawl+7+8kDXTlwwtjDnBUE7AFDxNtEprM8IpGab6isoO/lINlN9pwyGG5BGlGWh0EMJWk0azd76rQrFFI3lhHT0DFhra7QHBsNOWcZCUt5rjo8XsVo8CHJHeVHpoGedvqAVP2AAAA=') center/cover no-repeat"></span>
    <img
      class="phone-frame__screen"
      style="left: 5.3333%; top: 2.5%; width: 89.3333%; height: 95%"
      src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-phone_hu_d9e0f45ec8a73e4.webp"
      width="1206" height="2622"
      alt="After, on an iPhone: video settings with label and value on one line over each slider"
      loading="lazy" decoding="async"
      data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/after-phone_hu_96aa1504813ebbb5.webp">
    <img class="phone-frame__bezel nozoom" src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/iphone-17-frame_hu_492bde446de4e1d1.webp" width="900" height="1840" alt="" aria-hidden="true" decoding="async">
  </div>
  <figcaption>After.</figcaption>
</figure>

<p>One bug only showed on phones: the settings sheet could be taller than the screen. It was sized with <code>100vh</code>, and on mobile browsers <code>100vh</code> includes the area behind the address bar. The fix is the dynamic viewport unit, <code>100dvh</code>, with a fallback, and every panel&rsquo;s maximum height worked out from where it actually starts:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-css" data-lang="css"><span class="line"><span class="cl"><span class="p">:</span><span class="nd">root</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="nv">--vh</span><span class="p">:</span> <span class="mi">100</span><span class="kt">vh</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">  <span class="nv">--panel-top</span><span class="p">:</span> <span class="mi">56</span><span class="kt">px</span><span class="p">;</span> <span class="c">/* panels open just under the toolbar */</span>
</span></span><span class="line"><span class="cl">  <span class="nv">--panel-max</span><span class="p">:</span> <span class="nb">calc</span><span class="p">(</span><span class="nf">var</span><span class="p">(</span><span class="o">--</span><span class="n">vh</span><span class="p">)</span> <span class="o">-</span> <span class="nf">var</span><span class="p">(</span><span class="o">--</span><span class="n">panel</span><span class="o">-</span><span class="kc">top</span><span class="p">)</span> <span class="o">-</span> <span class="nf">max</span><span class="p">(</span><span class="mi">6</span><span class="kt">px</span><span class="p">,</span> <span class="nf">env</span><span class="p">(</span><span class="n">safe</span><span class="o">-</span><span class="n">area</span><span class="o">-</span><span class="kc">inset</span><span class="o">-</span><span class="kc">bottom</span><span class="p">)));</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">@</span><span class="k">supports</span> <span class="o">(</span><span class="nt">height</span><span class="o">:</span> <span class="nt">100dvh</span><span class="o">)</span> <span class="p">{</span> <span class="p">:</span><span class="nd">root</span> <span class="p">{</span> <span class="nv">--vh</span><span class="p">:</span> <span class="mi">100</span><span class="n">dvh</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">.</span><span class="nc">panel</span><span class="p">.</span><span class="nc">settings</span> <span class="p">{</span> <span class="k">height</span><span class="p">:</span> <span class="nf">min</span><span class="p">(</span><span class="mi">540</span><span class="kt">px</span><span class="p">,</span> <span class="nf">var</span><span class="p">(</span><span class="o">--</span><span class="n">panel</span><span class="o">-</span><span class="n">max</span><span class="p">));</span> <span class="p">}</span></span></span></code></pre></div></div>
<p>A small test opens every panel at nine window sizes, from 1440×900 down to 320×480 and phone landscape, and checks its edges stay on screen. All 36 checks pass.</p>

<h2 class="relative group">Passkeys, and why they don&rsquo;t work on an IP address
    <div id="passkeys-and-why-they-dont-work-on-an-ip-address" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#passkeys-and-why-they-dont-work-on-an-ip-address" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The web UI&rsquo;s sign-in was a username and password, served with a self-signed certificate I clicked past every time. I wanted passkeys, and then no password at all. The first thing I learned is that you can&rsquo;t just add WebAuthn to a box you reach by IP address. Two rules get in the way:</p>
<ul>
<li><strong>The page needs a valid certificate.</strong> WebAuthn only exists in secure contexts, and since version 110 Chrome refuses it on any page with a certificate error. Chromium&rsquo;s list of <a href="https://chromium.googlesource.com/chromium/src/&#43;/main/content/browser/webauth/origins.md"  target="_blank" rel="noreferrer">origins that support WebAuthn</a> is short, and a certificate you click past isn&rsquo;t on it.</li>
<li><strong>A passkey belongs to a domain.</strong> It&rsquo;s bound to a relying party ID, which has to be the page&rsquo;s domain or a parent of it. An IP address isn&rsquo;t a domain, so you can&rsquo;t make a passkey for <code>100.x.y.z</code>.</li>
</ul>
<p>If you self-host anything, you&rsquo;ve probably wanted this too. There&rsquo;s a <a href="https://forums.unraid.net/topic/196013-add-passkey-webauthn-login-to-unraid-gui-phishing-resistant-passwordless-access-like-tailscale/"  target="_blank" rel="noreferrer">feature request on the Unraid forums</a> asking for exactly this.</p>

<h2 class="relative group">A real certificate from Tailscale
    <div id="a-real-certificate-from-tailscale" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#a-real-certificate-from-tailscale" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Tailscale already gives every machine a name: with MagicDNS on, the KVM is <code>kvm-1234.tailXXXX.ts.net</code> to every device in my tailnet. Tailscale&rsquo;s <a href="https://tailscale.com/kb/1153/enabling-https"  target="_blank" rel="noreferrer">HTTPS feature</a> adds the certificate. You switch on &ldquo;HTTPS Certificates&rdquo; once in the admin console, and then <code>tailscale cert</code> gets a Let&rsquo;s Encrypt certificate for the machine&rsquo;s name. Let&rsquo;s Encrypt checks ownership with a DNS-01 challenge that Tailscale&rsquo;s control plane answers, so the KVM needs no open port and no public IP.</p>
<p>Decide one thing before you flip that switch. Every certificate Let&rsquo;s Encrypt issues goes into the public Certificate Transparency logs, so the machine name and the tailnet name become public. Tailscale&rsquo;s docs say so, and <a href="https://iter.ca/post/hostnames/"  target="_blank" rel="noreferrer">people have mined those logs for tailnet hostnames</a>.</p>
<p><code>tailscale cert</code> hit two snags on the KVM. My trimmed Tailscale build said <code>unknown subcommand: cert</code>. Adding the <code>acme</code> feature then failed to compile:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">feature/acme/refresh.go:85:10: b.ServeConfig undefined</span></span></code></pre></div></div>
<p>The certificate feature quietly depends on the <code>serve</code> feature. With both, the binary grew from 13.4 MB to 18.1 MB.</p>
<p>Then the firewall from day zero dropped the request. Tailscale&rsquo;s own control traffic gets through because tailscaled marks its sockets, but its certificate client is a plain HTTP client. I didn&rsquo;t want to open HTTPS to the whole internet for one daily job, so the renewal command opens a hole exactly as wide as it needs, for exactly as long:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-rust" data-lang="rust"><span class="line"><span class="cl"><span class="sd">/// Temporary allowlist entries for Let&#39;s Encrypt&#39;s API, removed when dropped (also on errors).
</span></span></span><span class="line"><span class="cl"><span class="k">struct</span> <span class="nc">Hole</span><span class="p">(</span><span class="nb">Vec</span><span class="o">&lt;</span><span class="p">(</span><span class="o">&amp;</span><span class="nb">&#39;static</span><span class="w"> </span><span class="kt">str</span><span class="p">,</span><span class="w"> </span><span class="nb">String</span><span class="p">)</span><span class="o">&gt;</span><span class="p">);</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="k">impl</span><span class="w"> </span><span class="n">Hole</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="k">fn</span> <span class="nf">open</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nc">Hole</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">rules</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="k">for</span><span class="w"> </span><span class="n">ip</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">resolve</span><span class="p">(</span><span class="s">&#34;acme-v02.api.letsencrypt.org&#34;</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">ipt</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">ip</span><span class="p">.</span><span class="n">is_ipv4</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="s">&#34;iptables-legacy&#34;</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="s">&#34;ip6tables-legacy&#34;</span><span class="w"> </span><span class="p">};</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">ip</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ip</span><span class="p">.</span><span class="n">to_string</span><span class="p">();</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="k">if</span><span class="w"> </span><span class="n">run</span><span class="p">(</span><span class="n">ipt</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="p">[</span><span class="s">&#34;-w&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-I&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;kvm-egress&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;1&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-d&#34;</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">ip</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-p&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;tcp&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;--dport&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;443&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-j&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;RETURN&#34;</span><span class="p">])</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">                </span><span class="n">rules</span><span class="p">.</span><span class="n">push</span><span class="p">((</span><span class="n">ipt</span><span class="p">,</span><span class="w"> </span><span class="n">ip</span><span class="p">));</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="n">Hole</span><span class="p">(</span><span class="n">rules</span><span class="p">)</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="k">impl</span><span class="w"> </span><span class="nb">Drop</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Hole</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="k">fn</span> <span class="nf">drop</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">ipt</span><span class="p">,</span><span class="w"> </span><span class="n">ip</span><span class="p">)</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="n">run</span><span class="p">(</span><span class="n">ipt</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="p">[</span><span class="s">&#34;-w&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-D&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;kvm-egress&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-d&#34;</span><span class="p">,</span><span class="w"> </span><span class="n">ip</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-p&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;tcp&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;--dport&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;443&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;-j&#34;</span><span class="p">,</span><span class="w"> </span><span class="s">&#34;RETURN&#34;</span><span class="p">]);</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
<p>The <code>Hole</code> lives only while <code>tailscale cert</code> runs, and <code>Drop</code> closes it whatever happens. The first certificate took 36 seconds, and afterwards the firewall had no port-443 rules left. A daily timer runs it, and Tailscale only renews when the 90-day certificate is due.</p>
<figure class="diagram">
  <div role="img" aria-label="Diagram: a browser on the tailnet connects over HTTPS to kvm-server on the KVM, which serves the Let&#39;s Encrypt certificate for the ts.net name (passkeys work) and its own device certificate for IP addresses (password or sign-in link). Below it, kvm-l3 tls renew runs daily and calls tailscaled&#39;s tailscale cert, which has Tailscale&#39;s control plane set the DNS-01 record and gets a 90-day certificate from Let&#39;s Encrypt, with outbound access opened only for that call; the certificate is written to ts.pem and kvm-server reloads it within a minute."><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 560" aria-hidden="true" focusable="false">
<defs><marker id="cf-ah" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="d-head" d="M0,0 L10,5 L0,10 z"/></marker></defs>
<text class="d-title" x="150" y="60" text-anchor="middle" font-size="30">Your devices</text>
<text class="d-title" x="630" y="60" text-anchor="middle" font-size="30">The KVM</text>
<text class="d-title" x="1145" y="60" text-anchor="middle" font-size="30">Internet</text>
<rect class="d-box" x="40" y="185" width="220" height="110" rx="14"/>
<text class="d-label" x="150" y="232" text-anchor="middle" font-size="24">Browser</text>
<text class="d-sub" x="150" y="265" text-anchor="middle" font-size="18">on your tailnet</text>
<rect class="d-group" x="320" y="100" width="620" height="420" rx="30"/>
<rect class="d-box" x="360" y="160" width="540" height="160" rx="14"/>
<text class="d-label d-mono" x="630" y="205" text-anchor="middle" font-size="24">kvm-server</text>
<text class="d-sub" x="630" y="246" text-anchor="middle" font-size="18">ts.net name: Let's Encrypt cert, passkeys</text>
<text class="d-sub" x="630" y="278" text-anchor="middle" font-size="18">IP address: device cert, password or link</text>
<rect class="d-box" x="360" y="400" width="240" height="90" rx="14"/>
<text class="d-label d-mono" x="480" y="440" text-anchor="middle" font-size="20">kvm-l3 tls renew</text>
<text class="d-sub" x="480" y="470" text-anchor="middle" font-size="17">daily timer</text>
<rect class="d-box" x="660" y="400" width="240" height="90" rx="14"/>
<text class="d-label d-mono" x="780" y="440" text-anchor="middle" font-size="20">tailscaled</text>
<text class="d-sub d-mono" x="780" y="470" text-anchor="middle" font-size="17">tailscale cert</text>
<rect class="d-box" x="1030" y="150" width="230" height="100" rx="14"/>
<text class="d-label" x="1145" y="192" text-anchor="middle" font-size="21">Tailscale control</text>
<text class="d-sub" x="1145" y="224" text-anchor="middle" font-size="16">sets the DNS-01 record</text>
<rect class="d-box" x="1030" y="380" width="230" height="100" rx="14"/>
<text class="d-label" x="1145" y="422" text-anchor="middle" font-size="21">Let's Encrypt</text>
<text class="d-sub" x="1145" y="454" text-anchor="middle" font-size="16">issues a 90-day cert</text>
<text class="d-sub" x="1145" y="506" text-anchor="middle" font-size="15">egress opened for this call only</text>
<path class="d-line" d="M260,240 L358,240" marker-end="url(#cf-ah)"/>
<text class="d-sub" x="309" y="228" text-anchor="middle" font-size="16">HTTPS</text>
<path class="d-line" d="M600,445 L658,445" marker-end="url(#cf-ah)"/>
<path class="d-line" d="M480,398 L480,322" marker-end="url(#cf-ah)"/>
<text class="d-sub" x="492" y="352" font-size="16">writes ts.pem</text>
<text class="d-sub" x="492" y="374" font-size="15">reloaded within a minute</text>
<path class="d-line" d="M900,420 L1028,225" marker-end="url(#cf-ah)"/>
<text class="d-sub" x="1002" y="320" font-size="15">DNS-01</text>
<path class="d-line" d="M900,445 L1028,432" marker-end="url(#cf-ah)"/>
<text class="d-sub" x="966" y="426" text-anchor="middle" font-size="15">ACME</text>
</svg>
</div><figcaption>The certificate comes from Let&#39;s Encrypt through Tailscale. The KVM never needs an open port.</figcaption>
</figure>

<p>I didn&rsquo;t want to lose access by IP address either, for the day Tailscale&rsquo;s DNS isn&rsquo;t there or I&rsquo;m at the desk with a USB cable. So the server keeps both certificates and picks one per connection by the name the browser asked for (SNI):</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-rust" data-lang="rust"><span class="line"><span class="cl"><span class="k">impl</span><span class="w"> </span><span class="n">ResolvesServerCert</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Certs</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="k">fn</span> <span class="nf">resolve</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">hello</span>: <span class="nc">ClientHello</span><span class="o">&lt;</span><span class="nb">&#39;_</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nb">Option</span><span class="o">&lt;</span><span class="n">Arc</span><span class="o">&lt;</span><span class="n">CertifiedKey</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">sni</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">hello</span><span class="p">.</span><span class="n">server_name</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">t</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">ts</span><span class="p">.</span><span class="n">read</span><span class="p">().</span><span class="n">unwrap</span><span class="p">().</span><span class="n">as_ref</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">                </span><span class="k">if</span><span class="w"> </span><span class="n">sni</span><span class="p">.</span><span class="n">eq_ignore_ascii_case</span><span class="p">(</span><span class="o">&amp;</span><span class="n">t</span><span class="p">.</span><span class="n">name</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">                    </span><span class="k">return</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">t</span><span class="p">.</span><span class="n">key</span><span class="p">.</span><span class="n">clone</span><span class="p">());</span><span class="w"> </span><span class="c1">// the ts.net name: Let&#39;s Encrypt
</span></span></span><span class="line"><span class="cl"><span class="w">                </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">            </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nb">Some</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">device</span><span class="p">.</span><span class="n">clone</span><span class="p">())</span><span class="w"> </span><span class="c1">// anything else: the device&#39;s own certificate
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
<p>The renewal writes the key and the chain into one file and swaps it in with a rename. The server checks it once a minute, and with one file it can never pair a new certificate with an old key.</p>

<h2 class="relative group">WebAuthn in Rust without OpenSSL
    <div id="webauthn-in-rust-without-openssl" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#webauthn-in-rust-without-openssl" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>The usual Rust library, <a href="https://github.com/kanidm/webauthn-rs"  target="_blank" rel="noreferrer">webauthn-rs</a>, does its cryptography with OpenSSL 3. My server already had <a href="https://github.com/briansmith/ring"  target="_blank" rel="noreferrer">ring</a> through rustls, and ring checks every signature passkeys use:</p>
<ul>
<li>ECDSA P-256: Apple, Google and 1Password passkeys.</li>
<li>Ed25519: some security keys.</li>
<li>RSA: Windows Hello.</li>
</ul>
<p>So the verifier is about 590 lines of Rust plus tests, with no new crypto dependency. Signing in checks three things:</p>
<ul>
<li>the client data: the ceremony type, our challenge and our exact origin;</li>
<li>the authenticator data: the hash of our relying party ID, and the &ldquo;user present&rdquo; and &ldquo;user verified&rdquo; flags;</li>
<li>the signature:</li>
</ul>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-rust" data-lang="rust"><span class="line"><span class="cl"><span class="kd">let</span><span class="w"> </span><span class="n">msg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">auth_data</span><span class="p">,</span><span class="w"> </span><span class="n">Sha256</span>::<span class="n">digest</span><span class="p">(</span><span class="n">client_data_json</span><span class="p">).</span><span class="n">as_slice</span><span class="p">()].</span><span class="n">concat</span><span class="p">();</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="kd">let</span><span class="w"> </span><span class="n">ok</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">match</span><span class="w"> </span><span class="n">key</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="n">Key</span>::<span class="n">Es256</span><span class="p">(</span><span class="n">pt</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">UnparsedPublicKey</span>::<span class="n">new</span><span class="p">(</span><span class="o">&amp;</span><span class="no">ECDSA_P256_SHA256_ASN1</span><span class="p">,</span><span class="w"> </span><span class="n">pt</span><span class="p">).</span><span class="n">verify</span><span class="p">(</span><span class="o">&amp;</span><span class="n">msg</span><span class="p">,</span><span class="w"> </span><span class="n">sig</span><span class="p">).</span><span class="n">is_ok</span><span class="p">(),</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="n">Key</span>::<span class="n">Ed25519</span><span class="p">(</span><span class="n">pt</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">UnparsedPublicKey</span>::<span class="n">new</span><span class="p">(</span><span class="o">&amp;</span><span class="no">ED25519</span><span class="p">,</span><span class="w"> </span><span class="n">pt</span><span class="p">).</span><span class="n">verify</span><span class="p">(</span><span class="o">&amp;</span><span class="n">msg</span><span class="p">,</span><span class="w"> </span><span class="n">sig</span><span class="p">).</span><span class="n">is_ok</span><span class="p">(),</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="n">Key</span>::<span class="n">Rs256</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">n</span><span class="p">,</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="n">RsaPublicKeyComponents</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">n</span><span class="p">,</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">}.</span><span class="n">verify</span><span class="p">(</span><span class="o">&amp;</span><span class="no">RSA_PKCS1_2048_8192_SHA256</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">msg</span><span class="p">,</span><span class="w"> </span><span class="n">sig</span><span class="p">).</span><span class="n">is_ok</span><span class="p">(),</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="p">};</span></span></span></code></pre></div></div>
<p>Registration reads CBOR, so there&rsquo;s a small, strict CBOR reader. It accepts definite lengths only, has a depth limit, and refuses any array or map that claims more entries than there are bytes left. Three choices are worth stating:</p>
<ul>
<li>User verification is required, both when adding a passkey and at every sign-in. A machine with a keyboard into my computer gets Face ID, Touch ID or a PIN every time, not just a tap.</li>
<li>No attestation. The trust decision is who was signed in when the passkey was added, not which brand of authenticator made it.</li>
<li>Adding a passkey needs a recent sign-in: a session under five minutes old, or the password. A stolen cookie alone can&rsquo;t plant a passkey. On a device that already has one, the page just asks for Face ID again.</li>
</ul>
<p>The unit tests sign real responses with keys ring generates on the fly, then change one thing at a time: origin, relying party, a flipped signature bit, a missing verification flag, a counter going backwards, malformed CBOR. One failed on the first run, and the bug was in the test. It passed the attacker&rsquo;s origin as the expected origin, so the verifier correctly accepted it.</p>

<h2 class="relative group">Turning the password off: sign-in links instead of email
    <div id="turning-the-password-off-sign-in-links-instead-of-email" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#turning-the-password-off-sign-in-links-instead-of-email" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>A new phone has no passkey yet, and I didn&rsquo;t want to lock myself out the day I lose my laptop. Most sites send a magic link by email. For a KVM that&rsquo;s a bad trade: the device would need a mail account&rsquo;s credentials and a hole in its firewall, and anyone who reads that mailbox could control my computer. So the links come from places that already prove it&rsquo;s me:</p>
<ul>
<li>A signed-in browser. Settings, Account, &ldquo;Sign in another device&rdquo; makes a one-time link and a QR code. I scan it with the new phone, and the phone signs in and adds its own passkey right there.</li>
<li>SSH. <code>kvm-l3 login-link</code> on the KVM prints a link. That&rsquo;s the way back in if everything else is gone.</li>
</ul>
<figure>
  <div class="browser-frame">
    <div class="browser-frame__bar" aria-hidden="true">
      <span class="browser-frame__dots"><i></i><i></i><i></i></span>
      <span class="browser-frame__url">kvm-1234.tailXXXX.ts.net</span>
    </div><span class="browser-frame__shot" style="background:url('data:image/webp;base64,UklGRp4AAABXRUJQVlA4IJIAAABwBQCdASogABQAPw1opkemIyGYBABjEMTxAF+1quHqbbgAaJsiUbxfnSds5FgHTPm7Dj9AAP68l3jWhFmZCS9BffA9vvb3t7Lt3sI2GBtSHGOohv0pk0RqlftxCoY7Kd4nPVLBFvtlyCcYieP9w/TJ5GzNa2R/uTzunies4Y3xUmGN8hSo3snyhHcXGkegaIAAAA==') center/cover no-repeat"><img
      class="browser-frame__page"
      src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/account_hu_f65a52fdd43d2dd3.webp"
      srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/account_hu_f65a52fdd43d2dd3.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/account_hu_d2314168dff32fff.webp 1280w"
      sizes="(min-width: 768px) 50vw, 65vw"
      width="2000" height="1250"
      alt="The KVM&#39;s Settings, Account page: a Password sign-in switch, a Sign in another device button with a QR code and a one-time link below it, and a Passkeys list with MacBook Pro and iPhone, each with the date added and a Remove button"
      loading="lazy" decoding="async"
      data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/account_hu_9f1c094451b81b0.webp"></span></div>
  <figcaption>Settings, Account. The account, passkeys and link here are made-up examples, not my real ones.</figcaption>
</figure>

<p>A link works once, for ten minutes. The server keeps only its hash, in memory, so a restart or a logout ends them all. The token travels in the URL fragment (<code>#link=…</code>), which browsers never send to a server or put in a Referer header, and the page wipes it from the address bar as soon as it reads it.</p>
<p>The password switch has two guards so I can&rsquo;t lock myself out from the UI. It only turns off while a passkey exists, and the last passkey can&rsquo;t be removed while it&rsquo;s off. With it off, the login page is one button:</p>
<figure>
  <div class="browser-frame">
    <div class="browser-frame__bar" aria-hidden="true">
      <span class="browser-frame__dots"><i></i><i></i><i></i></span>
      <span class="browser-frame__url">kvm-1234.tailXXXX.ts.net</span>
    </div><span class="browser-frame__shot" style="background:url('data:image/webp;base64,UklGRmgAAABXRUJQVlA4IFwAAADwBACdASogABQAPwFkoEeloqGYBgBbEATxgFUuE500+bWdTgAY9pf3nP/Ckq7gLWgA/tjl+AmpbWyV6akGU+bbxAQMktU0kbXEwu1z8ml5noPmxyaxJ6tVTNDAAA==') center/cover no-repeat"><img
      class="browser-frame__page"
      src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/login-password-off_hu_577a03a467738f0b.webp"
      srcset="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/login-password-off_hu_577a03a467738f0b.webp 800w, https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/login-password-off_hu_6c1807cb716d9f.webp 1280w"
      sizes="(min-width: 768px) 50vw, 65vw"
      width="1600" height="1000"
      alt="The NanoKVM sign-in page with a single Sign in with a passkey button and a note: no passkey on this device, open a sign-in link made on a signed-in device or run kvm-l3 login-link on the KVM"
      loading="lazy" decoding="async"
      data-zoom-src="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/login-password-off_hu_c832fcd5d160bfa.webp"></span></div>
  <figcaption>Password sign-in off. On the IP address the same page shows a link to the ts.net name instead.</figcaption>
</figure>


<h2 class="relative group">Testing passkeys with a virtual authenticator
    <div id="testing-passkeys-with-a-virtual-authenticator" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#testing-passkeys-with-a-virtual-authenticator" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>Unit tests prove the verifier agrees with my reading of the spec, not that it agrees with a browser. Chrome has a virtual authenticator in the DevTools Protocol, a fake security key that answers WebAuthn the way a real one would, and Playwright exposes it:</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="n">cdp</span> <span class="o">=</span> <span class="n">context</span><span class="o">.</span><span class="n">new_cdp_session</span><span class="p">(</span><span class="n">page</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">cdp</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s2">&#34;WebAuthn.enable&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="cl"><span class="n">cdp</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="s2">&#34;WebAuthn.addVirtualAuthenticator&#34;</span><span class="p">,</span> <span class="p">{</span><span class="s2">&#34;options&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;protocol&#34;</span><span class="p">:</span> <span class="s2">&#34;ctap2&#34;</span><span class="p">,</span> <span class="s2">&#34;transport&#34;</span><span class="p">:</span> <span class="s2">&#34;internal&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;hasResidentKey&#34;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">&#34;hasUserVerification&#34;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="s2">&#34;isUserVerified&#34;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">&#34;automaticPresenceSimulation&#34;</span><span class="p">:</span> <span class="kc">True</span><span class="p">}})</span></span></span></code></pre></div></div>
<p>The test runs against the real KVM, on its real name, with the real certificate and without <code>ignore_https_errors</code>. If the certificate weren&rsquo;t trusted, Chrome would refuse WebAuthn and the test would fail on its first step. It:</p>
<ul>
<li>adds a passkey and signs in with it;</li>
<li>checks the IP address only offers a link to the name;</li>
<li>checks an old session can&rsquo;t add a passkey;</li>
<li>signs a second browser in with a one-time link, and tries the link again;</li>
<li>turns password sign-in off and on;</li>
<li>cleans up.</li>
</ul>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span><span class="nt">&#34;added&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nt">&#34;signed_in_with_passkey&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nt">&#34;last_used_recorded&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;ip_has_passkey_button&#34;</span><span class="p">:</span> <span class="kc">false</span><span class="p">,</span> <span class="nt">&#34;old_session_needs_password&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;link_signs_in&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nt">&#34;link_gone_from_address_bar&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nt">&#34;link_reuse_refused&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;password_refused_when_off&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nt">&#34;login_without_password_fields&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl"> <span class="nt">&#34;password_signin_restored&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nt">&#34;left_behind&#34;</span><span class="p">:</span> <span class="p">[],</span> <span class="nt">&#34;page_errors&#34;</span><span class="p">:</span> <span class="p">[]}</span></span></span></code></pre></div></div>
<p>It never calls logout, because logout rotates the signing secret and would end every session, mine included. It puts the password switch back the way it found it and deletes only its own passkey. And the remote &ldquo;desktop&rdquo; in every screenshot in this post is a drawing the test serves in place of the video stream, so no screenshot shows what&rsquo;s really on my screen.</p>

<h2 class="relative group">How this was built
    <div id="how-this-was-built" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#how-this-was-built" aria-label="Anchor">#</a>
    </span>
    
</h2>
<p>I did this over a weekend, in Claude Code, set up <a href="https://jared.lynskey.co.nz/en/posts/2026/2026-10-22-claude-code-day-to-day/" >the way I run it every day</a>. I made the calls that were mine to make:</p>
<ul>
<li>keep Sipeed&rsquo;s slot B as the fallback for good;</li>
<li>reverse-engineer the compression format rather than run Axera&rsquo;s tools;</li>
<li>write the SPL only with me at the device and the USB recovery image ready;</li>
<li>use Tailscale for the certificate;</li>
<li>send sign-in links from a signed-in device and SSH, not email.</li>
</ul>
<p>Claude Code did the building, the testing and the debugging, and asked before anything that couldn&rsquo;t be undone. That included every write to the boot chain and the one switch only I could flip, in my Tailscale admin console.</p>
<p>If you want to do the same to your own device, the order matters more than any single piece of code:</p>
<ol>
<li>Get a way back before you need it: backups, a fallback slot you never touch, and USB recovery tested with nothing written.</li>
<li>Make every new piece prove itself in RAM or in the spare slot first.</li>
<li>Rebuild the vendor&rsquo;s own code exactly before changing it, so that any difference is one you made.</li>
<li>For passkeys, get a real name and a trusted certificate first. After that, WebAuthn is a few hundred lines.</li>
</ol>
]]></content:encoded>
      <media:content url="https://jared.lynskey.co.nz/en/posts/2026/nanokvm-pro-own-firmware-rust-passkeys/featured.jpg" medium="image" type="image/jpeg" />
    </item>
  </channel>
</rss>
