<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://blog.kaurin.cc/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.kaurin.cc/" rel="alternate" type="text/html" /><updated>2026-05-15T23:44:27+01:00</updated><id>https://blog.kaurin.cc/feed.xml</id><title type="html">Kaurin’s Paste Depository</title><subtitle>A place where i drop my technical bits and bobs</subtitle><author><name>Milos Kaurin</name></author><entry><title type="html">faster-whisper with Wyoming and GPU acceleration on Windows via Docker</title><link href="https://blog.kaurin.cc/ai/faster-whisper-with-wyoming-and-gpu-acceleration-on-windows-via-docker/" rel="alternate" type="text/html" title="faster-whisper with Wyoming and GPU acceleration on Windows via Docker" /><published>2025-10-24T21:50:00+01:00</published><updated>2025-10-24T21:50:00+01:00</updated><id>https://blog.kaurin.cc/ai/faster-whisper-with-wyoming-and-gpu-acceleration-on-windows-via-docker</id><content type="html" xml:base="https://blog.kaurin.cc/ai/faster-whisper-with-wyoming-and-gpu-acceleration-on-windows-via-docker/"><![CDATA[<p>Works on Windows, too!</p>

<h1 id="problem-statement">Problem statement</h1>

<p>I am setting up HomeAssistant’s VoiceAssistant feature. For it to function while being hosted locally, I need two components:</p>
<ul>
  <li>Text-to-speech (TTS): piper</li>
  <li>Automatic Speech Recognition (ASR): Wyoming + faster-whisper</li>
</ul>

<p>TTS is not much of a problem as it is not very demanding. It can be comfortably hosted even on Raspberry Pi 4 deployments.</p>

<p>For a quick and easy ASR, HomeAssistant has a native Whisper integration. Unfortunately:</p>
<ol>
  <li>My VM which hosts HomeAssistant does not have the CPU horsepower</li>
  <li>I don’t see mention of it supporting GPU acceleration</li>
</ol>

<p>There is another option: Add the Wyoming integration, and provide an address/port for a remotely hosted faster-whisper + wyoming server.</p>

<h1 id="obvious-but-less-optimal-solution">Obvious, but less optimal solution</h1>

<p>The more popular one I found is rhasspy’s <code class="language-plaintext highlighter-rouge">wyoming-faster-whisper</code> (<a href="https://github.com/rhasspy/wyoming-faster-whisper">github repo</a>). Unfortunately, it <a href="https://github.com/rhasspy/wyoming-faster-whisper/issues/35">does not have GPU support</a> as of writing this.</p>

<h1 id="a-linuxservers-hidden-gem">A linuxservers hidden gem</h1>

<p>Thankfully, linuxservers folks <a href="https://docs.linuxserver.io/images/docker-faster-whisper/">made their own</a> faster-whisper set of Docker images, one of which has GPU support!</p>

<p>I opted to use my Windows Gaming PC with an Nvidia graphics card to try it out. This involved:</p>
<ol>
  <li>Enabling virtualization for my AMD motherboard (AMD-V)</li>
  <li>Installing Docker on Windows - which will also install and update WSL2.</li>
  <li>Setting the Docker service to Automatic so it spins up the container back up after reboot</li>
  <li>Running the following:</li>
</ol>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="nt">-d</span> <span class="nt">--name</span><span class="o">=</span>faster-whisper-gpu <span class="nt">--gpus</span><span class="o">=</span>all <span class="nt">-e</span> <span class="nv">PUID</span><span class="o">=</span>1000 <span class="nt">-e</span> <span class="nv">PGID</span><span class="o">=</span>1000 <span class="nt">-e</span> <span class="nv">TZ</span><span class="o">=</span>Etc/UTC <span class="nt">-e</span> <span class="nv">WHISPER_MODEL</span><span class="o">=</span>turbo <span class="nt">-e</span> <span class="nv">WHISPER_LANG</span><span class="o">=</span>en <span class="nt">-p</span> 10300:10300 <span class="nt">-v</span> //d/whisper-data-dir:/config <span class="nt">--restart</span> unless-stopped lscr.io/linuxserver/faster-whisper:gpu
</code></pre></div></div>

<p>I have set my <code class="language-plaintext highlighter-rouge">D:\whisper-data-dir\</code> as the directory on the Windows host which contains the models, etc.</p>

<p>This setup works perfectly. I am not happy with hosting <em>anything</em> on Windows, but this will do for now.</p>

<h1 id="wishlist">Wishlist</h1>
<p>I wish ROCM image becomes available so I can try running linuxserver’s faster-whisper on my Kubernetes node which has a 8700G CPU+iGPU</p>]]></content><author><name>Milos Kaurin</name></author><category term="ai" /><category term="virtualization" /><category term="homeassistant" /><category term="windows" /><category term="gpu" /><category term="ai" /><summary type="html"><![CDATA[Works on Windows, too!]]></summary></entry><entry><title type="html">Batch delete CloudNativePG backups</title><link href="https://blog.kaurin.cc/kubernetes/batch-delete-cloudnative-pg-backups/" rel="alternate" type="text/html" title="Batch delete CloudNativePG backups" /><published>2025-08-31T01:50:00+01:00</published><updated>2026-05-02T23:52:00+01:00</updated><id>https://blog.kaurin.cc/kubernetes/batch-delete-cloudnative-pg-backups</id><content type="html" xml:base="https://blog.kaurin.cc/kubernetes/batch-delete-cloudnative-pg-backups/"><![CDATA[<p>This script is very destructive. Do not run unless you fully accept the risk.</p>

<h1 id="problem-statement">Problem statement</h1>

<p>I completely forgot that my snapshot-based CloudNativePG backups were piling up. To get rid of them I needed a script which I can run periodically to clean things up.</p>

<p>Public apology: The initially published script was copy/pasta from the initial AI output instead of the manually completed script. Apologies to those who wasted their time using a defunct piece of code.</p>

<h1 id="the-new-script">The (new) script</h1>

<p>Generated with AI but tested and hosted here:</p>

<p><a href="https://github.com/Kaurin/cnpg-backups-cleanup">https://github.com/Kaurin/cnpg-backups-cleanup</a></p>

<h1 id="notes">Notes:</h1>

<p>At the time of writing this, retention policy for CloudNativePG backups are <a href="https://cloudnative-pg.io/documentation/current/backup/">not implemented</a> for Volume-Snapshot-based backups.</p>]]></content><author><name>Milos Kaurin</name></author><category term="kubernetes" /><category term="bash" /><category term="cloudnative-pg" /><summary type="html"><![CDATA[This script is very destructive. Do not run unless you fully accept the risk.]]></summary></entry><entry><title type="html">Notes on Wireguard (with Mikrotik)</title><link href="https://blog.kaurin.cc/security/notes-on-wireguard/" rel="alternate" type="text/html" title="Notes on Wireguard (with Mikrotik)" /><published>2025-01-16T22:00:00+00:00</published><updated>2025-01-16T22:00:00+00:00</updated><id>https://blog.kaurin.cc/security/notes-on-wireguard</id><content type="html" xml:base="https://blog.kaurin.cc/security/notes-on-wireguard/"><![CDATA[<p>Some poorly researched notes on Wireguard. Updated on August 12th, 2025.</p>

<h1 id="background">Background</h1>

<p>I was resetting my Wireguard setup and I set out to do so with these goals in mind:</p>

<ol>
  <li>Star topology. My clients would connect to the router. The clients would not be able to talk to each other directly.</li>
  <li>Find a decent config generator</li>
  <li>Apply what the config generator spits out on my Mikrotik router and client devices</li>
  <li>The clients should route all traffic through the wireguard connection, not just specific subnets</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>             ┌─────────┐
      ┌──────┤ Router  ├──────┐
      │      └────┬────┘      │
      │           │           │ lan
 ─────┼───────────┼───────────┼─────
      │           │           │ internet
      │           │           │
 ┌────┴────┐ ┌────┴────┐ ┌────┴────┐
 │ Client1 │ │ Client2 │ │ Client3 │
 └─────────┘ └─────────┘ └─────────┘
</code></pre></div></div>

<h1 id="config-generator">Config generator</h1>

<p>I landed on this fairly obscure Python-based config generator called <a href="https://github.com/radupotop/wireguard-config-gen">wireguard-config-gen</a>. There are many of them out there, especially web based. I just wanted a nice CLI one.</p>

<p>I started off by defining the <code class="language-plaintext highlighter-rouge">interface.yaml</code>. It looked something like this:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">Dynamic</span><span class="pi">:</span>
  <span class="na">StartIP</span><span class="pi">:</span> <span class="s">192.168.50.2</span> <span class="c1"># Start IP for the clients</span>
  <span class="na">PrefixLen</span><span class="pi">:</span> <span class="m">32</span>
  <span class="na">DNS</span><span class="pi">:</span>
    <span class="pi">-</span> <span class="s">192.168.0.1</span>
    <span class="pi">-</span> <span class="s">192.168.0.2</span>
