<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
  <title>Daniel Wayne Armstrong</title>
  <link>https://www.dwarmstrong.org</link>
  <description>Libre all the things</description>
  <generator>Zola</generator>
  <language>en</language>
  <atom:link href="https://www.dwarmstrong.org/feed.xml" rel="self" type="application/rss+xml"/>
  <lastBuildDate>Fri, 14 Aug 2026 00:00:00 +0000</lastBuildDate>
    <item>
      <title>Configure SSH for Passwordless Logins to FreeBSD Servers</title>
      <pubDate>Fri, 14 Aug 2026 00:00:00 +0000</pubDate>
      <link>https://www.dwarmstrong.org/freebsd-ssh-keys/</link>
      <guid>https://www.dwarmstrong.org/freebsd-ssh-keys/</guid>
      <description>&lt;p&gt;Create SSH keys on a BSD or Linux &lt;strong&gt;CLIENT&lt;&#x2F;strong&gt; that will be used to secure access to remote devices. Disable password logins on a FreeBSD &lt;strong&gt;SERVER&lt;&#x2F;strong&gt; in favour of using SSH keys for authentication.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-ssh-keys&#x2F;#start-here&quot;&gt;Start Here&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-ssh-keys&#x2F;#create-public-and-private-keys&quot;&gt;Create Public and Private Keys&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-ssh-keys&#x2F;#share-public-key&quot;&gt;Share Public Key&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-ssh-keys&#x2F;#disable-password-logins&quot;&gt;Disable Password Logins&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-ssh-keys&#x2F;#create-an-alias&quot;&gt;Create an Alias&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-ssh-keys&#x2F;#keychain&quot;&gt;Keychain&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;start-here&quot;&gt;Start Here&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;on-both-the-client-and-the-server&quot;&gt;On BOTH the CLIENT and the SERVER&lt;&#x2F;h3&gt;