<span class="c1"># Defined machines</span>
<span class="na">Machines</span><span class="pi">:</span>
  <span class="c1"># Server peers need a publicly accessible Endpoint</span>
  <span class="na">Router</span><span class="pi">:</span>
    <span class="na">Interface</span><span class="pi">:</span>
      <span class="na">Address</span><span class="pi">:</span> <span class="s">192.168.50.1</span>
      <span class="na">ListenPort</span><span class="pi">:</span> <span class="m">51820</span>
    <span class="na">Peer</span><span class="pi">:</span>
      <span class="na">Endpoint</span><span class="pi">:</span> <span class="s">my.dynamic.ip.example.com:51820</span>
      <span class="na">PersistentKeepalive</span><span class="pi">:</span> <span class="m">25</span>
      <span class="na">AllowedIPs</span><span class="pi">:</span>
        <span class="pi">-</span> <span class="s">192.168.0.0/24</span>
        <span class="pi">-</span> <span class="s">192.168.50.0/24</span>
      <span class="na">Topolgy</span><span class="pi">:</span> <span class="s">star</span>
  <span class="c1"># Client peers will get a Dynamic address beginning with StartIP</span>
  <span class="na">Client1</span><span class="pi">:</span> <span class="pi">{}</span>
  <span class="na">Client2</span><span class="pi">:</span> <span class="pi">{}</span>
  <span class="na">Client3</span><span class="pi">:</span> <span class="pi">{}</span>
</code></pre></div></div>
<p>Note: Names <code class="language-plaintext highlighter-rouge">Router</code>, <code class="language-plaintext highlighter-rouge">Client1</code>, <code class="language-plaintext highlighter-rouge">Client2</code> and <code class="language-plaintext highlighter-rouge">Client3</code> can be replaced by any string.</p>

<h2 id="wireguard-config-gen-dependencies">wireguard-config-gen dependencies</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>uv venv <span class="nt">--seed</span>
uv <span class="nb">sync
</span>uv run python run.py ...
</code></pre></div></div>

<h2 id="run-the-generator">Run the generator</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>uv run python run.py interfaces.yaml
</code></pre></div></div>

<h2 id="check-out-our-generated-configs">Check out our generated configs</h2>

<p>Even though the program outputs to stdout, you can find the individual configs in the <code class="language-plaintext highlighter-rouge">output</code> directory:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-1</span> output/
Client1.conf
Client2.conf
Client3.conf
result.yaml
Router.conf
</code></pre></div></div>

<p>Taking a peek at Client1.conf:</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">## Generated: 2025-08-12 20:12:54.907587+00:00</span>
<span class="c1">## From Version: 0.6.6</span>

<span class="pi">[</span><span class="nv">Interface</span><span class="pi">]</span>
<span class="c1">## Client1</span>
<span class="s">Address = 192.168.50.2/32</span>
<span class="s">PrivateKey = cBqgY/Bu6D9/mRHCaSZ7w5O6wYKjZhJ9t+HUhZ0gE08=</span>
<span class="s">DNS = 192.168.0.1,192.168.0.2</span>

<span class="pi">[</span><span class="nv">Peer</span><span class="pi">]</span>
<span class="c1">## Router</span>
<span class="s">AllowedIPs = 192.168.0.0/24, 192.168.50.0/24</span>
<span class="s">PublicKey = /8QlHt5+nwo1ElCxxParSqNW8ISOn6hJYQVsLNX3lDQ=</span>
<span class="s">Endpoint = my.dynamic.ip.example.com:51820</span>
<span class="s">PersistentKeepalive = </span><span class="m">25</span>
<span class="s">PresharedKey = keKlv8WcEwi0h7ddCW0zv1MIPVsAOVkQS+Hca1R/KVE=</span>
</code></pre></div></div>

<p>Make sure to manually edit AllowedIPs to <code class="language-plaintext highlighter-rouge">0.0.0.0/0</code> because of the goal where clients will route all traffic through the tunnel.</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">## Generated: 2025-08-12 20:12:54.907587+00:00</span>
<span class="c1">## From Version: 0.6.6</span>

<span class="pi">[</span><span class="nv">Interface</span><span class="pi">]</span>
<span class="c1">## Client1</span>
<span class="s">Address = 192.168.50.2/32</span>
<span class="s">PrivateKey = cBqgY/Bu6D9/mRHCaSZ7w5O6wYKjZhJ9t+HUhZ0gE08=</span>
<span class="s">DNS = 192.168.0.1,192.168.0.2</span>

<span class="pi">[</span><span class="nv">Peer</span><span class="pi">]</span>
<span class="c1">## Router</span>
<span class="s">AllowedIPs = 0.0.0.0/0</span>
<span class="s">PublicKey = /8QlHt5+nwo1ElCxxParSqNW8ISOn6hJYQVsLNX3lDQ=</span>
<span class="s">Endpoint = my.dynamic.ip.example.com:51820</span>
<span class="s">PersistentKeepalive = </span><span class="m">25</span>
<span class="s">PresharedKey = keKlv8WcEwi0h7ddCW0zv1MIPVsAOVkQS+Hca1R/KVE=</span>
</code></pre></div></div>

<p>This can also be edited later at any time on the clients.</p>

<p>Reference: <a href="https://techoverflow.net/2021/07/09/what-does-wireguard-allowedips-actually-do/">What does WireGuard AllowedIPs actually do?</a></p>

<h1 id="setting-up-the-mikrotik-router">Setting up the Mikrotik router</h1>

<p>This is a decent example guide on <a href="https://help.mikrotik.com/docs/spaces/ROS/pages/69664792/WireGuard#WireGuard-WireGuardinterfaceconfiguration">how to set up Mikrotik for Wireguard</a>.</p>

<p>Whatever Mikrotik/Wireguard setup you have, use the values from the <code class="language-plaintext highlighter-rouge">Router.yaml</code> config.</p>

<p>If Mikrotik currently does not have a Wireguard configuration, you can import the <code class="language-plaintext highlighter-rouge">Router.yaml</code>:</p>
<ol>
  <li>Upload <code class="language-plaintext highlighter-rouge">Router.yaml</code> to your Mikrotik router</li>
  <li>Run <code class="language-plaintext highlighter-rouge">/interface/wireguard/wg-import &lt;filename&gt;</code></li>
</ol>

<p>It would be a good idea to check/add/modify:</p>
<ol>
  <li><code class="language-plaintext highlighter-rouge">/ip/address/print</code></li>
  <li><code class="language-plaintext highlighter-rouge">/ip/firewall/address-list/print</code> if used for rules</li>
  <li><code class="language-plaintext highlighter-rouge">/interface/list/print</code> if used for rules</li>
  <li><code class="language-plaintext highlighter-rouge">/ip/firewall/filter/print</code></li>
</ol>

<h1 id="linux-client-configuration">Linux client configuration</h1>

<p>Install <code class="language-plaintext highlighter-rouge">wireguard</code> and <code class="language-plaintext highlighter-rouge">wireguard-tools</code> packages which should be available on most, if not all, distributions.</p>

<p>Copy the shortened <code class="language-plaintext highlighter-rouge">Client1.yaml</code> file to our client machine to <code class="language-plaintext highlighter-rouge">/etc/wireguard/wg0.conf</code>. Remember to set the permissions:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo chmod </span>600 /etc/wireguard/wg0.conf
</code></pre></div></div>

<h1 id="using-wireguard-on-linux">Using Wireguard on linux</h1>

<h2 id="cli-only">CLI only</h2>

<p>There are <a href="https://wiki.archlinux.org/title/WireGuard">many ways</a> to use Wireguard on Linux, but I find using the simple <code class="language-plaintext highlighter-rouge">wg-quick</code> utility the easiest.</p>

<p>Note: The script’s output will hint if you are missing utilities needed to operate it, such as iptables.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>wg-quick up wg0
</code></pre></div></div>

<p>You can stop the wireguard interface like so</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>wg-quick down wg0
</code></pre></div></div>

<h2 id="gnome-desktop-environment">Gnome Desktop Environment</h2>

<p>Gnome can import Wireguard configs through the built-in Network Manager integration in the UI.</p>

<h1 id="using-wireguard-on-mobile">Using Wireguard on Mobile</h1>

<p>Mikrotik has a way to generate a QR code which can be scanned on the phones with middling results, but I prefer to transfer the <code class="language-plaintext highlighter-rouge">Client2.yaml</code> file to my phone and import it using the official Wireguard app.</p>

<h1 id="troubleshooting-on-the-mikrotik-device">Troubleshooting on the Mikrotik device</h1>

<p>Packet sniffer (tool category) is your friend. I used it thorough the UI to monitor all traffic on the wg interface. Select just the interface and headers only to save on CPU time.</p>

<p>Initially, I had <code class="language-plaintext highlighter-rouge">AllowedIPs</code> on my clients config set to the subnet of the LAN and Wireguard’s network. Only DNS traffic would go through through the tunnel.</p>

<p>When I changed <code class="language-plaintext highlighter-rouge">AllowedIPs</code> to <code class="language-plaintext highlighter-rouge">0.0.0.0/0</code> that’s when I saw all the client traffic flow through the router.</p>]]></content><author><name>Milos Kaurin</name></author><category term="security" /><category term="wireguard" /><category term="mikrotik" /><category term="networking" /><category term="security" /><summary type="html"><![CDATA[Some poorly researched notes on Wireguard. Updated on August 12th, 2025.]]></summary></entry><entry><title type="html">Batch Deletion of YubiKey Credentials</title><link href="https://blog.kaurin.cc/security/batch-yubikey-credential-deletion/" rel="alternate" type="text/html" title="Batch Deletion of YubiKey Credentials" /><published>2025-01-14T22:00:00+00:00</published><updated>2026-05-15T22:20:00+01:00</updated><id>https://blog.kaurin.cc/security/batch-yubikey-credential-deletion</id><content type="html" xml:base="https://blog.kaurin.cc/security/batch-yubikey-credential-deletion/"><![CDATA[<p>My lab Yubikey was slowing down due to the amount of credentials for a single domain</p>

<h1 id="disclaimer">Disclaimer</h1>

<p><strong>These are very destructive procedures. I bare no responsibility for any loss of data or damage to your Yuibkey</strong></p>

<h1 id="on-rp_id">On RP_ID</h1>
<p>Note: RP_ID is usually the domain of the service you are using. It can also be a superdomain.</p>

<p>For example, you are logging in with your browser to <code class="language-plaintext highlighter-rouge">https://www.example.com</code>, so the RP_ID can be:</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">www.example.com</code></li>
  <li><code class="language-plaintext highlighter-rouge">example.com</code></li>
  <li><code class="language-plaintext highlighter-rouge">com</code>  (unlikely)</li>
</ul>

<p>More on this topic at <a href="https://web.dev/articles/webauthn-rp-id">RP ID deep dive</a></p>

<h1 id="procedure">Procedure</h1>

<p>Yubikey lists the fido2 credentials in the following format:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ykman fido credentials list <span class="nt">--csv</span>
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;long-uuid-1&gt;,&lt;RP_ID&gt;,&lt;username&gt;,,&lt;long-number-1&gt;
&lt;long-uuid-2&gt;,&lt;RP_ID&gt;.&lt;username&gt;,,&lt;long-number-2&gt;
</code></pre></div></div>

<p>We can grep for the RP_ID and username and get a CSV output (no Json or Yaml, sadly):</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ykman fido credentials list <span class="nt">--csv</span> | <span class="se">\</span>
  <span class="nb">grep</span> <span class="s1">',some.example.com,myusername,'</span>  | <span class="se">\</span>
  <span class="nb">awk</span> <span class="nt">-F</span> <span class="s1">','</span> <span class="s1">'{print $1}'</span>
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&lt;long-uuid-1&gt;
&lt;long-uuid-2&gt;
</code></pre></div></div>

<p>Finally, we can run this through xargs to mass delete the domain-user combination.</p>
<ul>
  <li>NOTE: You have an option to input the pin for every deletion, or run with <code class="language-plaintext highlighter-rouge">--pin</code> which is unsafe.</li>
  <li>NOTE: Nothing is stopping you from running this for a whole domain, being more specific is safer.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ykman fido credentials list <span class="nt">--csv</span> <span class="nt">--pin</span> 1234 | <span class="se">\</span>
  <span class="nb">grep</span> <span class="s1">',some.example.com,myusername,'</span> | <span class="se">\</span>
  <span class="nb">awk</span> <span class="nt">-F</span> <span class="s1">','</span> <span class="s1">'{print $1}'</span> | <span class="se">\</span>
  xargs <span class="nt">-n1</span> ykman fido credentials delete <span class="nt">--force</span> <span class="nt">--pin</span> 1234
</code></pre></div></div>]]></content><author><name>Milos Kaurin</name></author><category term="security" /><category term="yubikey" /><category term="yubico" /><category term="fido2" /><category term="security" /><category term="bash" /><summary type="html"><![CDATA[My lab Yubikey was slowing down due to the amount of credentials for a single domain]]></summary></entry><entry><title type="html">ZFS Root woes</title><link href="https://blog.kaurin.cc/zfs/zfs-root-woes/" rel="alternate" type="text/html" title="ZFS Root woes" /><published>2025-01-08T18:00:00+00:00</published><updated>2026-05-15T23:16:00+01:00</updated><id>https://blog.kaurin.cc/zfs/zfs-root-woes</id><content type="html" xml:base="https://blog.kaurin.cc/zfs/zfs-root-woes/"><![CDATA[<p>Documenting an issue with my machine/Fedora installation which uses ZFS Boot to boot from a ZFS root.</p>

<h1 id="disclaimer">Disclaimer</h1>

<p><strong>These are very destructive procedures. I bare no responsibility for any damages done to your system.</strong></p>

<h1 id="the-issue">The issue</h1>

<p>My relatively new system based on AMD Ryzen 7 8700G w/ Radeon 780M Graphics is experiencing random shutdowns where 2 out of 3 NVME drives don’t show up in BIOS unless I fully shut down and start-up the machine.</p>

<p>Often times the boot partition which contains the ZFS Boot menu will get corrupted requiring me to re-download the ZFS Boot Menu bootloader.</p>

<p>Other times the data will get corrupted on one of the ZFS disks, but that’s not at issue here because I can simply scrub the ZFS pool for errors.</p>

<h1 id="the-repair-process">The repair process</h1>

<ol>
  <li>Boot into the the current version of the bootable Fedora medium.</li>
  <li>Consult the <a href="https://zfsbootmenu.org/en/latest/guides/fedora/uefi.html#install-zfsbootmenu">ZBM Fedora Install section</a>. Note: We will be using a shortened and slightly different procedure. No need for chroot, etc.</li>
  <li>Verify which first partition of the three NVME devices contains the EFI filesystem and structure (For example, the EFI dir on a vfat filesystem).</li>
  <li>Mount the discovered EFI partition</li>
  <li>Download the latest <code class="language-plaintext highlighter-rouge">VMLINUZ.EFI</code> bootloader and backup entry bootloader</li>
  <li>Finally set the env vars and run the <code class="language-plaintext highlighter-rouge">efibootmgr</code> (see below)</li>
</ol>

<p>The whole procedure looks like this:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mount /dev/nvme0n1p1 /mnt

curl <span class="nt">-o</span> /mnt/EFI/ZBM/VMLINUZ.EFI <span class="nt">-L</span> https://get.zfsbootmenu.org/efi
<span class="nb">cp</span> /mnt/EFI/ZBM/VMLINUZ.EFI /mnt/EFI/ZBM/VMLINUZ-BACKUP.EFI

<span class="nb">export </span><span class="nv">BOOT_DISK</span><span class="o">=</span><span class="s2">"/dev/nvme0n1"</span>
<span class="nb">export </span><span class="nv">BOOT_PART</span><span class="o">=</span><span class="s2">"1"</span>

efibootmgr <span class="nt">-c</span> <span class="nt">-d</span> <span class="s2">"</span><span class="nv">$BOOT_DISK</span><span class="s2">"</span> <span class="nt">-p</span> <span class="s2">"</span><span class="nv">$BOOT_PART</span><span class="s2">"</span> <span class="se">\</span>
  <span class="nt">-L</span> <span class="s2">"ZFSBootMenu (Backup)"</span> <span class="se">\</span>
  <span class="nt">-l</span> <span class="s1">'\EFI\ZBM\VMLINUZ-BACKUP.EFI'</span>

efibootmgr <span class="nt">-c</span> <span class="nt">-d</span> <span class="s2">"</span><span class="nv">$BOOT_DISK</span><span class="s2">"</span> <span class="nt">-p</span> <span class="s2">"</span><span class="nv">$BOOT_PART</span><span class="s2">"</span> <span class="se">\</span>
  <span class="nt">-L</span> <span class="s2">"ZFSBootMenu"</span> <span class="se">\</span>
  <span class="nt">-l</span> <span class="s1">'\EFI\ZBM\VMLINUZ.EFI'</span>
</code></pre></div></div>

<h1 id="root-cause">Root cause</h1>