&lt;p&gt;Create the &lt;code&gt;.ssh&lt;&#x2F;code&gt; directory and &lt;code&gt;authorized_keys&lt;&#x2F;code&gt; file in &lt;code&gt;$HOME&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir ~&#x2F;.ssh &amp;amp;&amp;amp; touch ~&#x2F;.ssh&#x2F;authorized_keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;chmod 700 ~&#x2F;.ssh &amp;amp;&amp;amp; chmod 600 ~&#x2F;.ssh&#x2F;authorized_keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;create-public-and-private-keys&quot;&gt;Create Public and Private Keys&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;on-the-client&quot;&gt;On the CLIENT&lt;&#x2F;h3&gt;
&lt;p&gt;Create the SSH public&#x2F;private key pair (example: &lt;code&gt;ed25519&lt;&#x2F;code&gt;) protected with a passphrase:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh-keygen -t ed25519 -C &amp;quot;$(whoami)@$(hostname -s)-$(date +%Y-%m-%d)&amp;quot; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Start &lt;code&gt;ssh-agent&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;eval &amp;quot;$(ssh-agent -s)&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add the newly-created SSH private key to the current session:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh-add ~&#x2F;.ssh&#x2F;id_ed25519&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Any SSH logins launched during the session will now access this key stored in memory.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;share-public-key&quot;&gt;Share Public Key&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;on-the-client-1&quot;&gt;On the CLIENT&lt;&#x2F;h3&gt;
&lt;p&gt;Upload the public key to the SERVER and append to the &lt;code&gt;authorized_keys&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh-copy-id -i ~&#x2F;.ssh&#x2F;id_ed25519.pub [remote_ip_address]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Example: SERVER has a &lt;code&gt;[remote_ip_address]&lt;&#x2F;code&gt; of &lt;code&gt;178.123.1.45&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh-copy-id -i ~&#x2F;.ssh&#x2F;id_ed25519.pub 178.123.1.45&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify key-based authentication is configured correctly by successfully logging in using &lt;code&gt;ssh&lt;&#x2F;code&gt; without a password:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh -o PasswordAuthentication=no 178.123.1.45&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;disable-password-logins&quot;&gt;Disable Password Logins&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;on-the-server&quot;&gt;On the SERVER&lt;&#x2F;h3&gt;
&lt;p&gt;After verifying the SERVER can be accessed remotely using SSH keys, open &lt;code&gt;sshd_config&lt;&#x2F;code&gt; for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas vi &#x2F;etc&#x2F;ssh&#x2F;sshd_config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Disable password authentication (and root login) with these modifications:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PermitRootLogin no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PubkeyAuthentication yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PasswordAuthentication no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;KbdInteractiveAuthentication no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Reload SSH:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas service sshd reload&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;on-the-client-2&quot;&gt;On the CLIENT&lt;&#x2F;h3&gt;
&lt;p&gt;While remaining logged into SERVER, open another terminal and verify the changes by attempting a new login using password authentication (which should &lt;strong&gt;fail&lt;&#x2F;strong&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no 178.123.1.45&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;username&amp;gt;@178.123.1.45: Permission denied (publickey).&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify key-based authentication continues to work as before:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh 178.123.1.45&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Device is now secured to accept only SSH key authentication for logins.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;create-an-alias&quot;&gt;Create an Alias&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;on-the-client-3&quot;&gt;On the CLIENT&lt;&#x2F;h3&gt;
&lt;p&gt;Create an alias for the SERVER in the user’s &lt;code&gt;ssh_config&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi ~&#x2F;.ssh&#x2F;config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add an alias for SERVER named &lt;code&gt;myserver&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Host myserver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  HostName 178.123.1.45&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  Port 52222&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Now login to SERVER is simply:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh myserver&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;keychain&quot;&gt;Keychain&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;on-the-client-4&quot;&gt;On the CLIENT&lt;&#x2F;h3&gt;
&lt;p&gt;For CLIENT devices that are not running desktop environments with their own built-in &lt;code&gt;ssh&lt;&#x2F;code&gt; key management tools, I like to install &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;danielrobbins&#x2F;keychain&quot;&gt;keychain&lt;&#x2F;a&gt;. Most Linux distros and BSDs package it for easy installation.&lt;&#x2F;p&gt;
&lt;p&gt;When logging in for the first time after boot, it prompts me for the passphrase to unlock my key, then will maintain a single &lt;code&gt;ssh-agent&lt;&#x2F;code&gt; process across multiple login sessions.&lt;&#x2F;p&gt;
&lt;p&gt;Flush all cached keys from memory:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;keychain --clear                  &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Configure the user’s SHELL to launch &lt;code&gt;keychain&lt;&#x2F;code&gt; at login and unlock the user’s private SSH key.&lt;&#x2F;p&gt;
&lt;p&gt;Example: My shell-of-choice is &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;fishshell.com&#x2F;&quot;&gt;fish&lt;&#x2F;a&gt; and I modify &lt;code&gt;config.fish&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi ~&#x2F;.config&#x2F;fish&#x2F;config.fish&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;if status is-interactive&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    if command -v keychain &amp;gt; &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        eval (env SHELL=fish keychain --eval --quiet id_ed25519)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    end&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;end&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p class=&quot;mastodon&quot;&gt;
You can like, share, or comment on this post &lt;a href=&quot;https:&#x2F;&#x2F;fosstodon.org&#x2F;@dwarmstrong&quot; target=&quot;_blank&quot;&gt;on the Fediverse&lt;&#x2F;a&gt; &amp;#128172
&lt;&#x2F;p&gt;
</description>
    </item>
    <item>
      <title>FreeBSD: After the First Boot</title>
      <pubDate>Thu, 13 Aug 2026 00:00:00 +0000</pubDate>
      <link>https://www.dwarmstrong.org/freebsd-after-install/</link>
      <guid>https://www.dwarmstrong.org/freebsd-after-install/</guid>
      <description>&lt;img class=&quot;floatright&quot; src=&quot;&#x2F;img&#x2F;neofetch-freebsd.png&quot; alt=&quot;FreeBSD logo in ASCII&quot; &#x2F;&gt;
&lt;p&gt;After the first boot of my &lt;a href=&quot;&#x2F;freebsd-install&quot;&gt;new FreeBSD installation&lt;&#x2F;a&gt;, these are some extra steps I like to make right away to get a system off to a good start!&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#package-management&quot;&gt;Package management&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#set-pkg-manager-to-default-to-yes&quot;&gt;Set pkg manager to default to yes&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#allow-designated-users-to-run-commands-as-root&quot;&gt;Allow designated users to run commands as root&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#use-a-larger-font-in-console&quot;&gt;Use a larger font in console&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#add-user-to-additional-groups&quot;&gt;Add user to additional groups&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#alias-for-root-mail&quot;&gt;Alias for root mail&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#set-system-wide-locale&quot;&gt;Set system-wide locale&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#switch-user-shell-from-sh-to-fish&quot;&gt;Switch user shell from sh to fish&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#create-ssh-keys&quot;&gt;Create SSH keys&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#boot-delay&quot;&gt;Boot delay&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#message-of-the-day&quot;&gt;Message of the day&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-after-install&#x2F;#clear-system-console-at-logout&quot;&gt;Clear system console at logout&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;package-management&quot;&gt;Package management&lt;&#x2F;h2&gt;
&lt;p&gt;Package management is one area where the differences between the Linux philosophy and the BSD philosophy about how to build a system becomes apparent.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Linux&lt;&#x2F;strong&gt; is an operating system kernel. Developers take this kernel and combine it with various independent software projects in a collection of &lt;strong&gt;packages&lt;&#x2F;strong&gt; that is released as a Linux &lt;strong&gt;distribution&lt;&#x2F;strong&gt; (Ubuntu, &lt;a href=&quot;&#x2F;tags&#x2F;debian&quot;&gt;Debian&lt;&#x2F;a&gt;, Fedora, etc.).&lt;&#x2F;p&gt;
&lt;p&gt;In contrast, each of the BSDs develop their own kernel and combine it with system components that are developed together “in-house” and released as a whole. The idea being that this approach leads to a more robust and tightly integrated core operating system. Third-party “userland” packages not included in the core may still be installed at the discretion of the user, with source code and binary packages provided from a &lt;strong&gt;ports&lt;&#x2F;strong&gt; repository.&lt;&#x2F;p&gt;
&lt;p&gt;A major change in FreeBSD 15.0 is the introduction of a new method for installing and managing the core operating system using the &lt;code&gt;pkg(8)&lt;&#x2F;code&gt; package manager. Currently marked as being a “technology preview”, the plan is it will become the default method for managing all base and userland binary packages on the system when FreeBSD 16.0 is released.&lt;&#x2F;p&gt;
&lt;p&gt;When I ran my fresh install of FreeBSD, I opted to use this &lt;code&gt;pkg&lt;&#x2F;code&gt; tool in combination with a network install, and the base system was installed as a set of packages from the “FreeBSD-base” repository.&lt;&#x2F;p&gt;
&lt;p&gt;To keep packages up-to-date, compare installed packages to the versions in &lt;code&gt;ports&lt;&#x2F;code&gt;, and generate a list of packages due for an upgrade, run the command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pkg upgrade&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To add a package:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pkg install [package]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;One of the first packages I like to install on any BSD or Linux system is &lt;code&gt;htop(1)&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pkg install htop&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;More: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.freebsd.org&#x2F;en&#x2F;books&#x2F;handbook&#x2F;ports&#x2F;&quot;&gt;FreeBSD Handbook - Installing Applications: Packages and Ports&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;set-pkg-manager-to-default-to-yes&quot;&gt;Set pkg manager to default to yes&lt;&#x2F;h2&gt;
&lt;p&gt;From &lt;code&gt;pkg.conf(5)&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; DEFAULT_ALWAYS_YES: boolean&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		    When  this	option is enabled pkg(1) will default to &amp;quot;yes&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		    for	all questions which require user confirmation before&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		    doing anything. Default: NO.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Open the file for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi &#x2F;usr&#x2F;local&#x2F;etc&#x2F;pkg.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Change:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#DEFAULT_ALWAYS_YES = false;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;… to:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DEFAULT_ALWAYS_YES = true;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;allow-designated-users-to-run-commands-as-root&quot;&gt;Allow designated users to run commands as root&lt;&#x2F;h2&gt;
&lt;p&gt;I created a user account (example: &lt;code&gt;foo&lt;&#x2F;code&gt;) during installation and added myself to the &lt;code&gt;wheel&lt;&#x2F;code&gt; group.&lt;&#x2F;p&gt;
&lt;p&gt;Install &lt;code&gt;doas&lt;&#x2F;code&gt; to run root-level access commands, and allow members of &lt;code&gt;wheel&lt;&#x2F;code&gt; to do so by default, by creating &lt;code&gt;doas.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;pkg install doas&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;echo &amp;quot;permit :wheel&amp;quot; &amp;gt; &#x2F;usr&#x2F;local&#x2F;etc&#x2F;doas.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To allow user &lt;code&gt;foo&lt;&#x2F;code&gt; to run commands as root without asking for a password:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;echo &amp;quot;permit nopass keepenv foo&amp;quot; &amp;gt;&amp;gt; &#x2F;usr&#x2F;local&#x2F;etc&#x2F;doas.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Log out as &lt;code&gt;root&lt;&#x2F;code&gt;, log back in as your user, and use &lt;code&gt;doas&lt;&#x2F;code&gt; to run any commands that require root privileges.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;use-a-larger-font-in-console&quot;&gt;Use a larger font in console&lt;&#x2F;h2&gt;
&lt;p&gt;On some of the higher-resolution displays I find the default font size in the console pretty small. The base system includes a selection of console fonts in &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;vt&#x2F;fonts&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Try a different, larger font size:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas vidcontrol -f terminus-b32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Download (in &lt;code&gt;raw&lt;&#x2F;code&gt; format) this nice selection of &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;LionyxML&#x2F;freebsd-terminus&#x2F;tree&#x2F;master&quot;&gt;terminus fonts of different sizes&lt;&#x2F;a&gt;, converted for use in the FreeBSD console.&lt;&#x2F;p&gt;
&lt;p&gt;Unpack the &lt;code&gt;.txz&lt;&#x2F;code&gt; package and copy the fonts to &lt;code&gt;&#x2F;usr&#x2F;share&#x2F;vt&#x2F;fonts&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;tar xvf vt-font-terminus-*.txz &amp;amp;&amp;amp; doas cp terminus-font&#x2F;ter-u* &#x2F;usr&#x2F;share&#x2F;vt&#x2F;fonts&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Try different font sizes:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas vidcontrol -f ter-u28&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Use &lt;code&gt;sysrc&lt;&#x2F;code&gt; to make a selection permanent by modifying &lt;code&gt;rc.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas sysrc allscreens_flags=&amp;quot;-f ter-u28&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;More: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.micski.dk&#x2F;2022&#x2F;01&#x2F;06&#x2F;fix-small-font-in-freebsd-virtual-terminal-system-console&#x2F;&quot;&gt;Fix small font in FreeBSD&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;add-user-to-additional-groups&quot;&gt;Add user to additional groups&lt;&#x2F;h2&gt;
&lt;p&gt;Add my user account created during installation to a group with the syntax:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas pw groupmod [group_name] -m [username]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Example: Permit powering off the system as a non-root user using &lt;code&gt;shutdown&lt;&#x2F;code&gt; by adding my user &lt;code&gt;foo&lt;&#x2F;code&gt; to the &lt;code&gt;operator&lt;&#x2F;code&gt; group:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas pw groupmod operator -m foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;alias-for-root-mail&quot;&gt;Alias for root mail&lt;&#x2F;h2&gt;
&lt;p&gt;Rather than login to root to collect system mail, I forward the root user’s mail to my non-root user’s inbox.&lt;&#x2F;p&gt;
&lt;p&gt;Open the &lt;code&gt;aliases&lt;&#x2F;code&gt; file for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas vi &#x2F;etc&#x2F;aliases&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Modify:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# root: me@my.domain&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;… by uncommenting the line and replacing &lt;code&gt;me@my.domain&lt;&#x2F;code&gt; with my &lt;code&gt;foo&lt;&#x2F;code&gt; username:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;root: foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Let the MTA know about the modification by running the &lt;code&gt;newaliases&lt;&#x2F;code&gt; command with no arguments:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas newaliases&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Test whether mail is indeed being forwarded by using the &lt;code&gt;mail&lt;&#x2F;code&gt; command as my user to send root a message:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ mail root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Subject: Test new alias &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Is it working?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Press &lt;code&gt;CTRL-d&lt;&#x2F;code&gt; to exit and send message.&lt;&#x2F;p&gt;
&lt;p&gt;It works!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ mail&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Mail version 8.1 6&#x2F;6&#x2F;93.  Type ? for help.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;quot;&#x2F;var&#x2F;mail&#x2F;foo&amp;quot;: 1 message 1 new&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt;N  1 dwa@tukturjuit.home.  Thu Mar 19 15:05  13&#x2F;427   &amp;quot;Test new alias&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;More: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.iceflatline.com&#x2F;2012&#x2F;09&#x2F;how-to-forward-roots-mail-to-a-another-user-in-freebsd&#x2F;&quot;&gt;How to Forward Root’s Mail&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;set-system-wide-locale&quot;&gt;Set system-wide locale&lt;&#x2F;h2&gt;
&lt;p&gt;To set the locale globally for the entire system, open the &lt;code&gt;login.conf&lt;&#x2F;code&gt; file for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas vi &#x2F;etc&#x2F;login.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Locate the section for the default login class, which is labeled &lt;code&gt;default:\&lt;&#x2F;code&gt;. Add or modify the &lt;code&gt;lang&lt;&#x2F;code&gt; and &lt;code&gt;charset&lt;&#x2F;code&gt; settings to match the desired locale (example: &lt;code&gt;en_CA.UTF-8&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:charset=UTF-8:\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:lang=en_CA.UTF-8:\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;:setenv=LC_COLLATE=C:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;lang&lt;&#x2F;code&gt; setting specifies language and region, &lt;code&gt;charset&lt;&#x2F;code&gt; specifies character encoding, and &lt;code&gt;LC_COLLATE=C&lt;&#x2F;code&gt; keeps file sorting predictable (such as &lt;code&gt;ls&lt;&#x2F;code&gt; displaying uppercase before lowercase).&lt;&#x2F;p&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Rebuild the login capability database:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas cap_mkdb &#x2F;etc&#x2F;login.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Log out and back in. Run &lt;code&gt;locale&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ locale&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LANG=en_CA.UTF-8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_CTYPE=&amp;quot;en_CA.UTF-8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_COLLATE=&amp;quot;en_CA.UTF-8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_TIME=&amp;quot;en_CA.UTF-8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_NUMERIC=&amp;quot;en_CA.UTF-8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_MONETARY=&amp;quot;en_CA.UTF-8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_MESSAGES=&amp;quot;en_CA.UTF-8&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;LC_ALL=&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;switch-user-shell-from-sh-to-fish&quot;&gt;Switch user shell from sh to fish&lt;&#x2F;h2&gt;
&lt;p&gt;If a user account is created during the install of FreeBSD, the default shell assigned is &lt;code&gt;sh&lt;&#x2F;code&gt;. I prefer &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;fishshell.com&#x2F;&quot;&gt;fish&lt;&#x2F;a&gt;, which is not included in the base system:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas pkg install fish&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;List available shells:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ cat &#x2F;etc&#x2F;shells&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;bin&#x2F;sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;bin&#x2F;csh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;bin&#x2F;tcsh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;usr&#x2F;local&#x2F;bin&#x2F;fish&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To change my user’s shell from &lt;code&gt;sh&lt;&#x2F;code&gt; to &lt;code&gt;fish&lt;&#x2F;code&gt; it is &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;tim.siosm.fr&#x2F;blog&#x2F;2023&#x2F;12&#x2F;22&#x2F;dont-change-defaut-login-shell&#x2F;&quot;&gt;strongly recommended&lt;&#x2F;a&gt; to make the change via &lt;code&gt;.shrc&lt;&#x2F;code&gt; instead of &lt;code&gt;chsh&lt;&#x2F;code&gt; system-wide.&lt;&#x2F;p&gt;
&lt;p&gt;Backup the current &lt;code&gt;.shrc&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mv ~&#x2F;.shrc ~&#x2F;.shrc.bak&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create a new &lt;code&gt;.shrc&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi ~&#x2F;.shrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# ~&#x2F;.shrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Switch to fish shell if interactive session&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;case &amp;quot;$-&amp;quot; in&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    *i*)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        FISH_PATH=$(command -v fish 2&amp;gt;&#x2F;dev&#x2F;null)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        if [ -n &amp;quot;$FISH_PATH&amp;quot; ]; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            export SHELL=&amp;quot;$FISH_PATH&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            # avoid the delay and primary device attribute warning (on freebsd)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            export fish_features=&amp;quot;no-query-term&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            exec &amp;quot;$FISH_PATH&amp;quot; -l&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        ;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;esac&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Backup the current &lt;code&gt;.profile&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mv ~&#x2F;.profile ~&#x2F;.profile.bak&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create a new &lt;code&gt;.profile&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi ~&#x2F;.profile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# ~&#x2F;.profile&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;if [ -f ~&#x2F;.shrc ]; then&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    . ~&#x2F;.shrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;fi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Log out and back in to start using the new shell.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;create-ssh-keys&quot;&gt;Create SSH keys&lt;&#x2F;h2&gt;
&lt;p&gt;Create an SSH public&#x2F;private key pair to facilitate passwordless logins to remote servers and (optional) configure remote access to the localhost. &lt;a href=&quot;&#x2F;freebsd-ssh-keys&quot;&gt;Read More&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;boot-delay&quot;&gt;Boot delay&lt;&#x2F;h2&gt;
&lt;p&gt;By default the system will pause at the boot menu for 10 seconds. I shorten this to 3 seconds by setting:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;echo &amp;#39;autoboot_delay=&amp;quot;3&amp;quot;&amp;#39; | doas tee -a &#x2F;boot&#x2F;loader.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;message-of-the-day&quot;&gt;Message of the day&lt;&#x2F;h2&gt;
&lt;p&gt;To slim down the “message of the day” (&lt;code&gt;motd(5)&lt;&#x2F;code&gt;) output after logging into the system, displaying only the &lt;code&gt;Last login&lt;&#x2F;code&gt; and FreeBSD version info:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas mv &#x2F;etc&#x2F;motd.template &#x2F;etc&#x2F;motd.template.bak &amp;amp;&amp;amp; doas touch &#x2F;etc&#x2F;motd.template&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;doas service motd restart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Or silence the output completely by creating an empty &lt;code&gt;.hushlogin&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;touch ~&#x2F;.hushlogin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;clear-system-console-at-logout&quot;&gt;Clear system console at logout&lt;&#x2F;h2&gt;
&lt;p&gt;For the &lt;code&gt;fish&lt;&#x2F;code&gt; shell I modify &lt;code&gt;config.fish&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi ~&#x2F;.config&#x2F;fish&#x2F;config.fish&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;function on_exit --on-event fish_exit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    clear&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;end&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;More: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;unix.stackexchange.com&#x2F;a&#x2F;12013&quot;&gt;How to clear terminal after logging out?&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p class=&quot;mastodon&quot;&gt;
You can like, share, or comment on this post &lt;a href=&quot;https:&#x2F;&#x2F;fosstodon.org&#x2F;@dwarmstrong&#x2F;116258748485813933&quot; target=&quot;_blank&quot;&gt;on the Fediverse&lt;&#x2F;a&gt; &amp;#128172
&lt;&#x2F;p&gt;
</description>
    </item>
    <item>
      <title>Install FreeBSD (Short and Sweet Version)</title>
      <pubDate>Wed, 12 Aug 2026 00:00:00 +0000</pubDate>
      <link>https://www.dwarmstrong.org/freebsd-install/</link>
      <guid>https://www.dwarmstrong.org/freebsd-install/</guid>
      <description>&lt;img class=&quot;floatright&quot; src=&quot;&#x2F;img&#x2F;beastie.png&quot; alt=&quot;FreeBSD beastie&quot; &#x2F;&gt;
&lt;p&gt;The &lt;strong&gt;FreeBSD Handbook&lt;&#x2F;strong&gt; has an &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;docs.freebsd.org&#x2F;en&#x2F;books&#x2F;handbook&#x2F;bsdinstall&#x2F;&quot;&gt;extensive chapter on installing FreeBSD&lt;&#x2F;a&gt; that covers a wide range of scenarios with descriptions of each possible choice. Its an invaluable resource maintained by volunteer contributors.&lt;&#x2F;p&gt;
&lt;p&gt;After performing a few installs, these are my personal notes of steps taken and choices made. A “short and sweet” version of the above Handbook.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-install&#x2F;#start-here&quot;&gt;Start Here&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-install&#x2F;#acquire-an-installation-image&quot;&gt;Acquire an installation image&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-install&#x2F;#prepare-the-usb-installation-medium&quot;&gt;Prepare the USB installation medium&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;freebsd-install&#x2F;#installation&quot;&gt;Installation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;start-here&quot;&gt;Start Here&lt;&#x2F;h2&gt;
&lt;p&gt;Throughout this guide, if you see square brackets &lt;code&gt;[]&lt;&#x2F;code&gt; in code blocks, that means the word of code (square brackets included) should be replaced with something else. This is detailed in the instructions before or after the code block.&lt;&#x2F;p&gt;
&lt;p&gt;FreeBSD will be installed as the sole operating system on a single disk using the &lt;code&gt;ZFS&lt;&#x2F;code&gt; file system with (optionally) encryption.&lt;&#x2F;p&gt;
&lt;p&gt;A few assumptions:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Target device is &lt;code&gt;amd64&lt;&#x2F;code&gt; architecture using UEFI to boot.&lt;&#x2F;li&gt;
&lt;li&gt;Secure boot is disabled on target device.&lt;&#x2F;li&gt;
&lt;li&gt;Installation image is prepared on a Linux&#x2F;BSD system.&lt;&#x2F;li&gt;
&lt;li&gt;Network access during install uses a wired interface.&lt;&#x2F;li&gt;
&lt;li&gt;System does not require hibernation support.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;acquire-an-installation-image&quot;&gt;Acquire an installation image&lt;&#x2F;h2&gt;
&lt;p&gt;As of &lt;strong&gt;August 2026&lt;&#x2F;strong&gt; the latest RELEASE is &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;download.freebsd.org&#x2F;releases&#x2F;amd64&#x2F;amd64&#x2F;ISO-IMAGES&#x2F;15.1&#x2F;&quot;&gt;FreeBSD-15.1&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Download &lt;code&gt;FreeBSD-15.1-RELEASE-amd64-memstick.img&lt;&#x2F;code&gt; and the &lt;code&gt;CHECKSUM&lt;&#x2F;code&gt; file for verification:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;wget https:&#x2F;&#x2F;download.freebsd.org&#x2F;releases&#x2F;amd64&#x2F;amd64&#x2F;ISO-IMAGES&#x2F;15.1&#x2F;FreeBSD-15.1-RELEASE-amd64-memstick.img&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;wget https:&#x2F;&#x2F;download.freebsd.org&#x2F;releases&#x2F;amd64&#x2F;amd64&#x2F;ISO-IMAGES&#x2F;15.1&#x2F;CHECKSUM.SHA512-FreeBSD-15.1-RELEASE-amd64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify the integrity of the image by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sha512sum -c --ignore-missing CHECKSUM.SHA512-FreeBSD-15.1-RELEASE-amd64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;prepare-the-usb-installation-medium&quot;&gt;Prepare the USB installation medium&lt;&#x2F;h3&gt;
&lt;p&gt;Write the installer to an &lt;strong&gt;unmounted&lt;&#x2F;strong&gt; USB storage device running the &lt;code&gt;dd&lt;&#x2F;code&gt; command as root.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;WARNING&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
&lt;strong&gt;Be very careful to note the proper device (which can be identified with &lt;code&gt;lsblk&lt;&#x2F;code&gt;). All contents on the device will be lost!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Example: On a Linux system, if a USB stick appears as &lt;code&gt;sdx1&lt;&#x2F;code&gt;, then write the installer to &lt;code&gt;sdx&lt;&#x2F;code&gt; (omit partition number):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dd bs=4M conv=fsync oflag=direct status=progress if=FreeBSD-15.1-RELEASE-amd64-memstick.img of=&#x2F;dev&#x2F;sdx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;&#x2F;h2&gt;
&lt;p&gt;Boot target device from the install media. In the &lt;strong&gt;FreeBSD Boot Menu&lt;&#x2F;strong&gt; press &lt;code&gt;&amp;lt;Enter&amp;gt;&lt;&#x2F;code&gt; to launch the installer.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;bsdinstall-boot-loader-menu.png&quot; alt=&quot;FreeBSD boot loader menu&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Welcome: &lt;code&gt;Install&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Keymap Selection: Default is standard &lt;code&gt;US&lt;&#x2F;code&gt; keyboard map. Press &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt; to continue or select an alternative from the list.&lt;&#x2F;li&gt;
&lt;li&gt;Set Hostname: &lt;code&gt;[new_name_for_device].home.arpa&lt;&#x2F;code&gt;   &lt;em&gt;# example:&lt;&#x2F;em&gt; &lt;code&gt;foobox.home.arpa&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Set Installation Type: &lt;code&gt;Packages (Tech Preview)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Network or Offline Installation: &lt;code&gt;Network&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Network Configuration: &lt;code&gt;[ethernet interface]&lt;&#x2F;code&gt; and &lt;code&gt;Auto&lt;&#x2F;code&gt;   &lt;em&gt;# example: Intel network device&lt;&#x2F;em&gt; &lt;code&gt;em0&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Partitioning: &lt;code&gt;Auto (ZFS) Guided Root-on-ZFS&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;ZFS Configuration:
&lt;ul&gt;
&lt;li&gt;Pool Type&#x2F;Disks:  &lt;code&gt;stripe: 1 disk&lt;&#x2F;code&gt;   # &lt;code&gt;[*] ada0&lt;&#x2F;code&gt; &lt;em&gt;for SATA and&lt;&#x2F;em&gt; &lt;code&gt;[*] nda0&lt;&#x2F;code&gt; &lt;em&gt;for NVME&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Pool Name         &lt;code&gt;zroot&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Force 4K Sectors? &lt;code&gt;YES&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Encrypt Disks?    &lt;code&gt;YES&lt;&#x2F;code&gt;   # &lt;em&gt;for desktop; if setting up a server select&lt;&#x2F;em&gt; &lt;code&gt;NO&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Partition Scheme? &lt;code&gt;GPT (UEFI)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Swap Size         &lt;code&gt;16g&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Mirror Swap?      &lt;code&gt;NO&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Encrypt Swap?     &lt;code&gt;YES&lt;&#x2F;code&gt;   # &lt;em&gt;for desktop; if setting up a server select&lt;&#x2F;em&gt; &lt;code&gt;NO&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Select &lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Install     Proceed with Installation&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Select &lt;code&gt;YES&lt;&#x2F;code&gt; to destroy current contents of target disk&lt;&#x2F;li&gt;
&lt;li&gt;(If choosing to encrypt) Enter encryption passphrase. Retype to confirm.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Select System Components:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[x] base&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[*] kernel-dbg&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[*] lib32&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Set root password. Retype to confirm.&lt;&#x2F;li&gt;
&lt;li&gt;Time Zone Selector: &lt;code&gt;[region]&lt;&#x2F;code&gt;   &lt;em&gt;# example:&lt;&#x2F;em&gt; &lt;code&gt;America - Canada - Eastern - ON &amp;amp; QC (EDT)&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Time and Date:
&lt;ul&gt;
&lt;li&gt;Date: &lt;code&gt;Skip&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Time: &lt;code&gt;Skip&lt;&#x2F;code&gt;   &lt;em&gt;# NTP will set on reboot&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Services to be started at boot:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[*] sshd&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[*] ntpd&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[*] powerd&lt;&#x2F;code&gt;   &lt;em&gt;# for laptops&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;[*] dumpdev&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;System hardening:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;[*] clear_tmp&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Firmware installation: &lt;code&gt;[package(s)]&lt;&#x2F;code&gt;   &lt;em&gt;# install packages if available&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Add user account? &lt;code&gt;Yes&lt;&#x2F;code&gt;
&lt;ul&gt;
&lt;li&gt;Username: &lt;code&gt;[username]&lt;&#x2F;code&gt;   &lt;em&gt;# example:&lt;&#x2F;em&gt; &lt;code&gt;foo&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Full name: &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Uid: &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Login group: &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Other groups?: &lt;code&gt;wheel&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Login class: &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Shell: &lt;code&gt;sh&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Home directory: &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Home directory permissions: &lt;code&gt;&amp;lt;enter&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Enable ZFS encryption? &lt;code&gt;no&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Use password-based authentication? &lt;code&gt;yes&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Use an empty password? &lt;code&gt;no&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Use a random password? &lt;code&gt;no&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Enter password. Retype to confirm.&lt;&#x2F;li&gt;
&lt;li&gt;Lock out account after creation? &lt;code&gt;no&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;OK? &lt;code&gt;yes&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Add another user? &lt;code&gt;no&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;Final configuration: &lt;code&gt;Finish    Apply configuration and exit installer&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Manual configuration: &lt;code&gt;No&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Complete: &lt;code&gt;Reboot&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;If encrypt disk was set to &lt;code&gt;YES&lt;&#x2F;code&gt;, the system will prompt for the passphrase. Regardless of the keymap set during install, enter the correct passphrase referencing the &lt;code&gt;US&lt;&#x2F;code&gt; keymap:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;GELI Passphrase for &amp;lt;disk&amp;gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Upon success, boot resumes…&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;FreeBSD&#x2F;amd64 (foobox.home.arpa) (ttyv0)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;login: root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Password:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Welcome to FreeBSD!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;To shutdown and poweroff the system:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;shutdown -p now&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Next:&lt;&#x2F;strong&gt; &lt;a href=&quot;&#x2F;freebsd-after-install&quot;&gt;FreeBSD: After the First Boot&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p class=&quot;mastodon&quot;&gt;
You can like, share, or comment on this post &lt;a href=&quot;https:&#x2F;&#x2F;fosstodon.org&#x2F;@dwarmstrong&#x2F;116252354471681551&quot; target=&quot;_blank&quot;&gt;on Mastodon&lt;&#x2F;a&gt; &amp;#128172
&lt;&#x2F;p&gt;
</description>
    </item>
    <item>
      <title>Virtualization in Debian Using KVM + QEMU + Libvirt</title>
      <pubDate>Fri, 07 Aug 2026 00:00:00 +0000</pubDate>
      <link>https://www.dwarmstrong.org/lmde-libvirt/</link>
      <guid>https://www.dwarmstrong.org/lmde-libvirt/</guid>
      <description>&lt;p&gt;Set up a stack of virtualization tools on a &lt;strong&gt;Debian&lt;&#x2F;strong&gt; host for creating and managing virtual machines (VMs).&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#start-here&quot;&gt;Start Here&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#directories&quot;&gt;Directories&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#permissions&quot;&gt;Permissions&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#services&quot;&gt;Services&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#create-vm&quot;&gt;Create VM&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#resize-vm-guest-window&quot;&gt;Resize VM guest window&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#video-acceleration&quot;&gt;Video Acceleration&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#virsh-and-virt-clone&quot;&gt;Virsh and virt-clone&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;lmde-libvirt&#x2F;#resources&quot;&gt;Resources&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;start-here&quot;&gt;Start Here&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Kernel-based_Virtual_Machine&quot;&gt;KVM&lt;&#x2F;a&gt; (Kernel-based Virtual Machine) is built into the Linux kernel and handles the CPU and memory details. &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;QEMU&quot;&gt;QEMU&lt;&#x2F;a&gt; (Quick EMUlator) emulates the various hardware components of a physical machine. Finally, &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Libvirt&quot;&gt;libvirt&lt;&#x2F;a&gt; provides the tools for creating and managing VMs. I use &lt;code&gt;virt-manager&lt;&#x2F;code&gt; and &lt;code&gt;virsh&lt;&#x2F;code&gt; as graphical and console interfaces respectively.&lt;&#x2F;p&gt;
&lt;p&gt;First, check whether the host computer’s CPU supports virtualization:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;egrep -c &amp;#39;(vmx|svm)&amp;#39; &#x2F;proc&#x2F;cpuinfo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;A result of &lt;code&gt;1&lt;&#x2F;code&gt; or more means the CPU supports virtualization extensions. A result of &lt;code&gt;0&lt;&#x2F;code&gt; means it does not, though double-check the BIOS and see if the extensions are available and just need to be enabled.&lt;&#x2F;p&gt;
&lt;p&gt;Install packages:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo apt install qemu-system-x86 libvirt-clients libvirt-daemon libvirt-daemon-system virtinst virt-manager bridge-utils&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add my user to the &lt;code&gt;kvm&lt;&#x2F;code&gt;, &lt;code&gt;libvirt&lt;&#x2F;code&gt;, and &lt;code&gt;libvirt-qemu&lt;&#x2F;code&gt; groups:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo adduser $USER kvm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo adduser $USER libvirt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo adduser $USER libvirt-qemu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Log out and back in.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;directories&quot;&gt;Directories&lt;&#x2F;h2&gt;
&lt;p&gt;Default directory to hold VM images is &lt;code&gt;&#x2F;var&#x2F;lib&#x2F;libvirt&#x2F;images&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The large amounts of space that these VM images occupy might pose an issue if &lt;code&gt;&#x2F;var&lt;&#x2F;code&gt; is mounted separately, or its included with the &lt;code&gt;root&lt;&#x2F;code&gt; directory on a relatively small partition (i.e. separate &lt;code&gt;root&lt;&#x2F;code&gt; and &lt;code&gt;home&lt;&#x2F;code&gt; partitions). If this is the case, consider storing VMs on the partition with the greatest amount of free storage and symlink to that location.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a href=&quot;&#x2F;lmde-install-expert-mode&#x2F;&quot;&gt;My installation of LMDE&lt;&#x2F;a&gt; has a large, separate partition for my &lt;code&gt;home&lt;&#x2F;code&gt;, so I create a &lt;code&gt;vm&lt;&#x2F;code&gt; directory there to store the VM images:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir -p ~&#x2F;vm&#x2F;images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Delete the existing (empty) &lt;code&gt;images&lt;&#x2F;code&gt; directory and create a symlink to the new location in &lt;code&gt;vm&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo rmdir &#x2F;var&#x2F;lib&#x2F;libvirt&#x2F;images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo ln -s ~&#x2F;vm&#x2F;images &#x2F;var&#x2F;lib&#x2F;libvirt&#x2F;images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I also create an &lt;code&gt;iso&lt;&#x2F;code&gt; directory to store Linux install images:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir ~&#x2F;vm&#x2F;iso&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;permissions&quot;&gt;Permissions&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;libvirt-conf&quot;&gt;libvirt.conf&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir ~&#x2F;.config&#x2F;libvirt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cp &#x2F;etc&#x2F;libvirt&#x2F;libvirt.conf ~&#x2F;.config&#x2F;libvirt&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Open the file for editing and uncomment:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;uri_default = &amp;quot;qemu:&#x2F;&#x2F;&#x2F;system&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;qemu-conf&quot;&gt;qemu.conf&lt;&#x2F;h3&gt;
&lt;p&gt;For storage file permissions, modify &lt;code&gt;&#x2F;etc&#x2F;libvirt&#x2F;qemu.conf&lt;&#x2F;code&gt; by setting &lt;code&gt;user&lt;&#x2F;code&gt; to my username (example: &lt;code&gt;foo&lt;&#x2F;code&gt;) and &lt;code&gt;group&lt;&#x2F;code&gt; to &lt;code&gt;libvirt-qeumu&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;user = &amp;quot;foo&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;group = &amp;quot;libvirt-qemu&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;services&quot;&gt;Services&lt;&#x2F;h2&gt;
&lt;p&gt;Start the &lt;code&gt;libvirt&lt;&#x2F;code&gt; service:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo systemctl start libvirtd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;systemctl status libvirtd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;create-vm&quot;&gt;Create VM&lt;&#x2F;h2&gt;
&lt;p&gt;Create a VM using &lt;code&gt;virt-manager&lt;&#x2F;code&gt;. Click the &lt;code&gt;+&lt;&#x2F;code&gt; icon to add a new VM, and work through the series of dialog boxes to configure.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;virt-manager-2.png&quot; alt=&quot;virt-manager&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;During the creation of a VM, the network selection option defaults to &lt;code&gt;Virtual network &#x27;default&#x27;: NAT&lt;&#x2F;code&gt;. If the &lt;code&gt;default&lt;&#x2F;code&gt; network is not active, &lt;code&gt;virt-manager&lt;&#x2F;code&gt; will prompt to start it.&lt;&#x2F;p&gt;
&lt;p&gt;Or start manually with:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;virsh net-start default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Each VM (in &lt;code&gt;default&lt;&#x2F;code&gt; network) will be a member of &lt;code&gt;192.168.122.0&#x2F;24&lt;&#x2F;code&gt;, with an IP address in the range of &lt;code&gt;192.168.122.2&lt;&#x2F;code&gt; to &lt;code&gt;192.168.122.254&lt;&#x2F;code&gt;, and are accessible via SSH from the host.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;resize-vm-guest-window&quot;&gt;Resize VM guest window&lt;&#x2F;h2&gt;
&lt;p&gt;In the virt-manager console window, navigate to &lt;code&gt;Edit-&amp;gt;Preferences-&amp;gt;Console&lt;&#x2F;code&gt; and set:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Graphical console scaling&lt;&#x2F;code&gt; to &lt;code&gt;Always&lt;&#x2F;code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Resize guest with window&lt;&#x2F;code&gt; to &lt;code&gt;On&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Install a &lt;strong&gt;spice agent&lt;&#x2F;strong&gt; inside a VM (example: for Debian and Debian-based VMs):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo apt install spice-vdagent&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reboot the VM.&lt;&#x2F;p&gt;
&lt;p&gt;In the VM guest window, navigate to &lt;code&gt;View-&amp;gt;Scale display&lt;&#x2F;code&gt; and check &lt;code&gt;Always&lt;&#x2F;code&gt; and &lt;code&gt;Auto resize VM with window&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Now click-and-drag the window edge to resize display, or use &lt;code&gt;xrandr&lt;&#x2F;code&gt; to set display size.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;video-acceleration&quot;&gt;Video acceleration&lt;&#x2F;h2&gt;
&lt;p&gt;Using &lt;strong&gt;VirtIO&lt;&#x2F;strong&gt; its possible to create a virtual 3D accelerated GPU and pass through the hardware capabilities of the VM host’s graphics card.&lt;&#x2F;p&gt;
&lt;p&gt;With the VM shutdown, open the VM hardware details window. Click on &lt;code&gt;Video Virtio&lt;&#x2F;code&gt; and set &lt;code&gt;Model: Virtio&lt;&#x2F;code&gt;, check the box for &lt;code&gt;3D acceleration&lt;&#x2F;code&gt;, and &lt;code&gt;Apply&lt;&#x2F;code&gt; the modifications.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;video-virtio.png&quot; alt=&quot;video-virtio&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Click on &lt;code&gt;Display Spice&lt;&#x2F;code&gt;, set &lt;code&gt;Type: Spice Server&lt;&#x2F;code&gt; and &lt;code&gt;Listen type: None&lt;&#x2F;code&gt;, check the box for &lt;code&gt;OpenGL&lt;&#x2F;code&gt;, and &lt;code&gt;Apply&lt;&#x2F;code&gt; the modifications.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;img&#x2F;spice-opengl.png&quot; alt=&quot;spice-opengl&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;virsh-and-virt-clone&quot;&gt;Virsh and virt-clone&lt;&#x2F;h2&gt;
&lt;p&gt;Some useful commands:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Start network: &lt;code&gt;virsh net-start &amp;lt;network_name&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;List networks: &lt;code&gt;virsh net-list&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;List of VMs: &lt;code&gt;virsh list --all&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Start, reboot, and shutdown VM: &lt;code&gt;virsh start &amp;lt;VM&amp;gt;&lt;&#x2F;code&gt;, &lt;code&gt;virsh reboot &amp;lt;VM&amp;gt;&lt;&#x2F;code&gt;, and &lt;code&gt;virsh shutdown &amp;lt;VM&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Show IP addresses: &lt;code&gt;virsh net-dhcp-leases &amp;lt;network_name&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Clone VM and create storage image: &lt;code&gt;virt-clone -o &amp;lt;VM&amp;gt; -n &amp;lt;new_VM&amp;gt; -f &#x2F;var&#x2F;lib&#x2F;libvirt&#x2F;images&#x2F;&amp;lt;new_VM&amp;gt;.qcow2&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;Arch Linux Wiki: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Libvirt&quot;&gt;libvirt&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ryan.himmelwright.net&#x2F;post&#x2F;virtio-3d-vms&#x2F;&quot;&gt;Running VMs with VirtIO 3D Acceleration&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p class=&quot;mastodon&quot;&gt;
You can like, share, or comment on this post &lt;a href=&quot;https:&#x2F;&#x2F;fosstodon.org&#x2F;@dwarmstrong&#x2F;117054266631683629&quot; target=&quot;_blank&quot;&gt;on the Fediverse&lt;&#x2F;a&gt; &amp;#128172
&lt;&#x2F;p&gt;
</description>
    </item>
    <item>
      <title>NetBSD 11.0 Installation with Disk Encryption</title>
      <pubDate>Thu, 06 Aug 2026 00:00:00 +0000</pubDate>
      <link>https://www.dwarmstrong.org/netbsd-encrypt-install/</link>
      <guid>https://www.dwarmstrong.org/netbsd-encrypt-install/</guid>
      <description>&lt;p&gt;The first time I installed &lt;a href=&quot;&#x2F;netbsd-install&#x2F;&quot;&gt;NetBSD&lt;&#x2F;a&gt; I used &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;man.netbsd.org&#x2F;sysinst.8&quot;&gt;sysinst(8)&lt;&#x2F;a&gt;, a menu-based program launched at boot that runs in the console. It has a clear and concise layout and I was quickly up-and-running on my new &lt;a href=&quot;&#x2F;tags&#x2F;bsd&quot;&gt;BSD&lt;&#x2F;a&gt; system.&lt;&#x2F;p&gt;
&lt;p&gt;For my &lt;strong&gt;next&lt;&#x2F;strong&gt; install I wanted to include &lt;strong&gt;disk encryption&lt;&#x2F;strong&gt; to protect personal data in case the device is lost or stolen. Its not really enough to simply encrypt home directories. Passphrases and sensitive data can linger and be extracted from locations such as system logs and swap memory. There is a trade-off to be made between how much to encrypt, the convenience of operating the system, and the ability for the system to boot.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#start-here&quot;&gt;Start Here&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#acquire-an-installation-image&quot;&gt;Acquire an installation image&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#prepare-the-usb-installation-medium&quot;&gt;Prepare the USB installation medium&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#configure-the-live-environment&quot;&gt;Configure the Live Environment&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#connect-to-the-internet&quot;&gt;Connect to the internet&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#remote-login-to-the-installer&quot;&gt;Remote login to the installer&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#prepare-the-disk&quot;&gt;Prepare the DISK&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#identify-disks-and-partitions&quot;&gt;Identify disks and partitions&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#define-disk-variable&quot;&gt;Define DISK variable&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#wipe-disk&quot;&gt;Wipe DISK&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#partition-disk&quot;&gt;Partition DISK&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#define-wedge-variables&quot;&gt;Define wedge variables&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#format-and-mount-the-esp-wedge&quot;&gt;Format and mount the ESP wedge&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#add-efi-boot-entries-to-esp&quot;&gt;Add EFI boot entries to ESP&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#format-and-mount-the-root-wedge&quot;&gt;Format and mount the root wedge&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#disk-encryption&quot;&gt;Disk Encryption&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#create-encrypted-device&quot;&gt;Create encrypted device&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#create-disklabels&quot;&gt;Create disklabels&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#verify-encrypted-device&quot;&gt;Verify encrypted device&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#format-and-mount-disklabels&quot;&gt;Format and mount disklabels&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#installation&quot;&gt;Installation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#configure-the-system&quot;&gt;Configure the System&lt;&#x2F;a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#chroot&quot;&gt;Chroot&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#directories&quot;&gt;Directories&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#devices&quot;&gt;Devices&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#root-password&quot;&gt;Root password&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#superuser&quot;&gt;Superuser&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#fstab&quot;&gt;Fstab&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#startup&quot;&gt;Startup&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#keyboard&quot;&gt;Keyboard&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#timezone&quot;&gt;Timezone&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#network-interface&quot;&gt;Network interface&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#terminals&quot;&gt;Terminals&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#finish-up&quot;&gt;Finish Up&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;www.dwarmstrong.org&#x2F;netbsd-encrypt-install&#x2F;#resources&quot;&gt;Resources&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;start-here&quot;&gt;Start Here&lt;&#x2F;h2&gt;
&lt;p&gt;Throughout this HOWTO, if you see square brackets &lt;code&gt;[]&lt;&#x2F;code&gt; in code blocks, that means the word of code (square brackets included) should be replaced with something else. This is detailed in the instructions before or after the code block.&lt;&#x2F;p&gt;
&lt;p&gt;NetBSD will be installed as the sole operating system on a single disk using a four-partition layout:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Partition &lt;code&gt;ESP&lt;&#x2F;code&gt; is the EFI system partition.&lt;&#x2F;li&gt;
&lt;li&gt;Partition &lt;code&gt;root&lt;&#x2F;code&gt; hosts a minimal root filesystem that boots to an encryption passphrase prompt, which upon entry unlocks…&lt;&#x2F;li&gt;
&lt;li&gt;… the encrypted device on partition &lt;code&gt;syscgd&lt;&#x2F;code&gt; containing the contents of &lt;code&gt;var&lt;&#x2F;code&gt;, &lt;code&gt;usr&lt;&#x2F;code&gt;, and &lt;code&gt;home&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Partition &lt;code&gt;swap&lt;&#x2F;code&gt; is swap memory auto-encrypted at boot using a random key.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;A few assumptions:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Target device is &lt;code&gt;amd64&lt;&#x2F;code&gt; architecture using UEFI to boot.&lt;&#x2F;li&gt;
&lt;li&gt;Secure boot is disabled on target device.&lt;&#x2F;li&gt;
&lt;li&gt;Network access during install uses a wired interface.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Sysinst does not provide the option for encrypting the system in this manner, so early in the install process I switch to the console and proceed to manually install NetBSD.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;acquire-an-installation-image&quot;&gt;Acquire an installation image&lt;&#x2F;h3&gt;
&lt;p&gt;The latest official installation images (as of August 2026) are available here: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;cdn.netbsd.org&#x2F;pub&#x2F;NetBSD&#x2F;images&#x2F;11.0&#x2F;&quot;&gt;Images and torrents&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Download the &lt;code&gt;NetBSD-11.0-amd64-install.img.gz&lt;&#x2F;code&gt; image and the &lt;code&gt;SHA512&lt;&#x2F;code&gt; file for verification:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;wget https:&#x2F;&#x2F;cdn.netbsd.org&#x2F;pub&#x2F;NetBSD&#x2F;images&#x2F;11.0&#x2F;NetBSD-11.0-amd64-install.img.gz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;wget https:&#x2F;&#x2F;cdn.netbsd.org&#x2F;pub&#x2F;NetBSD&#x2F;images&#x2F;11.0&#x2F;SHA512&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify the image using &lt;code&gt;sha512sum&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sha512sum -c --ignore-missing SHA512 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Decompress the image:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gunzip NetBSD-11.0-amd64-install.img.gz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;prepare-the-usb-installation-medium&quot;&gt;Prepare the USB installation medium&lt;&#x2F;h3&gt;
&lt;p&gt;Write the installer to an &lt;strong&gt;unmounted&lt;&#x2F;strong&gt; USB storage device running the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;man.netbsd.org&#x2F;dd.1&quot;&gt;dd(1)&lt;&#x2F;a&gt; command as &lt;code&gt;root&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;WARNING&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
&lt;strong&gt;Be very careful to note the proper device (which can be identified with &lt;code&gt;lsblk&lt;&#x2F;code&gt;). All contents on the device will be lost!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Example: On a Linux system, if a USB stick appears as &lt;code&gt;sdx1&lt;&#x2F;code&gt;, then write the installer to &lt;code&gt;sdx&lt;&#x2F;code&gt; (omit partition number):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dd bs=4M conv=fsync oflag=direct status=progress if=NetBSD-11.0-amd64-install.img of=&#x2F;dev&#x2F;sdx&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;configure-the-live-environment&quot;&gt;Configure the Live Environment&lt;&#x2F;h2&gt;
&lt;p&gt;Boot the target device from the NetBSD installation medium. Select Option &lt;code&gt;1&lt;&#x2F;code&gt; (default) to &lt;code&gt;Install NetBSD&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;After the installer has successfully booted into the NetBSD kernel, a prompt appears to select which &lt;strong&gt;language&lt;&#x2F;strong&gt; will be used for installation messages, followed by a prompt to select a different &lt;strong&gt;keyboard type&lt;&#x2F;strong&gt; if desired or leave unchanged.&lt;&#x2F;p&gt;
&lt;p&gt;Next up the menu-based &lt;strong&gt;sysinst&lt;&#x2F;strong&gt; program is launched:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NetBSD-11.0 Install System&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt;a: Install NetBSD to hard disk&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; b: Upgrade NetBSD on a hard disk&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; c: Re-install sets or install additional sets&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; d: Reboot the computer&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; e: Utility menu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; f: Config menu&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; x: Exit Install System&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;connect-to-the-internet&quot;&gt;Connect to the internet&lt;&#x2F;h3&gt;
&lt;p&gt;At the &lt;code&gt;Install System&lt;&#x2F;code&gt; main menu, select &lt;code&gt;&amp;gt;e: Utility menu&lt;&#x2F;code&gt; then &lt;code&gt;&amp;gt;c: Configure network&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;Available interfaces&lt;&#x2F;code&gt; lists the network interfaces detected by the NetBSD installer.&lt;&#x2F;p&gt;
&lt;p&gt;Example: With my target device &lt;code&gt;Available interfaces&lt;&#x2F;code&gt; lists two: &lt;code&gt;wm0&lt;&#x2F;code&gt; (wired) and &lt;code&gt;iwn0&lt;&#x2F;code&gt; (wireless). I choose to configure the wired ethernet interface:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Network media (empty to autoconfigure) [autoselect]: &amp;lt;enter&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Perform autoconfiguration?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt;a: Yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Your host name: foobox&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Your DNS domain: home.arpa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;The following are the values you entered.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[...]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Are they OK?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt;a: Yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;remote-login-to-the-installer&quot;&gt;Remote login to the installer&lt;&#x2F;h3&gt;
&lt;p&gt;Make this manual installation process easier (i.e. cut-n-paste commands) by remotely logging into the installer via &lt;code&gt;ssh&lt;&#x2F;code&gt; from another computer.&lt;&#x2F;p&gt;
&lt;p&gt;Open a shell by selecting &lt;code&gt;&amp;gt;a: Run &#x2F;bin&#x2F;sh&lt;&#x2F;code&gt; from the &lt;code&gt;Utilities&lt;&#x2F;code&gt; menu.&lt;&#x2F;p&gt;
&lt;p&gt;Set a password for &lt;code&gt;root&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;passwd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Open the &lt;code&gt;sshd_config&lt;&#x2F;code&gt; file for editing using the &lt;code&gt;vi&lt;&#x2F;code&gt; editor:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi &#x2F;etc&#x2F;ssh&#x2F;sshd_config&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Set permission to allow &lt;code&gt;root&lt;&#x2F;code&gt; to login:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PermitRootLogin yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;Start the &lt;code&gt;sshd&lt;&#x2F;code&gt; daemon:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;etc&#x2F;rc.d&#x2F;sshd onestart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Retrieve the IP address for the active interface configured earlier (example: &lt;code&gt;wm0&lt;&#x2F;code&gt;):&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ifconfig wm0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Switch to the other computer and &lt;code&gt;ssh&lt;&#x2F;code&gt; into the target device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ssh root@[ip_address]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;…where &lt;code&gt;[ip_address]&lt;&#x2F;code&gt; is the target device’s address obtained with the &lt;code&gt;ifconfig&lt;&#x2F;code&gt; command above.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;prepare-the-disk&quot;&gt;Prepare the DISK&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
For the purposes of this HOWTO, the example target device has a single NVMe disk with an existing install of &lt;a href=&quot;&#x2F;tags&#x2F;linux&quot;&gt;Linux&lt;&#x2F;a&gt; that will be erased and replaced by NetBSD. Device IDs and storage sizes will vary between devices.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;identify-disks-and-partitions&quot;&gt;Identify disks and partitions&lt;&#x2F;h3&gt;
&lt;p&gt;Discover what disk devices and partitions have been recognized by the kernel:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# sysctl hw.disknames&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;hw.disknames = ld0 dk0 dk1 dk2 dk3 sd0 dk4 dk5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;NVMe devices show up as &lt;code&gt;ld&lt;&#x2F;code&gt; and hard disks are identified by &lt;code&gt;wd&lt;&#x2F;code&gt;. USB devices usually show up as &lt;code&gt;sd&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;code&gt;dk&lt;&#x2F;code&gt; devices are partitions (know as &lt;strong&gt;wedges&lt;&#x2F;strong&gt; in NetBSD parlance) on the storage devices, and this early after boot are usually displayed in order, that is: &lt;code&gt;dk0&lt;&#x2F;code&gt; through &lt;code&gt;dk3&lt;&#x2F;code&gt; are wedges on the NVMe target device &lt;code&gt;ld0&lt;&#x2F;code&gt;, and &lt;code&gt;dk4&lt;&#x2F;code&gt; and &lt;code&gt;dk5&lt;&#x2F;code&gt; on the USB installer &lt;code&gt;sd0&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Verify by asking for a list of wedges on &lt;code&gt;sd0&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# dkctl sd0 listwedges&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;rsd0: 2 wedges:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dk4: EFI system, 262144 blocks at 2048, type: msdos&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dk5: 30c4cc4e-5369-449c-8994-a4b1ea665b4b, 4853760 blocks at 264192, type: ffs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify which device the installer booted from:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# dmesg | fgrep &amp;quot;root on&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[     4.158650] root on dk5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;define-disk-variable&quot;&gt;Define DISK variable&lt;&#x2F;h3&gt;
&lt;p&gt;The NVMe storage device detected above as &lt;code&gt;ld0&lt;&#x2F;code&gt; is where NetBSD will be installed. Adjust accordingly for your own storage device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DISK=&amp;quot;ld0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;wipe-disk&quot;&gt;Wipe DISK&lt;&#x2F;h3&gt;
&lt;p&gt;Wipe existing file systems and partition table on DISK:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt destroy $DISK &amp;amp;&amp;amp; gpt show $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;partition-disk&quot;&gt;Partition DISK&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
I typically set the swap partition size equal to the amount of physical RAM to a maximum &lt;code&gt;8g&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Create a GPT partition table on DISK with the following layout:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center&quot;&gt;Number&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: center&quot;&gt;Size&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: center&quot;&gt;Type&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: center&quot;&gt;Use as&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;1&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;550m&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;efi&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;ESP partition&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;2&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;6g&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;ffs&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;Root partition&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;3&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;8g&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;swap&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;Encrypted swap partition&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;4&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;-&amp;gt;END&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;cgd&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;Encrypted system partition&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Create a new GPT partition table:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt create -f $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create the wedges:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt add -l &amp;quot;ESP&amp;quot; -t efi -s 550m $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt add -l &amp;quot;root&amp;quot; -t ffs -s 6g $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt add -l &amp;quot;swap&amp;quot; -t swap -s 8g $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt add -l &amp;quot;syscgd&amp;quot; -t cgd $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;gpt show $DISK&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;define-wedge-variables&quot;&gt;Define wedge variables&lt;&#x2F;h3&gt;
&lt;p&gt;List wedges:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# dkctl $DISK listwedges&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;rld0: 4 wedges:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dk2: ESP, 524288 blocks at 34, type: msdos&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dk3: root, 16777216 blocks at 524322, type: ffs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dk4: swap, 33554432 blocks at 17301538, type: swap&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dk5: syscgd, 1902669165 blocks at 50855970, type: cgd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Your &lt;code&gt;dk[number]&lt;&#x2F;code&gt; numbering may differ from above. Adjust accordingly:&lt;&#x2F;p&gt;
&lt;p&gt;Define variables:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DK_ESP=&amp;quot;dk2&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;DK_ROOT=&amp;quot;dk3&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;format-and-mount-the-esp-wedge&quot;&gt;Format and mount the ESP wedge&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;newfs_msdos &#x2F;dev&#x2F;r${DK_ESP} &amp;amp;&amp;amp; mount &#x2F;dev&#x2F;${DK_ESP} &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;add-efi-boot-entries-to-esp&quot;&gt;Add EFI boot entries to ESP&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir -p &#x2F;mnt&#x2F;EFI&#x2F;boot &amp;amp;&amp;amp; cp -v &#x2F;usr&#x2F;mdec&#x2F;*.efi &#x2F;mnt&#x2F;EFI&#x2F;boot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Unmount wedge:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;umount &#x2F;mnt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;format-and-mount-the-root-wedge&quot;&gt;Format and mount the root wedge&lt;&#x2F;h3&gt;
&lt;p&gt;Format and mount the root wedge with the &lt;code&gt;FFSv2&lt;&#x2F;code&gt; file system with support for extended attributes and access control lists:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;newfs -O 2ea &#x2F;dev&#x2F;r${DK_ROOT} &amp;amp;&amp;amp; mount &#x2F;dev&#x2F;${DK_ROOT} &#x2F;targetroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;disk-encryption&quot;&gt;Disk Encryption&lt;&#x2F;h2&gt;
&lt;p&gt;NetBSD uses the &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.netbsd.org&#x2F;docs&#x2F;guide&#x2F;en&#x2F;chap-cgd.html&quot;&gt;cryptographic device driver&lt;&#x2F;a&gt; (CGD) to create and manage encrypted devices.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;create-encrypted-device&quot;&gt;Create encrypted device&lt;&#x2F;h3&gt;
&lt;p&gt;Using &lt;code&gt;cgdconfig&lt;&#x2F;code&gt;, a parameters file is generated that stores the encryption type, key length, and a random password salt for the new encrypted device.&lt;&#x2F;p&gt;
&lt;p&gt;There are a few &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.netbsd.org&#x2F;docs&#x2F;guide&#x2F;en&#x2F;chap-cgd.html#chap-cgd-components-ciphers&quot;&gt;different encryption ciphers supported&lt;&#x2F;a&gt;. I choose &lt;code&gt;aes-xts&lt;&#x2F;code&gt; with a 512-bit key:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir -p &#x2F;targetroot&#x2F;etc&#x2F;cgd &amp;amp;&amp;amp; chmod 700 &#x2F;targetroot&#x2F;etc&#x2F;cgd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cgdconfig -g -V disklabel -o &#x2F;targetroot&#x2F;etc&#x2F;cgd&#x2F;syscgd aes-xts 512&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
&lt;code&gt;NAME=syscgd&lt;&#x2F;code&gt; is the label for the CGD wedge created earlier.&lt;&#x2F;p&gt;
&lt;p&gt;Create the encrypted device and assign it a passphrase. This passphrase will be used to open the CGD device at boot:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cgdconfig -V re-enter cgd0 NAME=syscgd &#x2F;targetroot&#x2F;etc&#x2F;cgd&#x2F;syscgd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;create-disklabels&quot;&gt;Create disklabels&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Disklabels &lt;code&gt;c&lt;&#x2F;code&gt; and &lt;code&gt;d&lt;&#x2F;code&gt; have &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;man.netbsd.org&#x2F;disklabel.5&quot;&gt;special meaning in NetBSD&lt;&#x2F;a&gt; and should not be used.&lt;&#x2F;p&gt;
&lt;p&gt;Within the encrypted device, three disklabels are created:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: center&quot;&gt;Disklabel&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: center&quot;&gt;Mountpoint&lt;&#x2F;th&gt;&lt;th style=&quot;text-align: center&quot;&gt;Size&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;cgd0a&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;&#x2F;var&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;8G&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;cgd0b&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;&#x2F;usr&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;48G&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center&quot;&gt;cgd0e&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;&#x2F;home&lt;&#x2F;td&gt;&lt;td style=&quot;text-align: center&quot;&gt;-&amp;gt;END&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Create the labels using &lt;code&gt;disklabel&lt;&#x2F;code&gt; in interactive mode:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# disklabel -Ii cgd0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Enter &amp;#39;?&amp;#39; for help&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create &lt;code&gt;cgd0a&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;partition&amp;gt;a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Filesystem type [4.2BSD]: &amp;lt;enter&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Start offset (&amp;#39;x&amp;#39; to start after partition &amp;#39;x&amp;#39;) [0c, 0s, 0M]: &amp;lt;enter&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Partition size (&amp;#39;$&amp;#39; for all remaining) [947594c, 1940672512s, 947594M]: 8G&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  a: ...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create &lt;code&gt;cgd0b&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;partition&amp;gt;b&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Filesystem type [unused]: 4.2BSD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Start offset (&amp;#39;x&amp;#39; to start after partition &amp;#39;x&amp;#39;) [0c, 0s, 0M]: a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Partition size (&amp;#39;$&amp;#39; for all remaining) [0c, 0s, 0M]: 48G    &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  b: ...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Create &lt;code&gt;cgd0e&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;partition&amp;gt;e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Filesystem type [unused]: 4.2BSD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Start offset (&amp;#39;x&amp;#39; to start after partition &amp;#39;x&amp;#39;) [0c, 0s, 0M]: b&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Partition size (&amp;#39;$&amp;#39; for all remaining) [0c, 0s, 0M]: $&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; e: ...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Write the label and quit:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;partition&amp;gt;W&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Label disk [n]?y&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Label written&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;partition&amp;gt;Q&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;verify-encrypted-device&quot;&gt;Verify encrypted device&lt;&#x2F;h3&gt;
&lt;p&gt;Set configuration in target device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;echo &amp;#39;cgd0 NAME=syscgd &#x2F;etc&#x2F;cgd&#x2F;syscgd&amp;#39; &amp;gt; &#x2F;targetroot&#x2F;etc&#x2F;cgd&#x2F;cgd.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Close the CGD device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cgdconfig -u cgd0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Unlock the CGD device again with the passphrase set earlier:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cgdconfig cgd0 NAME=syscgd &#x2F;targetroot&#x2F;etc&#x2F;cgd&#x2F;syscgd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;cgd0&lt;&#x2F;code&gt; drive should now be open and the disklabel visible:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;disklabel cgd0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;format-and-mount-disklabels&quot;&gt;Format and mount disklabels&lt;&#x2F;h3&gt;
&lt;p&gt;Format:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;newfs -O 2ea cgd0a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;newfs -O 2ea cgd0b&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;newfs -O 2ea cgd0e&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Mount:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir &#x2F;targetroot&#x2F;var &#x2F;targetroot&#x2F;usr &#x2F;targetroot&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mount &#x2F;dev&#x2F;cgd0a &#x2F;targetroot&#x2F;var&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mount &#x2F;dev&#x2F;cgd0b &#x2F;targetroot&#x2F;usr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mount &#x2F;dev&#x2F;cgd0e &#x2F;targetroot&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;&#x2F;h2&gt;
&lt;p&gt;The new system is composed of &lt;strong&gt;sets&lt;&#x2F;strong&gt; (collections of packages) installed to the target device. These sets are located in &lt;code&gt;&#x2F;amd64&#x2F;binary&#x2F;sets&lt;&#x2F;code&gt;. Move into that directory:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cd &#x2F;amd64&#x2F;binary&#x2F;sets &amp;amp;&amp;amp; ls&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Adding flag &lt;code&gt;p&lt;&#x2F;code&gt; to the &lt;code&gt;tar&lt;&#x2F;code&gt; command is important. It ensures that all files preserve their &lt;code&gt;owners&lt;&#x2F;code&gt; and &lt;code&gt;mode&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;At a minimum, you must select a kernel and the &lt;code&gt;base&lt;&#x2F;code&gt; and &lt;code&gt;etc&lt;&#x2F;code&gt; sets. Below are the sets I choose to install for a desktop setup:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# for set in base comp etc games gpufw kern-GENERIC man misc modules rescue tests text xbase xcomp xetc xfont xserver; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; tar -xvzpf $set.tar.xz -C &#x2F;targetroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;gt; done&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;configure-the-system&quot;&gt;Configure the System&lt;&#x2F;h2&gt;
&lt;p&gt;Chroot into the freshly installed NetBSD and configure the new OS.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;chroot&quot;&gt;Chroot&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;chroot &#x2F;targetroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;directories&quot;&gt;Directories&lt;&#x2F;h3&gt;
&lt;p&gt;Create the &lt;code&gt;kern&lt;&#x2F;code&gt; and &lt;code&gt;proc&lt;&#x2F;code&gt; directories:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;mkdir kern proc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;devices&quot;&gt;Devices&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cd dev&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sh MAKEDEV all&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;On a previous install, after rebooting the boot process halted with the error message:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;etc&#x2F;defaults&#x2F;rc.conf: cannot create &#x2F;dev&#x2F;null: read-only file system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;etc&#x2F;rc: cannot create &#x2F;dev&#x2F;null: read-only file system&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;MAKEDEV&lt;&#x2F;code&gt; had created &lt;code&gt;null&lt;&#x2F;code&gt; but it was incorrectly configured:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# ls -l &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-r--r--  1 root  wheel  0 Aug  6 14:10 &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To avoid this error, remove the existing &lt;code&gt;null&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rm &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Re-create &lt;code&gt;null&lt;&#x2F;code&gt; with &lt;code&gt;mknod&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# mknod -m 0666 -u root -g wheel &#x2F;dev&#x2F;null c 2 2 &amp;amp;&amp;amp; ls -l &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;crw-rw-rw-  1 root  wheel  2, 2 Aug  6 14:12 &#x2F;dev&#x2F;null&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;root-password&quot;&gt;Root password&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;passwd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;superuser&quot;&gt;Superuser&lt;&#x2F;h3&gt;
&lt;p&gt;Create a user account assigned to the &lt;code&gt;wheel&lt;&#x2F;code&gt; and &lt;code&gt;operator&lt;&#x2F;code&gt; groups:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;useradd -G [groups] -m [username]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Example: Create an account for user &lt;code&gt;foo&lt;&#x2F;code&gt; and assign a password:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;useradd -G wheel,operator -m foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;passwd foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;userinfo foo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;fstab&quot;&gt;Fstab&lt;&#x2F;h3&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# cat &amp;gt; &#x2F;etc&#x2F;fstab &amp;lt;&amp;lt; EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NAME=root         &#x2F;         ffs     rw,log,noatime  	1 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NAME=swap         none      swap    sw,dp   		    0 0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;tmpfs             &#x2F;tmp      tmpfs   rw,-m1777,-sram%25&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;kernfs            &#x2F;kern     kernfs  rw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ptyfs             &#x2F;dev&#x2F;pts  ptyfs   rw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;procfs            &#x2F;proc     procfs  rw&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;tmpfs             &#x2F;var&#x2F;shm  tmpfs   rw,-m1777,-sram%25&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;cgd0a        &#x2F;var      ffs     rw,log,noatime      1 2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;cgd0b        &#x2F;usr      ffs     rw,log,noatime      1 2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;dev&#x2F;cgd0e        &#x2F;home     ffs     rw,log,noatime      1 2 &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;startup&quot;&gt;Startup&lt;&#x2F;h3&gt;
&lt;p&gt;Open &lt;code&gt;rc.conf&lt;&#x2F;code&gt; for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi &#x2F;etc&#x2F;rc.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
In this HOWTO, my hostname was earlier set to &lt;code&gt;foobox.home.arpa&lt;&#x2F;code&gt; during network setup, and my wired interface is &lt;code&gt;wm0&lt;&#x2F;code&gt;. Adjust accordingly:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# If this is not set to YES, the system will drop into single-user mode.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;rc_configured=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Add local overrides below.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# Wait for CGD to be unlocked before mounting.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;critical_filesystems_local=&amp;quot;OPTIONAL:&#x2F;var OPTIONAL:&#x2F;usr&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dhcpcd=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dhcpcd_flags=&amp;quot;-qM wm0&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;hostname=foobox.home.arpa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sshd=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ntpd=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ntpdate=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;wscons=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cgd=YES&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Any &lt;code&gt;Error: &#x2F;dev&#x2F;ttyp0: No such file or directory&lt;&#x2F;code&gt; messages can be safely ignored.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;keyboard&quot;&gt;Keyboard&lt;&#x2F;h3&gt;
&lt;p&gt;A full list of keyboard mappings and variants can be found in &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;man.netbsd.org&#x2F;wskbd.4&quot;&gt;wskbd(4)&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Set &lt;code&gt;encoding [type_of_keyboard]&lt;&#x2F;code&gt; in &lt;code&gt;wscons.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Open file for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi &#x2F;etc&#x2F;wscons.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Example: I use the non-default &lt;code&gt;colemak&lt;&#x2F;code&gt; keymap:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;encoding us.colemak&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;timezone&quot;&gt;Timezone&lt;&#x2F;h3&gt;
&lt;p&gt;Create a symlink to the appropriate timezone for your &lt;code&gt;localtime&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ln -sf &#x2F;usr&#x2F;share&#x2F;zoneinfo&#x2F;[region&#x2F;&amp;lt;city_or_sub-region] &#x2F;etc&#x2F;localtime&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Example: Set &lt;code&gt;localtime&lt;&#x2F;code&gt; to &lt;code&gt;Canada&#x2F;Eastern&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ln -sf &#x2F;usr&#x2F;share&#x2F;zoneinfo&#x2F;Canada&#x2F;Eastern &#x2F;etc&#x2F;localtime &amp;amp;&amp;amp; date&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;network-interface&quot;&gt;Network interface&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;man.netbsd.org&#x2F;ifconfig.if.5&quot;&gt;ifconfig.if(5)&lt;&#x2F;a&gt; contains the configuration details for each network interface.&lt;&#x2F;p&gt;
&lt;p&gt;Example: Create an interface file for the &lt;code&gt;wm0&lt;&#x2F;code&gt; interface that is assigned an IP address via DHCP:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# cat &amp;gt; &#x2F;etc&#x2F;ifconfig.wm0 &amp;lt;&amp;lt; EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;up&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;media autoselect&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;EOF&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;terminals&quot;&gt;Terminals&lt;&#x2F;h3&gt;
&lt;p&gt;Set the status of terminals &lt;code&gt;ttyE1-ttyE3&lt;&#x2F;code&gt; in &lt;code&gt;ttys&lt;&#x2F;code&gt; from &lt;code&gt;off&lt;&#x2F;code&gt; to &lt;code&gt;on&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Open file for editing:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;vi &#x2F;etc&#x2F;ttys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This is how it should look:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# name  getty                           type    status          comments&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;#&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;console &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty Pc&amp;quot;         wsvt25  off secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;constty &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty Pc&amp;quot;         wsvt25  on secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ttyE0   &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty Pc&amp;quot;         wsvt25  off secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ttyE1   &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty Pc&amp;quot;         wsvt25  on secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ttyE2   &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty Pc&amp;quot;         wsvt25  on secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ttyE3   &amp;quot;&#x2F;usr&#x2F;libexec&#x2F;getty Pc&amp;quot;         wsvt25  on secure&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Save changes and exit.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;finish-up&quot;&gt;Finish Up&lt;&#x2F;h2&gt;
&lt;p&gt;Exit chroot:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;exit&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cd &#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Unmount:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;umount &#x2F;targetroot&#x2F;home&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;umount &#x2F;targetroot&#x2F;usr&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;umount &#x2F;targetroot&#x2F;var&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;umount &#x2F;targetroot&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Close encrypted device:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;cgdconfig -u cgd0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reboot system:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;shutdown -r now&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
When prompted for the passphrase to unlock the encrypted device, keymap is &lt;code&gt;us qwerty&lt;&#x2F;code&gt; regardless of keymap that might have been set in &lt;code&gt;wscons.conf&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;User is prompted for the passphrase to unlock the encrypted &lt;code&gt;syscgd&lt;&#x2F;code&gt; device. Upon success, boot resumes:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;NetBSD&#x2F;amd64 (foobox.home.arpa) (constty)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;login: root&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Password:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;strong&gt;Welcome to NetBSD!&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;To shutdown&#x2F;poweroff the system:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #D8DEE9; background-color: #2E3440;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;shutdown -p now&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;This HOWTO posted by &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;vsis.online&#x2F;&quot;&gt;vsis&lt;&#x2F;a&gt; was crucial in getting my own system configured with encryption: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;vsis.online&#x2F;posts&#x2F;2024-05-27-uefi-full-disk-encryption&#x2F;&quot;&gt;NetBSD - UEFI installation with Full Disk Encryption&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Alternative approach for disk encryption using a ramdisk on BIOS boot systems: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.unitedbsd.com&#x2F;d&#x2F;461-netbsd-full-disk-encryption-with-cgd&quot;&gt;NetBSD Full-Disk Encryption with CGD (BIOS&#x2F;GPT)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;NetBSD INSTALL: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;ftp.netbsd.org&#x2F;pub&#x2F;NetBSD&#x2F;NetBSD-10.1&#x2F;amd64&#x2F;INSTALL.html&quot;&gt;Installation procedure for NetBSD&#x2F;amd64&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;NetBSD Wiki: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;wiki.netbsd.org&#x2F;Installation_on_UEFI_systems&#x2F;&quot;&gt;Installing NetBSD on a x86 system with UEFI&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;NetBSD Guide: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.netbsd.org&#x2F;docs&#x2F;guide&#x2F;en&#x2F;chap-cgd.html&quot;&gt;Chapter 14. The cryptographic device driver (CGD)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Suggested tools for inspecting disks: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.unitedbsd.com&#x2F;d&#x2F;1157-disk-management-from-installation-iso&quot;&gt;Disk management from Installation ISO&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Skipping sysinst install for a more “hands-on” approach: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.unitedbsd.com&#x2F;d&#x2F;771-netbsd-desktop-part-1-manual-netbsd-installation-on-gptuefi&quot;&gt;Manual NetBSD install on GPT&#x2F;UEFI&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Swap encryption is now automatic using the &lt;code&gt;vm.swap_encrypt=1&lt;&#x2F;code&gt; &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;man.netbsd.org&#x2F;sysctl.8&quot;&gt;sysctl(8)&lt;&#x2F;a&gt; variable: &lt;a rel=&quot;noopener external&quot; target=&quot;_blank&quot; href=&quot;https:&#x2F;&#x2F;www.netbsd.org&#x2F;releases&#x2F;formal-10&#x2F;NetBSD-10.0.html&quot;&gt;Announcing NetBSD 10.0&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p class=&quot;mastodon&quot;&gt;
You can like, share, or comment on this post &lt;a href=&quot;https:&#x2F;&#x2F;fosstodon.org&#x2F;@dwarmstrong&#x2F;117049190837209000&quot; target=&quot;_blank&quot;&gt;on the Fediverse&lt;&#x2F;a&gt; &amp;#128172
&lt;&#x2F;p&gt;
</description>
    </item>
</channel>
</rss>