<p>Update 2026/05: PCIE power saving would hang the system. Fixed by adding the following to the kernel cmdline:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>zfs set org.zfsbootmenu:commandline="nvme_core.default_ps_max_latency_us=0 pcie_aspm=off pcie_port_pm=off rhgb amdgpu.cik_support=1 radeon.cik_support=0" zroot/ROOT/fedora
</code></pre></div></div>]]></content><author><name>Milos Kaurin</name></author><category term="zfs" /><category term="zfs" /><category term="troubleshooting" /><category term="grub" /><category term="zfsbootmenu" /><summary type="html"><![CDATA[Documenting an issue with my machine/Fedora installation which uses ZFS Boot to boot from a ZFS root.]]></summary></entry><entry><title type="html">A short Proxmox journey</title><link href="https://blog.kaurin.cc/virtualization/a-short-proxmox-journey/" rel="alternate" type="text/html" title="A short Proxmox journey" /><published>2024-05-11T03:30:00+01:00</published><updated>2024-05-11T03:30:00+01:00</updated><id>https://blog.kaurin.cc/virtualization/a-short-proxmox-journey</id><content type="html" xml:base="https://blog.kaurin.cc/virtualization/a-short-proxmox-journey/"><![CDATA[<p>My short journey into Proxmox land. These are just notes for my self reference should I ever need them.</p>

<h1 id="disclaimer">Disclaimer</h1>

<p><strong>These are very destructive procedures. I bare no responsibility for any damages done to your system.</strong></p>

<h1 id="goal">Goal</h1>

<ul>
  <li>Install proxmox.</li>
  <li>Have it use letsencrypt for the webui HTTPS.</li>
  <li>Familiarize with the product to better understand the current virtualization landscape</li>
</ul>

<h1 id="kvmlibvirt-preparation">KVM/libvirt Preparation</h1>

<p>I will be using libvirt’s <code class="language-plaintext highlighter-rouge">virt-manager</code> to spin up Proxmox.</p>

<h2 id="volumes">Volumes</h2>

<p>This <a href="https://blog.dood.ie/virtualization/virtualized-truenas-with-truechart-and-letsencrypt/">time around</a> I will be going with the default storage pool - meaning qcow2 backing image files.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> default <span class="nt">--name</span> proxmox-os <span class="nt">--capacity</span> 20G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> default <span class="nt">--name</span> proxmox-data-1 <span class="nt">--capacity</span> 200G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> default <span class="nt">--name</span> proxmox-data-2 <span class="nt">--capacity</span> 200G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> default <span class="nt">--name</span> proxmox-data-3 <span class="nt">--capacity</span> 200G
</code></pre></div></div>

<h2 id="network">Network</h2>

<p>Bridge networking is fine here.</p>

<p>My home DNS will forward anything headed for the <code class="language-plaintext highlighter-rouge">*.pm.dood.ie</code> towards <code class="language-plaintext highlighter-rouge">192.168.0.60</code></p>

<h2 id="first-boot">First boot</h2>

<ul>
  <li>Graphical Install</li>
  <li>Accept license</li>
  <li>Select the 20GB disk for OS</li>
  <li>Country/Timezone/Keyboard Layout</li>
  <li>Password/Email</li>
  <li>Network
    <ul>
      <li>Management interface: default</li>
      <li>Hostname: <code class="language-plaintext highlighter-rouge">proxmox.pm.dood.ie</code></li>
      <li>IP CIDR: 192.168.0.60/24</li>
      <li>Gateway: 192.168.0.1</li>
      <li>DNS: 127.0.0.1</li>
    </ul>
  </li>
  <li>Install</li>
</ul>

<h1 id="admin-user">Admin user</h1>

<p>Proxmox has a concept of “Realms”, which roughly correspond to authentication mechanisms. The preferred realm is “pve” which is the proxmox propriatery auth system.</p>

<p>There is also the “pam” Realm which corresponds to the system-local auth, but is not provisioned top-down. You can also add more auth mechanisms (realms), but that’s outside of the scope of this document.</p>

<p>What do I mean by “not provisioned top-down”? When we create a user, say</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pveum user add testuser@pam <span class="nt">--email</span> youremail@something.invalid 
</code></pre></div></div>

<p>… and try to change it’s password</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pveum passwd testuser@pam
</code></pre></div></div>

<p>We will get an error saying:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>change password failed: user 'testuser' does not exist
</code></pre></div></div>

<p>This is because proxmox requires you to handle PAM authenticated users yourself.</p>

<p>This would work:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pveum user add testuser@pam <span class="nt">--email</span> youremail@something.invalid 
useradd <span class="nt">-m</span> testuser
pveum passwd testuser@pam
</code></pre></div></div>

<p>I did not want to proceed researching this and will be using the builtin <code class="language-plaintext highlighter-rouge">root</code> user in this guide.</p>

<h1 id="letsencrypt-powered-https-for-the-promoxmox-webui">letsencrypt powered HTTPS for the Promoxmox Webui</h1>

<p>You will need your CloudFlare Account ID and API token to proceed. Here is a <a href="https://forum.proxmox.com/threads/secure-proxmox-with-letsencrypt-https-certificates-validated-with-cloudflare-dns.106347/">video guide</a> on how to get them.</p>

<p>Permissions for the API token need to be:</p>
<ul>
  <li>Zone / Zone / Read</li>
  <li>Zone / DNS / Edit</li>
  <li>Include / Specific Zone / yourdomain.com</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> <span class="o">&gt;</span> acme.txt <span class="o">&lt;&lt;</span><span class="no">EOF</span><span class="sh">
CF_Account_ID=YOUR_ACC_ID
CF_Token=YOUR_TOKEN
</span><span class="no">EOF

</span>pvenode acme account register account-name youremail@something.invalid
</code></pre></div></div>

<p>After the last command you will be asked for a few choices regarding letsencrypt - whether you want to use the poduction or staging server as well as to accept the terms of service. I would recommend staging certs at this point, just be aware that they will produce invalid certs. You can inspect your browser “padlock” icon to check whether it’s actually letsencrypt.</p>

<p>But first, we need to finish the process:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pvenode acme plugin add dns cloudflare <span class="nt">--api</span> cf <span class="nt">--data</span> acme.txt
pvenode config <span class="nb">set</span> <span class="nt">-acmedomain0</span> proxmox.pm.dood.ie,plugin<span class="o">=</span>cloudflare
pvenode acme cert order
</code></pre></div></div>

<p>When we refresh the proxmox UI, the certificate should be updated.</p>

<h1 id="conclusion">Conclusion</h1>

<p>I don’t really have one of much value. Speaking completely subjectively, it didn’t sit right with me, and I will probably be moving on to a DIY virtualization host powered by gitops.</p>

<p>Regardless of my subjective feel, Proxmox seems like a great tool, especially if you need advanced features like clustering.</p>

<h1 id="cleanup">Cleanup</h1>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>virsh vol-delete <span class="nt">--pool</span> default proxmox-os    
<span class="nb">sudo </span>virsh vol-delete <span class="nt">--pool</span> default proxmox-data-1
<span class="nb">sudo </span>virsh vol-delete <span class="nt">--pool</span> default proxmox-data-2
<span class="nb">sudo </span>virsh vol-delete <span class="nt">--pool</span> default proxmox-data-3
</code></pre></div></div>]]></content><author><name>Milos Kaurin</name></author><category term="virtualization" /><category term="proxmox" /><category term="proxmox ve" /><category term="proxmox virtual environment" /><category term="kvm" /><category term="libvirt" /><category term="letsencrypt" /><category term="virtualization" /><summary type="html"><![CDATA[My short journey into Proxmox land. These are just notes for my self reference should I ever need them.]]></summary></entry><entry><title type="html">Virtualized TrueNAS with Truechart and Letsencrypt</title><link href="https://blog.kaurin.cc/virtualization/virtualized-truenas-with-truechart-and-letsencrypt/" rel="alternate" type="text/html" title="Virtualized TrueNAS with Truechart and Letsencrypt" /><published>2024-05-10T04:00:00+01:00</published><updated>2026-05-15T23:16:00+01:00</updated><id>https://blog.kaurin.cc/virtualization/virtualized-truenas-with-truechart-and-letsencrypt</id><content type="html" xml:base="https://blog.kaurin.cc/virtualization/virtualized-truenas-with-truechart-and-letsencrypt/"><![CDATA[<p>Notes on what i’ve done to provision a virtualized TrueNAS setup with Truechart and Letsencrypt for testing purposes.</p>

<h1 id="disclaimer">Disclaimer</h1>

<p><strong>These are very destructive procedures. I bare no responsibility for any damages done to your system.</strong></p>

<h1 id="goal">Goal</h1>

<p><a href="https://truecharts.org/scale/">TrueCharts powered</a> setup with letsencrypt. Letsencrypt should get certs via DNS checks.</p>

<h1 id="setting-up-the-libvirt-host">Setting up the libvirt host</h1>

<p>Looks like <a href="https://jrs-s.net/2013/05/17/kvm-io-benchmarking/">ZFS</a> is pretty good as a backing store for QEMU.</p>

<p>First, we need a libvirt pool. Because i’m using ZFS, I can do the following</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>virsh pool-define-as <span class="nt">--name</span> zfs-pool <span class="nt">--type</span> zfs <span class="nt">--source-name</span> zroot
<span class="nb">sudo </span>virsh pool-start zfs-pool
</code></pre></div></div>

<p>Then, let’s create the required volumes inside that pool</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> zfs-pool <span class="nt">--name</span> truenas-os-1 <span class="nt">--capacity</span> 20G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> zfs-pool <span class="nt">--name</span> truenas-os-2 <span class="nt">--capacity</span> 20G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> zfs-pool <span class="nt">--name</span> truenas-data-1 <span class="nt">--capacity</span> 200G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> zfs-pool <span class="nt">--name</span> truenas-data-2 <span class="nt">--capacity</span> 200G
<span class="nb">sudo </span>virsh vol-create-as <span class="nt">--pool</span> zfs-pool <span class="nt">--name</span> truenas-data-3 <span class="nt">--capacity</span> 200G
</code></pre></div></div>

<p>Then, use <code class="language-plaintext highlighter-rouge">virt-manager</code> to set up a “Debian 12” machine while using the TrueNAS boot ISO.</p>

<ul>
  <li>Remove the sound card</li>
  <li>Do not use default storage from the wizard</li>
  <li>In the virt customization menu add all the devices we created earlier from the <code class="language-plaintext highlighter-rouge">zfs-pool</code>.</li>
</ul>

<h1 id="why-no-xml-for-the-virt">Why no XML for the virt?</h1>

<p>Because the libvirt / virt-manager team will make future runs through the UI more future-proof than my XML.</p>

<h1 id="first-time-boot">First time boot</h1>

<p>Install the OS.</p>

<ul>
  <li>Select the <em>two</em> small OS drives for the OS</li>
  <li>provide a password</li>
  <li>EFI Boot</li>
</ul>

<p>After the reboot, you might have to re-enable the two OS disks as boot devices.</p>

<h1 id="home-network">Home network</h1>

<p>I set up my DHCP server to lease <code class="language-plaintext highlighter-rouge">192.168.0.60</code> to the MAC address of the virt.</p>

<p>My home router is the primary (and secondary) DNS server. On my router I can set a regex rule to route all <code class="language-plaintext highlighter-rouge">*.tn.dood.ie</code> to a specific IP.</p>

<p>If you don’t have this capability available to you, you can probably set-up the hosts file on your computer, but this is beyond the scope of this guide.</p>

<h1 id="initial-truenas-config">Initial TrueNAS config</h1>

<p>This will mostly be my retelling of the <a href="https://truecharts.org/scale/">TrueCharts</a> guide, just more compact. Definitely use the Truechart guide for reference.</p>

<ul>
  <li>Storage -&gt; Create Pool
    <ul>
      <li>General Info
        <ul>
          <li>Name: <code class="language-plaintext highlighter-rouge">tank</code></li>
          <li>Allow non-unique serialed disks: Allow</li>
        </ul>
      </li>
      <li>Data:
        <ul>
          <li>Layout: zraid1</li>
          <li>with/number:  should be autopopulated (3/1)</li>
          <li>Save and Go To Review</li>
        </ul>
      </li>
      <li>Create Pool</li>
    </ul>
  </li>
  <li>System Settings -&gt; General -&gt;
    <ul>
      <li>GUI
        <ul>
          <li>Ports <code class="language-plaintext highlighter-rouge">81</code> and <code class="language-plaintext highlighter-rouge">444</code> respectively</li>
          <li>Turn off Usage collection</li>
          <li>HTTPS TLSv1.3 only</li>
          <li>Once confirmed, make sure to reconnect via https://192.168.0.60:444</li>
        </ul>
      </li>
      <li>Localization
        <ul>
          <li>Timezone</li>
        </ul>
      </li>
      <li>Apps -&gt;
        <ul>
          <li>Settings -&gt; Choose pool
            <ul>
              <li>Select <code class="language-plaintext highlighter-rouge">tank</code></li>
            </ul>
          </li>
          <li>Discover Apps -&gt; Manage Catalogs
            <ul>
              <li>Add Catalog
                <ul>
                  <li>name: truecharts</li>
                  <li>repository: <code class="language-plaintext highlighter-rouge">https://github.com/truecharts/catalog</code></li>
                  <li>Preferred Trains: <code class="language-plaintext highlighter-rouge">premium</code>, <code class="language-plaintext highlighter-rouge">stable</code> and <code class="language-plaintext highlighter-rouge">system</code></li>
                  <li>Branch: main</li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
      <li>Services -&gt;
        <ul>
          <li>SSH - Enable and start</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Credentials -&gt; Users -&gt;
    <ul>
      <li>Admin / Edit
        <ul>
          <li>Paste Authorized Key</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<p>Adding the catalog can take several minutes++</p>

<h1 id="bootstrap-truechart-with-proper-https">Bootstrap Truechart with proper HTTPS</h1>

<p>We will be using the “cluster wide certificates” as documented <a href="https://truecharts.org/charts/premium/clusterissuer/cluster-certificates/">here</a>.</p>

<p>Big tip when adding apps is that the navigation menu is on the right-hand side.
Huge help as the UI is trying to show yaml in UI form, and it can be a bit hard to read.</p>

<ul>
  <li>Apps -&gt; Discover Apps -&gt;
    <ul>
      <li>Available Apps -&gt; Refresh</li>
      <li>Prometheus-Operator (truecharts, system)
        <ul>
          <li>Retention: as desired (default 31d)</li>
        </ul>
      </li>
      <li>CertManager - <a href="https://truecharts.org/charts/premium/clusterissuer/how-to/">source doc</a>
        <ul>
          <li>Set preferred DNS. Needs to be reliable. In my case <code class="language-plaintext highlighter-rouge">192.168.0.1:53,192.168.0.1:53</code>.</li>
        </ul>
      </li>
      <li>kubernetes-reflector
        <ul>
          <li>Default settings</li>
        </ul>
      </li>
      <li>clusterissuer - <a href="https://truecharts.org/charts/premium/clusterissuer/how-to/">source doc</a>
        <ul>
          <li>namespace: <code class="language-plaintext highlighter-rouge">ix-cert-manager</code> or <code class="language-plaintext highlighter-rouge">ix-&lt;cert-mannager-chart-name&gt;</code></li>
          <li>ACME Issuer
            <ul>
              <li>name: <code class="language-plaintext highlighter-rouge">cert-staging</code></li>
              <li>Type: <code class="language-plaintext highlighter-rouge">Cloudflare</code></li>
              <li>Server:<code class="language-plaintext highlighter-rouge"> Staging</code></li>
              <li>email: <code class="language-plaintext highlighter-rouge">your email</code></li>
              <li>CloudFlare API Token: <code class="language-plaintext highlighter-rouge">your CF token</code></li>
              <li><strong>Repeat for name: <code class="language-plaintext highlighter-rouge">cert</code> and Type: <code class="language-plaintext highlighter-rouge">Production</code></strong></li>
            </ul>
          </li>
          <li>Cluster Wide Certificates
            <ul>
              <li>Add</li>
              <li>Enabled ✔</li>
              <li>name: <code class="language-plaintext highlighter-rouge">cluster-staging</code></li>
              <li>CertManager Cluster Issuer: <code class="language-plaintext highlighter-rouge">cert-staging</code></li>
              <li>Certificate Hosts / Add</li>
              <li><code class="language-plaintext highlighter-rouge">*.tn.dood.ie</code></li>
              <li><strong>Repeat for name: <code class="language-plaintext highlighter-rouge">cluster</code> and CertManager Cluster Issuer: <code class="language-plaintext highlighter-rouge">cert</code></strong></li>
            </ul>
          </li>
        </ul>
      </li>
      <li>Traefik (truecharts, premium)
        <ul>
          <li>Name: traefik</li>
          <li>Metrics: enabled
            <ul>
              <li>Prometheus: enabled</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h1 id="eat-our-own-dogfood">Eat our own dogfood</h1>

<p>Now that we’ve primed traefik, we can go ahead and edit it, and have it integrate with itself.</p>

<ul>
  <li>Apps -&gt;
    <ul>
      <li>Traefik (edit this time)
        <ul>
          <li>Services
            <ul>
              <li>Main Service / Service Type: ClusterIP (No need for a dedicated exposed port!)</li>
              <li>Don’t touch those services with port 443 and 80. Those are very much needed as LoadBalancer.</li>
            </ul>
          </li>
          <li>Ingress
            <ul>
              <li>Main - Enable</li>
              <li>Hosts / Add / <code class="language-plaintext highlighter-rouge">traefik.tn.dood.ie</code>
                <ul>
                  <li>Path: <code class="language-plaintext highlighter-rouge">/</code></li>
                  <li>Path Type: <code class="language-plaintext highlighter-rouge">Prefix</code></li>
                </ul>
              </li>
            </ul>
          </li>
          <li>Integrations / Traefik
            <ul>
              <li>Enabled ✔</li>
              <li>Entrypoints / Entrypoint: <code class="language-plaintext highlighter-rouge">websecure</code></li>
              <li><strong>DO NOT check</strong> “CertManager”</li>
              <li>Show Advanced Settings ✔
                <ul>
                  <li>TLS Settings / Add
                    <ul>
                      <li>Certificate Hosts / Add
                        <ul>
                          <li>Host: <code class="language-plaintext highlighter-rouge">traefik.tn.dood.ie</code></li>
                        </ul>
                      </li>
                      <li>TLS Settings / Add
                        <ul>
                          <li>Certificate Hosts / Add / <code class="language-plaintext highlighter-rouge">traefik.tn.dood.ie</code></li>
                          <li>Cert Manager Cluster issuer: leave empty!</li>
                          <li>Cluster Certificate (advanced): <code class="language-plaintext highlighter-rouge">cluster-staging</code> OR <code class="language-plaintext highlighter-rouge">cluster</code></li>
                        </ul>
                      </li>
                    </ul>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h1 id="standalone-example---cyberchef">Standalone example - Cyberchef</h1>

<p>Cyberchef is a cool web-based utility that’s completely standalone, does not require databases etc.</p>

<p>Let’s see how it looks like when we can deploy an app with proper HTTPS in one go.</p>

<ul>
  <li>Apps -&gt; Discover Apps -&gt;
    <ul>
      <li>Cyberchef
        <ul>
          <li>Services
            <ul>
              <li>Service Type: ClusterIP (No need for a dedicated exposed port!)</li>
            </ul>
          </li>
          <li>Ingress
            <ul>
              <li>Main - Enable</li>
              <li>Hosts / Add / <code class="language-plaintext highlighter-rouge">cyberchef.tn.dood.ie</code>
                <ul>
                  <li>Path: <code class="language-plaintext highlighter-rouge">/</code></li>
                  <li>Path Type: <code class="language-plaintext highlighter-rouge">Prefix</code></li>
                </ul>
              </li>
            </ul>
          </li>
          <li>Integrations / Traefik
            <ul>
              <li>Enabled ✔</li>
              <li>Entrypoints / Entrypoint: <code class="language-plaintext highlighter-rouge">websecure</code></li>
              <li>DO NOT check “CertManager”</li>
              <li>Show Advanced Settings ✔
                <ul>
                  <li>TLS Settings / Add
                    <ul>
                      <li>Certificate Hosts / Add
                        <ul>
                          <li>Host: <code class="language-plaintext highlighter-rouge">cyberchef.tn.dood.ie</code></li>
                        </ul>
                      </li>
                      <li>TLS Settings / Add
                        <ul>
                          <li>Certificate Hosts / Add / <code class="language-plaintext highlighter-rouge">cyberchef.tn.dood.ie</code></li>
                          <li>Use Cert Manager Cluster issuer: leave empty!</li>
                          <li>Cluster Certificate (advanced): <code class="language-plaintext highlighter-rouge">cluster-staging</code> OR <code class="language-plaintext highlighter-rouge">cluster</code></li>
                        </ul>
                      </li>
                    </ul>
                  </li>
                </ul>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h1 id="libvirt-cleanup">Libvirt cleanup</h1>

<p>Delete the machine we created. If doing it through <code class="language-plaintext highlighter-rouge">virt-manager</code> it will ask you to delete the volumes. This can sometimes fail (for some volumes).</p>

<p>In any case:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>virsh pool-destroy zfs-pool
<span class="nb">sudo </span>virsh pool-undefine zfs-pool

<span class="nb">sudo </span>zfs destroy zroot/truenas-os-1
<span class="nb">sudo </span>zfs destroy zroot/truenas-os-2
<span class="nb">sudo </span>zfs destroy zroot/truenas-data-1
<span class="nb">sudo </span>zfs destroy zroot/truenas-data-2
<span class="nb">sudo </span>zfs destroy zroot/truenas-data-3
</code></pre></div></div>

<p>Sometimes this can happen:</p>

<pre><code class="language-plain">cannot destroy 'zroot/truenas-data-3': dataset is busy
</code></pre>

<p>Looks like it <a href="https://github.com/openzfs/zfs/discussions/13594">happens</a> to folks.</p>

<p>Unfortunately, the workaround for me required a reboot:</p>
<ul>
  <li>Disable libvirtd: <code class="language-plaintext highlighter-rouge">sudo systemctl disable libvirtd</code></li>
  <li>Reboot</li>
  <li>Try to delete again</li>
  <li>Enable libvirtd: <code class="language-plaintext highlighter-rouge">sudo systemctl enable libvirtd</code></li>
</ul>

<h1 id="complete-derail-while-trying-to-clean-up">Complete derail while trying to clean up</h1>

<p>NOTE 2026/05: This derail happened because of PCIE power savings which would hang my ZFS pool.</p>

<p>More about this in <a href="../../zfs/zfs-root-woes/">ZFS Root woes</a></p>

<p>On my third run of this very guide, the <code class="language-plaintext highlighter-rouge">dataset is busy</code>  error happened again. This time the reboot trick didn’t work. Probably because I had to mask <code class="language-plaintext highlighter-rouge">libvirtd.socket</code>, <code class="language-plaintext highlighter-rouge">libvirt-ro.socket</code> and <code class="language-plaintext highlighter-rouge">libvirt-admin.socket</code> as they will start libvirtd even when it is disabled. This is pure speculation, though, because I didn’t investigate what else aside from libvirt could be using this zvol.</p>

<p>I opted for booting into the Fedora live USB so I can have a clean slate while trying to fix the issue.</p>

<p>Context: Some months ago I followed this ZFSBootMenu <a href="https://docs.zfsbootmenu.org/en/v2.3.x/guides/fedora/uefi.html">guide</a> guide so I can get the live system prepared for <a href="https://blog.dood.ie/linux/fedora-zfs-encrypted-root-and-zfsbootmenu/">installing Fedora with root ZFS</a>.</p>

<h2 id="fedora-live-usb">Fedora Live USB</h2>

<p>Unfortunately, I recently updated my system to Fedora 40. Website referenced in the guide, zfsonlinux.org, did not have the Fedora 40 RPMs yet.</p>

<p>So… naturally I had to build the packages myself in the live Fedora system. I opted for the <a href="https://openzfs.github.io/openzfs-docs/Developer%20Resources/Custom%20Packages.html">DKMS package build</a> and that worked fine. I installed the resulting packages and I could <code class="language-plaintext highlighter-rouge">modprobe zfs</code>.</p>

<p>Now, because I’m fairly fresh to the ZFS game, I had no idea that ZFS is aware of the <a href="https://wiki.archlinux.org/title/ZFS#Exporting_a_storage_pool">host it is being mounted on</a>.</p>

<p>What this meant was that when I was trying to do <code class="language-plaintext highlighter-rouge">zpool import</code>, I was getting <a href="https://wiki.archlinux.org/title/ZFS#On_boot_the_zfs_pool_does_not_mount_stating:_%22pool_may_be_in_use_from_other_system%22"><code class="language-plaintext highlighter-rouge">pool may be in use from other system</code></a>.</p>

<p>Being careless I just read the error message and forced the import with <code class="language-plaintext highlighter-rouge">zpool import -f zroot</code>.</p>

<p>I was able to get rid of the last remaining zvol with <code class="language-plaintext highlighter-rouge">zfs destroy zroot/truenas-data-3</code> and rebooted.</p>

<h2 id="heart-attack">Heart attack</h2>

<p>After typing in my disk encryption password, I was greeted by a, now familiar, error during systemd startup: <code class="language-plaintext highlighter-rouge">pool may be in use from other system</code> with an option to drop to the emergency shell.</p>

<p>This system has this very guide as well as days of other work that has not been backed up…</p>

<p>Luckily, still having access to the zfs utilities in the emergency shell I could see that the host ID is that of the live system, so I figured that another forced import would fix the issue.</p>

<p>It would appear that I was right: <code class="language-plaintext highlighter-rouge">zpool import -f zroot</code>. Reboot</p>

<p>The issue went away after that forced import back on the normal system.</p>

<h1 id="conclusion">Conclusion</h1>

<p>This endeavor has taught me a few things:</p>
<ul>
  <li>That Truenas looks like a pretty cool project</li>
  <li>That Truechart also looks like a pretty cool project, but is too underdocumented for my taste at the moment. Will definitely be using their charts, though.</li>
  <li>That I still have a lot to learn about ZFS</li>
  <li>That I might skip ZFS-libvirt integration for now</li>
</ul>]]></content><author><name>Milos Kaurin</name></author><category term="virtualization" /><category term="truenas scale" /><category term="truenas" /><category term="zfs" /><category term="zvol" /><category term="nas" /><category term="kvm" /><category term="libvirt" /><category term="letsencrypt" /><category term="virtualization" /><category term="traefik" /><summary type="html"><![CDATA[Notes on what i’ve done to provision a virtualized TrueNAS setup with Truechart and Letsencrypt for testing purposes.]]></summary></entry><entry><title type="html">Microsoft Flight Simulator Checklists</title><link href="https://blog.kaurin.cc/gaming/msfs-checklists/" rel="alternate" type="text/html" title="Microsoft Flight Simulator Checklists" /><published>2024-05-06T14:00:00+01:00</published><updated>2024-05-06T14:00:00+01:00</updated><id>https://blog.kaurin.cc/gaming/msfs-checklists</id><content type="html" xml:base="https://blog.kaurin.cc/gaming/msfs-checklists/"><![CDATA[<p>My personal MSFS ecosystem has grown so large that I require checklists.</p>

<h1 id="update-checklist">Update checklist</h1>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="http://www.fsuipc.com/">FSUIPC</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://flybywiresim.com/">FlyByWire Installer</a>
    <ul class="task-list">
      <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />FSLTL</li>
      <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />a320 by FBW</li>
    </ul>
  </li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://github.com/ResetXPDR/MSFS2020_AutoFPS/releases">AutoFPS</a> - Install with “start with FSUIPC”</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />GSX via FSDT Live Updater</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />REX Accuseason Updater</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />REX Accuweather (in-app, click the automation thing)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://flightsim.to">flightsim.to</a> (Includes ModManFX, SkyDolly etc)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://github.com/bvibber/hdrfix/releases">hdrfix</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Spad.Next - in app update</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />TrackIR - in app update</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://navigraph.com/downloads">Navigraph Simlink</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://navigraph.com/downloads">Navigraph HUB</a> (Start the app, do the updates)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Tacview -&gt; In-app, Help icon, check for updates</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />LRM Client</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />SimRacingStudio</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />LoupeDeck</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" /><a href="https://www.simbrief.com/home/index.php?page=fms-downloader">Simbrief Downloader</a></li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />and finally MSFS</li>
</ul>

<h1 id="startup-checklist">Startup Checklist</h1>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />LRM Client (Autostart with Windows)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Simbrief Downloader (Autostart with Windows)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Loupedeck (Autostart with Windows)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />SimRacingStudio (Autostart with Windows)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Navigraph Simlink (Autostart with Windows)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />FSUIPC (Autostart with MSFS)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />GSX (Autostart with MSFS)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />AutoFPS (Autostart with MSFS via FSUIPC)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />hdrfix bat file</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Tacview Bridge for MSFS</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />SkyDolly</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />TrackIR</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Spad.Next</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Navigraph Charts</li>
</ul>]]></content><author><name>Milos Kaurin</name></author><category term="gaming" /><category term="msfs" /><category term="Microsoft Flight Simulator" /><category term="checklist" /><category term="gaming" /><category term="utility" /><summary type="html"><![CDATA[My personal MSFS ecosystem has grown so large that I require checklists.]]></summary></entry><entry><title type="html">Installing Arch on a 2015 MacBookPro</title><link href="https://blog.kaurin.cc/linux/arch-on-macbookpro-2015/" rel="alternate" type="text/html" title="Installing Arch on a 2015 MacBookPro" /><published>2024-05-05T16:00:00+01:00</published><updated>2024-05-05T16:00:00+01:00</updated><id>https://blog.kaurin.cc/linux/arch-on-macbookpro-2015</id><content type="html" xml:base="https://blog.kaurin.cc/linux/arch-on-macbookpro-2015/"><![CDATA[<p>These are my notes on what I did to get Arch running on a MacBookPro 11,5 (Mid-2015)</p>

<p>My setup has no swap, EFI boot, encrypted root (single partition)</p>

<h1 id="disclaimer">Disclaimer</h1>

<p><strong>These are very destructive procedures. I bare no responsibility for any damages done to your system.</strong></p>

<h1 id="boot-into-the-arch-install-usb">Boot into the arch install USB</h1>

<h2 id="live-system-wifi">Live System Wifi</h2>

<p>It is worth mentioning that I first connected to my wifi network using the <code class="language-plaintext highlighter-rouge">iwctl</code> utility. 
I actually didn’t make note of the commands there, but from memory I think they were:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>station wlan0 connect MY_WIFI_SSID
station wlan0 show
</code></pre></div></div>

<h2 id="prep-root-password-and-ssh">Prep root password and SSH</h2>

<p>My next step is to set a root password, enable root login in the sshd config, and start the sshd service.</p>

<p>Note: This unsafe SSH setup is for the live system only and does not propagate to the installed system.</p>

<h2 id="log-in-remotely-and-start-setting-up-the-system">Log in remotely and start setting up the system</h2>

<p>I like to do this because all my notes are on a working, stable system. When I inevitably have to iterate, using remote access proves to be super useful.</p>

<p>First, let’s wipe our disk (you’ve been warned by the disclaimer!)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wipefs <span class="nt">-a</span> /dev/sda
</code></pre></div></div>

<p>Set up partitions</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>parted /dev/sda mklabel gpt
parted /dev/sda mkpart boot fat32 0% 1GB
parted /dev/sda <span class="nb">set </span>1 esp on
parted /dev/sda mkpart luks 1GB 100%
</code></pre></div></div>

<p>Set up encryption</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cryptsetup <span class="nt">-y</span> <span class="nt">-v</span> luksFormat /dev/sda2
cryptsetup open /dev/sda2 root
</code></pre></div></div>

<p>Optional: Fill up the disk space (takes a long time)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">dd </span><span class="k">if</span><span class="o">=</span>/dev/urandom <span class="nv">of</span><span class="o">=</span>/dev/mapper/root <span class="nv">bs</span><span class="o">=</span>1M
</code></pre></div></div>

<p>Create rootFS and mount</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.xfs /dev/mapper/root
mount /dev/mapper/root /mnt
</code></pre></div></div>

<p>Set up the EFI partition</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mkfs.fat <span class="nt">-F32</span> /dev/sda1
mount <span class="nt">--mkdir</span> /dev/sda1 /mnt/boot
</code></pre></div></div>

<p>Basic bootstrap &amp; fstab &amp; chroot</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacstrap <span class="nt">-K</span> /mnt base linux linux-firmware
genfstab <span class="nt">-U</span> /mnt <span class="o">&gt;&gt;</span> /mnt/etc/fstab
arch-chroot /mnt
</code></pre></div></div>

<p>Can’t live without vim</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> vim
</code></pre></div></div>

<p>Timezone, timesync</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ln</span> <span class="nt">-sf</span> /usr/share/zoneinfo/Europe/Dublin /etc/localtime
hwclock <span class="nt">--systohc</span>
</code></pre></div></div>

<p>Locale</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>localectl set-locale <span class="nv">LANG</span><span class="o">=</span>en_US.UTF-8
<span class="nb">echo</span> <span class="s2">"en_US.UTF-8 UTF-8"</span> <span class="o">&gt;</span> /etc/locale.gen
locale-gen

<span class="c"># These two commands are just for the current session. May not be needed</span>
<span class="nb">unset </span>LANG
<span class="nb">source</span> /etc/profile.d/locale.sh
</code></pre></div></div>

<p>Hostname</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo </span>myhostname <span class="o">&gt;</span> /etc/hostname
</code></pre></div></div>

<p>initramfs modifications in <code class="language-plaintext highlighter-rouge">/etc/mkinitcpio.conf</code>
We want the amdgpu driver to have precedence over radeon</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block encrypt filesystems fsck)
MODULES=(amdgpu radeon)
</code></pre></div></div>

<p>Ensure we are using the amdgpu with the appropriate family support</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s2">"options amdgpu si_support=1"</span> <span class="o">&gt;</span> /etc/modprobe.d/amdgpu.conf
<span class="nb">echo</span> <span class="s2">"options radeon si_support=0"</span> <span class="o">&gt;</span> /etc/modprobe.d/radeon.conf
</code></pre></div></div>

<p>Install xfsprogs before we re-bake initramfs</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> xfsprogs
mkinitcpio <span class="nt">-P</span>
</code></pre></div></div>

<p>Gnome &amp; friends</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> mesa libva-mesa-driver mesa-vdpau vulkan-radeon vulkan-intel
pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> gnome gnome-extra
</code></pre></div></div>

<p>Enable gdm</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl <span class="nb">enable </span>gdm
</code></pre></div></div>

<p>More software…</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> less rsync firefox htop i2c-tools lm_sensors aspell hunspell hunspell-en_us hunspell-en_gb wget
</code></pre></div></div>

<p>Devel and AUR software</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-S</span> <span class="nt">--needed</span> base-devel git
</code></pre></div></div>

<p>Audio software</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> <span class="nb">sudo </span>networkmanager
pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> pipewire wireplumber alsa-utils 
</code></pre></div></div>

<p>Enable networkmanager and sshd</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>systemctl <span class="nb">enable </span>NetworkManager
systemctl <span class="nb">enable </span>sshd
</code></pre></div></div>

<p>Enable gnome power control panel options</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> power-profiles-daemon
systemctl <span class="nb">enable </span>power-profiles-daemon
</code></pre></div></div>

<p>Add my user</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>useradd <span class="nt">-m</span> myusername
passwd myusername
usermod <span class="nt">-aG</span> wheel myusername
</code></pre></div></div>

<p>Root password</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>passwd
</code></pre></div></div>

<p>Install and setup refind (needed for osx spoofing)</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pacman <span class="nt">-Syu</span> <span class="nt">--noconfirm</span> refind
refind-install
</code></pre></div></div>

<p>Edit <code class="language-plaintext highlighter-rouge">/boot/efi/EFI/refind/refind.conf</code></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>spoof_osx_version 10.11
</code></pre></div></div>

<p>List our encrypted root block device ID</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">ls</span> <span class="nt">-l</span> /dev/disk/by-uuid/ | <span class="nb">grep </span>sda2
<span class="c"># lrwxrwxrwx 1 root root 10 May  5 15:01 EXAMPLE_UUID -&gt; ../../sda2</span>
</code></pre></div></div>

<p>Edit <code class="language-plaintext highlighter-rouge">/boot/refind_linux.conf</code>. Find “Boot with Standard options” (first entry). Add the following kernel options</p>

<p>Make sure to use the correct UUID as per what we got above</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>acpi_osi=Darwin acpi_backlight=native radeon.si_support=0 amdgpu.si_support=1 cryptdevice=UUID=EXAMPLE_UUID:root root=/dev/mapper/root rw add_efi_memmap
</code></pre></div></div>

<p>Disable suspend. We do this because currently there is a, what looks like, a kernel bug that crashes amdgpu on S3 suspend.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /etc/systemd/sleep.conf.d
vim /etc/systemd/sleep.conf.d/disable-suspend.conf
</code></pre></div></div>

<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">[Sleep]</span>
<span class="py">AllowSuspend</span><span class="p">=</span><span class="s">no</span>
<span class="py">AllowHibernation</span><span class="p">=</span><span class="s">no</span>
<span class="py">AllowHybridSleep</span><span class="p">=</span><span class="s">no</span>
<span class="py">AllowSuspendThenHibernate</span><span class="p">=</span><span class="s">no</span>
</code></pre></div></div>

<h1 id="finally">Finally…</h1>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">exit
</span>umount <span class="nt">-R</span> /mnt
reboot
</code></pre></div></div>

<h1 id="references">References</h1>

<h2 id="general-arch-installation-references">General Arch installation references</h2>

<ul>
  <li>https://wiki.archlinux.org/title/Installation_guide</li>
  <li>https://wiki.archlinux.org/title/Arch_boot_process#Boot_loader</li>
  <li>https://wiki.archlinux.org/title/REFInd</li>
  <li>https://www.rodsbooks.com/refind/linux.html#easiest</li>
  <li>https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system#LUKS_on_a_partition</li>
  <li>https://wiki.archlinux.org/title/MacBookPro11,x</li>
</ul>

<h2 id="arch-sound-references">Arch sound references</h2>

<ul>
  <li>https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture</li>
  <li>https://wiki.archlinux.org/title/PipeWire</li>
  <li>https://wiki.archlinux.org/title/WirePlumber</li>
</ul>

<h2 id="power-management-references">Power management references</h2>

<ul>
  <li>https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate</li>
</ul>

<h2 id="graphics-references">Graphics references</h2>

<ul>
  <li>https://wiki.archlinux.org/title/AMDGPU</li>
  <li>https://wiki.archlinux.org/title/Intel_graphics</li>
  <li><a href="https://bbs.archlinux.org/viewtopic.php?id=288355">Radeon M370X quirk</a></li>
  <li><a href="https://bbs.archlinux.org/viewtopic.php?id=199388">MBP 11,5 suspend hang on arch forums</a></li>
  <li><a href="https://forums.gentoo.org/viewtopic-p-7772846.html?sid=7ab6dd35c3dfc7a38a2c1b02edb15044">MBP 11,5 suspend hang on gentoo forums</a></li>
  <li><a href="https://gitlab.freedesktop.org/drm/amd/-/issues/2711">Possible related MBP suspend hang bug on freedesktop gitlab</a></li>
</ul>]]></content><author><name>Milos Kaurin</name></author><category term="linux" /><category term="linux" /><category term="arch-linux" /><category term="apple" /><category term="macbook" /><category term="macbookpro" /><summary type="html"><![CDATA[These are my notes on what I did to get Arch running on a MacBookPro 11,5 (Mid-2015)]]></summary></entry><entry><title type="html">Mounting libvirt block devices with losetup</title><link href="https://blog.kaurin.cc/virtualization/mounting-libvirt-block-devices-with-losetup/" rel="alternate" type="text/html" title="Mounting libvirt block devices with losetup" /><published>2024-05-02T18:00:00+01:00</published><updated>2024-05-02T18:00:00+01:00</updated><id>https://blog.kaurin.cc/virtualization/mounting-libvirt-block-devices-with-losetup</id><content type="html" xml:base="https://blog.kaurin.cc/virtualization/mounting-libvirt-block-devices-with-losetup/"><![CDATA[<p>How to perform disk surgery on a “cold” libvirt volume.</p>

<h1 id="disclaimer">Disclaimer</h1>

<p><strong>These are very destructive procedures. I bare no responsibility for any damages done to your system.</strong></p>

<h1 id="problem">Problem</h1>

<p>Sometimes we are very smart and provision our virtual machine using a cloud image and “nocloud” metadata to provision a passwordless system that only allows key-based SSH access.</p>

<p>Sometimes we are not so smart and destroy our network access to the machine which propagates on reboot. Because we have a passwordless virt, using <code class="language-plaintext highlighter-rouge">virsh console</code> won’t save us.</p>

<p>In my case, disabling a systemd service was all that was needed for the fix. This can be done on a “cold” OS disk by symlinking the service to <code class="language-plaintext highlighter-rouge">/dev/null</code> - so, disk surgery.</p>

<p>This particular VM was a Fedora 39 based on the cloud image, which has 5 partitions out of the box - and the target device on the virt host was a LVM volume. This guide should work for any block storage volume aside from LVM, but I haven’t tested it.</p>

<h1 id="procedure">Procedure</h1>

<p>Before you get started, check whether you are using the <code class="language-plaintext highlighter-rouge">/dev/loop0</code> device for anything else. You should also be able to use any of the available <code class="language-plaintext highlighter-rouge">/dev/loopX</code> devices in your system (not tested).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Status</span>
losetup <span class="nt">-a</span>

<span class="c"># Setup loop dev</span>
losetup <span class="nt">-P</span> /dev/loop0 /dev/mapper/libvirt_lvm-samba

<span class="c"># Check status again (we should now see output)</span>
losetup <span class="nt">-a</span>

<span class="c"># See partitions</span>
lsblk | <span class="nb">grep </span>loop0

<span class="c"># Mount desired partition</span>
mount /dev/loop0p5 /mnt

<span class="c"># Do some work on your mountpoint</span>

<span class="c"># Umount </span>
umount /mnt

<span class="c"># undefine loop dev</span>
losetup <span class="nt">-d</span> /dev/loop0

<span class="c"># Check if no output shown</span>
losetup <span class="nt">-a</span>
</code></pre></div></div>]]></content><author><name>Milos Kaurin</name></author><category term="virtualization" /><category term="kvm" /><category term="libvirt" /><category term="lvm" /><category term="losetup" /><category term="virtualization" /><summary type="html"><![CDATA[How to perform disk surgery on a “cold” libvirt volume.]]></summary></entry></feed>