<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="https://blog.checo.cc/en/rss.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <atom:link href="https://blog.checo.cc/en/rss.xml" rel="self" type="application/rss+xml"/>
    <title>Checo&amp;apos;s Blog</title>
    <link>https://blog.checo.cc/en/</link>
    <description>Cloud / DevOps / Security / Frontend / Transport / Photography</description>
    <language>en-US</language>
    <pubDate>Thu, 30 Jul 2026 05:59:56 GMT</pubDate>
    <lastBuildDate>Thu, 30 Jul 2026 05:59:56 GMT</lastBuildDate>
    <generator>@vuepress/plugin-feed</generator>
    <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
    <copyright>© 2026 Checo&amp;apos;s Blog. All rights reserved.</copyright>
    <category>AWS</category>
    <category>Windows</category>
    <category>AI</category>
    <category>Developer Tools</category>
    <category>Security Research</category>
    <category>VPS</category>
    <category>DevOps</category>
    <category>Troubleshooting</category>
    <category>Blog</category>
    <category>Networking</category>
    <category>macOS</category>
    <category>Automation</category>
    <category>Gaming</category>
    <category>Security</category>
    <item>
      <title>Shrinking EC2 Windows EBS Root and Data Volumes Safely</title>
      <link>https://blog.checo.cc/en/posts/AWS/ec2-windows-ebs-shrink.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/ec2-windows-ebs-shrink.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Shrinking EC2 Windows EBS Root and Data Volumes Safely</source>
      <description>EBS volumes cannot be shrunk directly. This guide covers online data-volume migration, cold cloning of a Windows root volume, bcdboot boot repair, and NTFS permission validation.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 17 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Amazon EBS supports increasing a volume size, but it does not support shrinking one directly. For a data volume, create a smaller volume and copy the files to it. A Windows root volume, or a data volume containing continuously written files such as SQL Server databases, should be handled offline after stopping the instance.</p>
<p>This example uses Windows Server 2012 R2. The original root and data volumes are both 100 GB gp3 volumes, and the target size is 50 GB each.</p>
<p>Create an AMI before starting, test the procedure in a non-production environment, and schedule the root-volume migration during a maintenance window. Stopping an instance can lose instance-store data and an automatically assigned public IP address (an Elastic IP is not affected).</p>
<!-- more -->
<p>AWS documentation: <a href="https://docs.amazonaws.cn/ebs/latest/userguide/ebs-modify-volume.html#elastic-volumes-limitations" target="_blank" rel="noopener noreferrer">EBS volume modification limitations</a></p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160042887.png" alt="Disk Management before migration" tabindex="0" loading="lazy"><figcaption>Disk Management before migration</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160436450.png" alt="C drive admin-only test file" tabindex="0" loading="lazy"><figcaption>C drive admin-only test file</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160534971.png" alt="C drive everyone-read test file" tabindex="0" loading="lazy"><figcaption>C drive everyone-read test file</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160042880.png" alt="D drive admin-only test file" tabindex="0" loading="lazy"><figcaption>D drive admin-only test file</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160328481.png" alt="D drive everyone-read test file" tabindex="0" loading="lazy"><figcaption>D drive everyone-read test file</figcaption></figure>
<h2>1. Migrate the data volume (D: to a new 50 GB volume)</h2>
<p>The data volume can be copied online, without downtime.</p>
<h3>1. Create and attach the new EBS volume</h3>
<p>Create a 50 GB EBS volume in the same Availability Zone as the instance and attach it. In Windows Disk Management, bring it online, initialize it with the same partition style as the source (MBR or GPT), create a simple NTFS volume, and assign drive letter <code>E:</code>.</p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717165313509.png" alt="Initialize the new data volume" tabindex="0" loading="lazy"><figcaption>Initialize the new data volume</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717165358388.png" alt="New volume initialized as E:" tabindex="0" loading="lazy"><figcaption>New volume initialized as E:</figcaption></figure>
<h3>2. Copy the data with robocopy</h3>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">robocopy D:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> E</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:\ /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MIR</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">COPYALL</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">R</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">W</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">LOG</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:C:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">robocopy</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-d.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">log</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><ul>
<li><code>/MIR</code>: mirror the directory tree.</li>
<li><code>/COPYALL</code>: equivalent to <code>/COPY:DATSOU</code>; copies data, attributes, timestamps, NTFS security, owner, and auditing information.</li>
<li><code>/R:1 /W:1</code>: retry once and wait one second.</li>
<li><code>/LOG</code>: write a log for review.</li>
</ul>
<h3>3. Verify the data volume</h3>
<p>Check the log, permissions, and sample files:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">type C:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">robocopy</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-d.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">log</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">findstr</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "FAILED"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">icacls E:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">PermTest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">\*</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dir E:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">PermTest</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">type E:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">PermTest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">admin</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-only.txt</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Confirm that the copy completed without failed files and that representative NTFS permissions match the source volume.</p>
<h3>4. Swap the drive letter online</h3>
<p>In Disk Management, change the original <code>D:</code> volume to a temporary letter such as <code>X:</code>, then change the new <code>E:</code> volume to <code>D:</code>. Verify that applications can access <code>D:</code> normally.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-WmiObject</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Win32_LogicalDisk </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Filter </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"DeviceID='D:'"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | Select Size, FreeSpace</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Keep the original volume offline until validation is complete. Then detach it from EC2 and delete it only after confirming that the new volume is healthy.</p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717165913224.png" alt="Change the drive letter" tabindex="0" loading="lazy"><figcaption>Change the drive letter</figcaption></figure>
<h2>2. Migrate the system volume (C: to a new 50 GB volume)</h2>
<p>System files are locked while Windows is running, so the root volume must be cloned offline from a helper instance.</p>
<h3>1. Record the original instance information</h3>
<p>Record the original instance Availability Zone, instance ID, root volume ID, root device name, and partition style before making changes.</p>
<h3>2. Prepare the helper instance</h3>
<p>Launch a Windows Server helper instance in the same Availability Zone and install DiskGenius (the free edition is sufficient): <a href="https://www.diskgenius.cn/download/downloadURL.php?Name=DG_64" target="_blank" rel="noopener noreferrer">DiskGenius download</a>.</p>
<h3>3. Stop the original instance and detach the root volume</h3>
<p>Stop the original instance, wait for the <code>Stopped</code> state, and detach its root volume.</p>
<h3>4. Create a new 50 GB volume</h3>
<p>Create a new 50 GB gp3 volume in the same Availability Zone as the helper and original instances.</p>
<h3>5. Attach the original and new volumes to the helper</h3>
<p>Attach both the original 100 GB root volume and the empty 50 GB volume to the helper instance. In Disk Management, bring the original volume online but cancel the initialization wizard for the new volume. Do not format or partition the target; DiskGenius will write the cloned disk layout.</p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174240967.png" alt="Two volumes attached to the helper instance" tabindex="0" loading="lazy"><figcaption>Two volumes attached to the helper instance</figcaption></figure>
<h3>6. Clone the disk with DiskGenius</h3>
<ol>
<li>Confirm that the helper system disk, the original root disk (including System Reserved and <code>C:</code>), and the empty target disk are visible.</li>
<li>Choose <strong>Tools → Clone Disk</strong>.</li>
<li>Select the original root disk as the source and the 50 GB volume as the target.</li>
<li>Because the target is smaller, choose <strong>Copy files</strong> rather than sector-by-sector or filesystem-structure cloning.</li>
<li>Adjust the partition boundaries if DiskGenius allocates excessive space to System Reserved. Leave enough space for the Windows partition.</li>
<li>Start the task and choose <strong>Execute after locking</strong>.</li>
</ol>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174304647.png" alt="DiskGenius main window" tabindex="0" loading="lazy"><figcaption>DiskGenius main window</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174504656.png" alt="Select the source disk" tabindex="0" loading="lazy"><figcaption>Select the source disk</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174521885.png" alt="Select the target disk" tabindex="0" loading="lazy"><figcaption>Select the target disk</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174843108.png" alt="Execute after locking" tabindex="0" loading="lazy"><figcaption>Execute after locking</figcaption></figure>
<h3>7. Rebuild the boot files</h3>
<p>After file-level cloning, the disk signature changes and the BCD partition references may be invalid. Windows can then fail with <code>0xc0000225 winload.exe</code>. Bring the new volume online and assign drive letters in Disk Management.</p>
<p>If the disk has a System Reserved partition (for example <code>F:</code>) and the Windows partition is <code>G:</code>, run:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdboot G:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Windows</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">s</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> F: /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">f</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> BIOS</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">l</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> en</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">us</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If there is only one partition (<code>G:</code>), run:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdboot G:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Windows</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">s</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> G: /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">f</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> BIOS</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">l</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> en</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">us</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Confirm that the command reports that the boot files were successfully created. Then mark the boot partition active. Replace the disk and partition numbers with the values shown by <code>list disk</code> and <code>list partition</code>:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">diskpart</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">list disk</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">select</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> disk </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">2</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">list partition</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">select</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> partition </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">active</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">exit</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717185122474.png" alt="New volume online after cloning" tabindex="0" loading="lazy"><figcaption>New volume online after cloning</figcaption></figure>
<h3>8. Attach the new volume as the original instance root</h3>
<p>Detach both volumes from the helper instance. Attach the 50 GB clone to the original instance as <code>/dev/sda1</code>, the root-device position.</p>
<h3>9. Start the original instance and verify</h3>
<p>Start the instance. Connect over RDP and confirm that Windows boots normally and that the system disk is the expected size.</p>
<h2>3. Final validation</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-WmiObject</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Win32_LogicalDisk |</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  Select DeviceID,</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">N</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'SizeGB'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">E</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">math</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]::Round($_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.Size</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">GB</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)}},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">N</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'FreeGB'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">E</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">math</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]::Round($_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.FreeSpace</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">GB</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)}}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">systeminfo | findstr </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">i </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"boot"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Are NTFS permissions preserved?</h2>
<ul>
<li><strong>Data volume:</strong> <code>/COPYALL</code> preserves DACL, SACL, owner, and auditing data. Compare the result with <code>icacls</code>.</li>
<li><strong>Root volume:</strong> DiskGenius copies the NTFS file system, including permission metadata in <code>$MFT</code> and <code>$Secure</code>.</li>
</ul>
<p>No additional permission migration tool is required. Always verify representative administrator-only and everyone-read files before deleting the original volumes.</p>
<h2>References</h2>
<ol>
<li><a href="https://docs.amazonaws.cn/ebs/latest/userguide/ebs-modify-volume.html#elastic-volumes-limitations" target="_blank" rel="noopener noreferrer">AWS EBS volume modification limitations</a></li>
<li><a href="https://docs.amazonaws.cn/AWSEC2/latest/WindowsGuide/ebs-detaching-volume.html" target="_blank" rel="noopener noreferrer">AWS detaching an EBS volume</a></li>
<li><a href="https://diskgenius.com/manual/clone-disk.php" target="_blank" rel="noopener noreferrer">DiskGenius Clone Disk</a></li>
<li><a href="https://blog.csdn.net/lpwmm/article/details/159769397" target="_blank" rel="noopener noreferrer">EC2 Windows EBS volume shrinking in practice (CSDN)</a></li>
</ol>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/ec2-windows-ebs-shrink/file-20260717160042887.png" type="image/png"/>
    </item>
    <item>
      <title>Updating Hermes Desktop from a Fork</title>
      <link>https://blog.checo.cc/en/posts/AI/8.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/8.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Updating Hermes Desktop from a Fork</source>
      <description>Update a source-installed Hermes Desktop fork from upstream main when no new release exists, using fetch, rebase, dependency installation, and doctor checks.</description>
      <category>AI</category>
      <category>Developer Tools</category>
      <pubDate>Wed, 01 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Hermes Desktop updates from GitHub release tags, not every new commit on upstream <code>main</code>. When a fork needs to test newer code early, synchronize the source checkout manually.</p>
<!-- more -->
<h2>Confirm the situation</h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">cd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ~/.hermes/hermes-agent</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> log</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --oneline</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -1</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> describe</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --tags</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --always</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> remote</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -v</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Compare the latest release with upstream <code>main</code>. If the release is unchanged but <code>main</code> moved forward, automatic updating is behaving as designed.</p>
<h2>Workflow</h2>
<h3>1. Back up configuration and inspect the workspace</h3>
<p>Back up configuration and inspect local changes:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">cp</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ~/.hermes/config.yaml</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ~/.hermes/config.yaml.bak.</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">$(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">date</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> +%Y%m%d_%H%M%S</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> status</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --short</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Handle local changes first. Generated build output should not be edited or committed manually; commit valuable source changes to your own branch before synchronizing.</p>
<h3>2. Fetch upstream</h3>
<p>Fetch the official repository, not just your fork:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fetch</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> upstream</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> main</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p><code>origin</code> normally points to your fork, while <code>upstream</code> points to the official repository. Running only <code>git pull origin main</code> may leave you on outdated fork code.</p>
<h3>3. Merge or rebase</h3>
<p>If the fork has no additional commits:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> merge</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> upstream/main</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --ff-only</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If the fork has its own commits, rebase instead:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> rebase</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> upstream/main</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Resolve conflicts, stage the files, and run <code>git rebase --continue</code>.</p>
<h3>4. Update the virtual environment and verify</h3>
<p>Install the editable package and verify it:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./venv/bin/pip3</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> install</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -e</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> .</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./venv/bin/python3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -m</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> hermes_cli.main</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --version</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./venv/bin/python3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -m</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> hermes_cli.main</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> doctor</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Restart Hermes Desktop after the checks pass; an already-running process will not load the new source automatically.</p>
<h2>Key conclusions</h2>
<ul>
<li>No new release means no automatic desktop update; that is expected.</li>
<li><code>fetch upstream</code> plus merge/rebase is the core fork-sync workflow.</li>
<li>User configuration, skills, and sessions are separate from the source checkout, but should still be backed up.</li>
<li>Extra commits may appear in <code>git describe</code> while the release version remains unchanged.</li>
<li>Pin a known-good commit and keep a rollback point; <code>git reflog</code> can recover the pre-rebase state.</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>Codex CLI Sandboxing: Seatbelt, Bubblewrap, Landlock, and Docker</title>
      <link>https://blog.checo.cc/en/posts/AI/9.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/9.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Codex CLI Sandboxing: Seatbelt, Bubblewrap, Landlock, and Docker</source>
      <description>A source-oriented explanation of Codex CLI sandboxing across macOS Seatbelt, Linux Bubblewrap/Landlock/seccomp, Windows Restricted Token, and Docker Desktop.</description>
      <category>AI</category>
      <category>Security Research</category>
      <pubDate>Mon, 13 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Codex CLI's <code>read-only</code>, <code>workspace-write</code>, and <code>danger-full-access</code> modes are policy settings. The actual isolation is enforced by platform backends. This article connects the source-level view with the common macOS and Linux sandbox primitives.</p>
<!-- more -->
<h2>Architecture</h2>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Command request</span></span>
<span class="line"><span>  ↓</span></span>
<span class="line"><span>Approval policy</span></span>
<span class="line"><span>  ↓</span></span>
<span class="line"><span>Sandbox type</span></span>
<span class="line"><span>  ↓</span></span>
<span class="line"><span>Seatbelt / Bubblewrap + seccomp / Restricted Token</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Approval answers whether an action needs confirmation; sandboxing limits what an approved process can touch.</p>
<h2>macOS Seatbelt</h2>
<p>The macOS backend loads an SBPL profile through <code>sandbox-exec</code>. A profile starts from denied capabilities and adds exceptions for the workspace, temporary directories, interpreters, and network policy.</p>
<ul>
<li><code>read-only</code> does not allow workspace writes.</li>
<li><code>workspace-write</code> opens the workspace and explicit <code>writable_roots</code>.</li>
<li>Network access is a separate policy; write access does not imply network access.</li>
<li>Child processes generally inherit the process restriction.</li>
</ul>
<h2>Linux backends</h2>
<p>Bubblewrap builds the process filesystem view with read-only system mounts and writable workspace bindings. seccomp-BPF filters system calls; it is not a path permission system. Landlock provides path-oriented kernel access control and can restrict opening, writing, executing, and deleting files, subject to kernel support.</p>
<p><code>no_new_privs</code> prevents setuid and file capabilities from granting additional privilege and is an important companion to seccomp and Landlock.</p>
<h2>Windows Restricted Token</h2>
<p>The Windows backend uses a Restricted Token together with system ACLs and child-process rules. It does not map one-to-one to macOS profiles or Linux namespaces, so it should not be understood only as a directory read/write model.</p>
<h2>How it differs from Docker</h2>
<p>Docker Desktop on macOS normally runs Linux containers inside a Linux VM provided by Apple Virtualization.framework. Container isolation happens inside that VM and is a different layer from Seatbelt restrictions applied to a host process.</p>
<p>| Mechanism | Main boundary | Typical capability |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>VPS Benchmark Script Collection</title>
      <link>https://blog.checo.cc/en/posts/VPS/3.html</link>
      <guid>https://blog.checo.cc/en/posts/VPS/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">VPS Benchmark Script Collection</source>
      <description>A practical VPS benchmarking index covering CPU, disk, network, streaming access, IP reputation, and return routes, with safety notes for remote scripts.</description>
      <category>VPS</category>
      <category>DevOps</category>
      <pubDate>Fri, 26 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Run a baseline after buying a VPS before deciding whether it is suitable for hosting, proxying, storage, or production services. This index groups the most useful tools by test target.</p>
<!-- more -->
<h2>One-shot benchmarks</h2>
<h3>NodeQuality</h3>
<p>NodeQuality is the simplest all-in-one option. It covers CPU, disk, network, IP quality, streaming access, and route information:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/xykt/NodeQuality/main/NodeQuality.sh)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3>YABS, <a href="http://bench.sh" target="_blank" rel="noopener noreferrer">bench.sh</a>, and SuperBench</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> yabs.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">wget</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -qO-</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> bench.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">wget</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -qO-</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/spiritLHLS/superbench/main/superbench.sh)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>These scripts run several tests at once and may write heavily to disk. Avoid business hours on production hosts.</p>
<h2>Component tests</h2>
<h3>CPU</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Run the official Linux CLI after downloading Geekbench</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./geekbench6</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># UnixBench</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> clone</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://github.com/kdlucas/byte-unixbench.git</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">cd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> byte-unixbench/UnixBench</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x26;&#x26; </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">make</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x26;&#x26; </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./Run</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>Disk</h3>
<p><code>fio</code> is better suited than <code>dd</code> for comparing IOPS and queue depth. Do not run long random-write tests directly against a production disk.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> apt</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> install</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -y</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fio</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">fio</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --name=randread</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --filename=/tmp/fio.test</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --size=1G</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --bs=4k</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --rw=randread</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --ioengine=libaio</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --direct=1</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --runtime=60</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --time_based</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>Network, streaming, and IP quality</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">speedtest</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/i-abc/speed-test/main/speedtest.sh)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">iperf3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -c</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">server_i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">p> </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">-t</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 30</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/xykt/IPQuality/main/ip.sh)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>Return routes</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sh</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> nxtrace.org/nt/install.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">nexttrace</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">target_i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">p></span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Recommended workflow</h2>
<p>Start with NodeQuality, then repeat with YABS, IPQuality, a streaming check, and backtrace when needed. Record the instance type, region, test time, disk type, and network limits so results remain comparable.</p>
<h2>Safety notes</h2>
<ul>
<li>Read remote scripts before running them; do not blindly use <code>curl | bash</code> on production hosts.</li>
<li>Disk tests can create substantial writes. Use a temporary file, never a business data path.</li>
<li>Public iperf3 servers are variable; treat their results as approximate.</li>
<li>Do not publish public IPs, complete routes, or secrets with benchmark logs.</li>
<li>Old <code>bash.icu</code>, <code>ilemonra.in</code>, and <code>check.unlock.moe</code> links are no longer reliable; use project repositories.</li>
</ul>
<p>| Target | Recommended tools |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>VPS Backup Design: Database Dumps + rsync</title>
      <link>https://blog.checo.cc/en/posts/VPS/4.html</link>
      <guid>https://blog.checo.cc/en/posts/VPS/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">VPS Backup Design: Database Dumps + rsync</source>
      <description>A VPS backup design combining MySQL/PostgreSQL logical dumps with rsync synchronization, scheduled jobs, retention, and recovery verification.</description>
      <category>VPS</category>
      <category>DevOps</category>
      <pubDate>Wed, 08 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Synchronizing container directories alone is not a complete backup. Databases need consistent logical exports, while configuration, certificates, and attachments are good candidates for incremental <code>rsync</code> synchronization.</p>
<!-- more -->
<h2>Layers</h2>
<p>| Layer | Method | Contents |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Hermes Agent Crash Analysis: an asyncio Cleanup Error Triggers a Gateway Restart Loop</title>
      <link>https://blog.checo.cc/en/posts/AI/5.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Hermes Agent Crash Analysis: an asyncio Cleanup Error Triggers a Gateway Restart Loop</source>
      <description>After a Hermes gateway CLI process runs for ~48 hours, an asyncio exception during shutdown cleanup cascades into repeated SIGTERM restarts. Full breakdown of the crash chain and root cause fix.</description>
      <category>AI</category>
      <category>Troubleshooting</category>
      <pubDate>Wed, 20 May 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After a Hermes gateway had been online for about 48 hours, the CLI process threw an exception during its shutdown cleanup, which cascaded into the gateway being repeatedly restarted by SIGTERM, forming a vicious &quot;restart interrupts session -&gt; user reconnects -&gt; interrupted again&quot; loop that left the CLI down for about 12 minutes. This post breaks down the full crash chain and root cause.</p>
<!-- more -->
<h2>Background</h2>
<p>| Item | Info |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Debugging an Hermes Telegram API Timeout Caused by a Proxy</title>
      <link>https://blog.checo.cc/en/posts/AI/6.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/6.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Debugging an Hermes Telegram API Timeout Caused by a Proxy</source>
      <description>A Telegram bot keeps showing typing without replying. Root cause: the launchd-started gateway process does not inherit system proxy environment variables, connecting directly to an overseas API and timing out.</description>
      <category>AI</category>
      <category>Troubleshooting</category>
      <pubDate>Thu, 04 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>The Telegram bot kept showing &quot;typing&quot; without ever replying, while the terminal CLI using the exact same model worked perfectly at the same time. It turned out the launchd-started gateway process doesn't inherit the system proxy environment variables, and the proxy lines in <code>.env</code> were commented out — so the gateway connected directly to an overseas API and timed out.</p>
<!-- more -->
<h2>Symptom</h2>
<p>The user sent a message to the Hermes bot via Telegram:</p>
<ul>
<li>The bot showed &quot;typing...&quot; but never replied</li>
<li>After several minutes, a <code>No response from provider for 180s</code> error arrived</li>
<li>At the same time, the terminal CLI using the same model worked perfectly, 5-10s per response</li>
</ul>
<p>Error log:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>⚠️ No response from provider for 180s (model: mimo-v2.5-pro, context: ~20,614 tokens). Reconnecting...</span></span>
<span class="line"><span>⚠️ API call failed (attempt 1/3): APITimeoutError</span></span>
<span class="line"><span>   🔌 Provider: custom  Model: mimo-v2.5-pro</span></span>
<span class="line"><span>   🌐 Endpoint: https://YOUR-API-ENDPOINT/v1</span></span>
<span class="line"><span>   📝 Error: Request timed out.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Investigation</h2>
<h3>Initial hypothesis (wrong direction)</h3>
<p>At first I suspected the API was unstable or the streaming timeout was too short: the log showed <code>Stream stale for 180s (threshold 180s) — no chunks received</code>, suggesting raising <code>HERMES_STREAM_STALE_TIMEOUT=300</code>. But the user pointed out the CLI with the same model worked perfectly.</p>
<div class="hint-container tip">
<p class="hint-container-title">Lesson</p>
<p>When the same API behaves differently across clients, the problem is almost certainly not the API but a client-side difference.</p>
</div>
<h3>Check the proxy config</h3>
<p>The system environment had a proxy:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">$</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> env</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> proxy</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">HTTP_PROXY</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">http://127.0.0.1:10808</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">HTTPS_PROXY</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">http://127.0.0.1:10808</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">ALL_PROXY</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">socks5h://127.0.0.1:10808</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The proxy is Xray on port 10808. Testing the API through it worked:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">$</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --proxy</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> http://127.0.0.1:10808</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://YOUR-API-ENDPOINT/v1/models</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># 200, 0.8s — fine</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>The proxy itself was fine.</p>
<h3>Telegram session stuck in a loop</h3>
<p>The agent.log showed the Telegram session stuck in a loop: receive message, call the API, get killed after 180s of no data, gateway restarts and resumes the session, stuck for 180s again... Deleting the stuck session and restarting the gateway didn't help; new sessions got stuck the same way.</p>
<h3>Comparing CLI vs Telegram API calls</h3>
<p>Key observation: the CLI session's API call completed in 5-10s; the Telegram session's API call timed out at 180s. Same endpoint, same model, completely different behavior.</p>
<h3>Gateway blocked</h3>
<p>The <code>gateway.log</code> stopped producing output after a certain point: the cron ticker stopped printing, new messages stopped being recorded, but the CLI session's agent.log kept writing normally. This meant the gateway process's asyncio event loop was fully blocked by the stuck HTTP request.</p>
<h3>The launchd environment difference (root cause)</h3>
<p>Checking the launchd plist:</p>
<div class="language-xml line-numbers-mode" data-highlighter="shiki" data-ext="xml" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-xml"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>EnvironmentVariables&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">dict</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    &#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>PATH&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    &#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>~/.hermes/hermes-agent/venv/bin:...&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    &#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>VIRTUAL_ENV&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    &#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>~/.hermes/hermes-agent/venv&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    &#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>HERMES_HOME&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">key</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    &#x3C;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>~/.hermes&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">string</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x3C;/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">dict</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">></span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>No HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY!</strong></p>
<p>And the <code>.env</code>:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># HTTP_PROXY=http://127.0.0.1:10808      ← commented out!</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># HTTPS_PROXY=http://127.0.0.1:10808     ← commented out!</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># ALL_PROXY=socks5h://127.0.0.1:10808    ← commented out!</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Case closed:</p>
<p>| Process | Started by | Proxy | API behavior |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Hermes v0.17.0 GPU Power Spike: Debugging a fontations + temporal_rs Render Loop</title>
      <link>https://blog.checo.cc/en/posts/AI/7.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/7.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Hermes v0.17.0 GPU Power Spike: Debugging a fontations + temporal_rs Render Loop</source>
      <description>After upgrading to Hermes v0.17.0, Mac idle power draw jumps from 3-5W to 19W. Using powermetrics and sample, trace it to Chromium&amp;apos;s Rust font engine and Temporal API implementation pegging the GPU every frame.</description>
      <category>AI</category>
      <category>Troubleshooting</category>
      <pubDate>Sun, 28 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After upgrading to Hermes v0.17.0, the Mac's idle power draw jumped from a normal 3-5W to 19W and the fans spun up. Using <code>powermetrics</code> to quantify, <code>ps</code> to localize the process, and <code>sample</code> to grab the call stack, I traced it all the way to Chromium's Rust font engine fontations and the Rust implementation of the Temporal API, temporal_rs, repeatedly formatting time strings and validating glyphs every frame, pinning the GPU at full load. This post records the full investigation.</p>
<!-- more -->
<h2>Background</h2>
<p>| Item | Info |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>x86/x64 Emulation Compatibility on EC2 Graviton Windows 11 ARM</title>
      <link>https://blog.checo.cc/en/posts/AWS/21.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/21.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">x86/x64 Emulation Compatibility on EC2 Graviton Windows 11 ARM</source>
      <description>Full Sysinternals Suite compatibility test on EC2 Graviton t4g.large, comparing ARM64 native vs x64 emulated performance, with operations tool selection recommendations.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After running Windows 11 ARM on EC2 Graviton instances, the most practical question is: do x86/x64 operations tools still work? This article tests the full Sysinternals Suite on t4g.large (Graviton2), comparing ARM64 native vs x64 emulated performance.</p>
<!-- more -->
<h2>Test Environment</h2>
<p>| Item | Configuration |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Graviton Windows 11 ARM ENA Network Performance Tested</title>
      <link>https://blog.checo.cc/en/posts/AWS/22.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/22.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Graviton Windows 11 ARM ENA Network Performance Tested</source>
      <description>Graviton Windows 11 ARM has only one ENA ARM64 driver version (2.2.1). Run a complete iperf3 throughput test to verify whether it can saturate the t4g.large network burst limit.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Running Windows 11 ARM on a Graviton instance requires the AWS ENA ARM64 driver, which currently has only a single version (2.2.1). Can it saturate the t4g.large network burst limit? This article runs a complete iperf3 throughput test.</p>
<!-- more -->
<h2>Test Environment</h2>
<p>| Item | Configuration |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Graviton Windows 11 ARM inbox StorNVMe Driver IO Performance</title>
      <link>https://blog.checo.cc/en/posts/AWS/23.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/23.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Graviton Windows 11 ARM inbox StorNVMe Driver IO Performance</source>
      <description>A DD-installed Windows 11 ARM on Graviton uses the Microsoft inbox StorNVMe instead of AWSNVMe. Run a full diskspd test suite for IOPS and throughput, locating the IO bottleneck on the instance side.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A DD-installed Windows 11 ARM on Graviton uses the Microsoft inbox <code>StorNVMe.sys</code> rather than the official AWS <code>AWSNVMe.sys</code>. Will this inbox driver become an IO bottleneck? This article runs a full diskspd test suite for IOPS and throughput, locking the bottleneck to the instance side.</p>
<!-- more -->
<h2>Test Environment</h2>
<p>| Item | Configuration |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows Update Patch Management on EC2 Graviton Windows 11 ARM</title>
      <link>https://blog.checo.cc/en/posts/AWS/24.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/24.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Update Patch Management on EC2 Graviton Windows 11 ARM</source>
      <description>Verify whether Windows Update works on an unofficially installed Windows 11 ARM on Graviton. Test patch scan, download, and install, confirming the inbox StorNVMe driver is not replaced.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Windows 11 ARM on Graviton is installed through an unofficial path. Can Windows Update still work normally? Will updates replace the inbox StorNVMe driver and break the system? This article runs a complete scan/download/install verification.</p>
<!-- more -->
<h2>Test Environment</h2>
<p>| Item | Configuration |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Configure RRAS as a NAT Gateway on EC2 Windows Server 2022</title>
      <link>https://blog.checo.cc/en/posts/AWS/25.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/25.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Configure RRAS as a NAT Gateway on EC2 Windows Server 2022</source>
      <description>Private-subnet EC2 instances without a public IP: use Windows Server 2022 with RRAS NAT instead of AWS NAT Gateway for egress. Full dual-ENI, routing, and NAT configuration included.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Private-subnet EC2 instances without a public IP, where you don't want to pay for the managed AWS NAT Gateway. You can use a Windows Server 2022 instance with RRAS NAT for egress. This article records the full setup and the pitfalls.</p>
<!-- more -->
<h2>Architecture</h2>
<p>The NAT-GW instance has two ENIs:</p>
<ul>
<li><strong>ENI1 (Public)</strong>: public subnet, has an IGW route, with an EIP attached</li>
<li><strong>ENI2 (Private)</strong>: private subnet, receives client egress traffic</li>
</ul>
<p>Traffic path: Client → VPC route table → ENI2 (Private) → RRAS NAT (SNAT to EIP) → ENI1 (Public) → IGW → Internet</p>
<h2>Prerequisites</h2>
<ul>
<li>Both ENIs of the NAT-GW have <strong>Source/Dest Check disabled</strong></li>
<li>The private subnet route table has <code>0.0.0.0/0 → NAT-GW ENI2</code></li>
<li>Security groups allow traffic from the client subnet to the NAT-GW</li>
</ul>
<h2>Steps</h2>
<h3>1. Create a dual-ENI instance</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Create instance in public subnet with auto-assigned public IP</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws ec2 run</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">instances </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">image</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id ami</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">0668ff427a68f0066 `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">instance</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">type t3.medium `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">subnet</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id subnet</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">public `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">iam</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">instance</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">profile Name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">EC2SSM `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">associate</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">public</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ip</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">address `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">tag</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">specifications </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"ResourceType=instance,Tags=[{Key=Name,Value=NAT-GW}]"</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Disable source/dest check</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws ec2 modify</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">instance</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">attribute </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">instance</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id i</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxxxxx </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">no</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">source</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dest</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">check</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Create the second ENI (private subnet)</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws ec2 create</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">network</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">interface </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">subnet</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id subnet</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">private `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">groups sg</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxx </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">description </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"NAT-GW internal ENI"</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Attach to instance</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws ec2 attach</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">network</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">interface </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">network</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">interface</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id eni</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxxxxx `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">instance</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id i</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxxxxx </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">device</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">index </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Disable source/dest check on the second ENI too</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws ec2 modify</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">network</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">interface</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">attribute `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">network</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">interface</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id eni</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxxxxx </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">no</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">source</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dest</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">check</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>2. Configure the private subnet route table</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws ec2 create</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">route </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">route</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">table</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id rtb</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxxxxx `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">destination</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">cidr</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">block </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0.0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0.0</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">network</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">interface</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">id eni</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">xxxxxxxxx</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>3. Install the RRAS role</h3>
<p>Administrator PowerShell:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Install-WindowsFeature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name Routing </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">IncludeManagementTools</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Install-RemoteAccess</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">VpnType RoutingOnly</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> RemoteAccess</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Status: Running</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>4. Rename adapters and remove the internal default route</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Rename-NetAdapter</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Ethernet 3'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">NewName </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Public'</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Rename-NetAdapter</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Ethernet 4'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">NewName </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Private'</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Remove the default route on the Private adapter</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Remove-NetRoute</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">InterfaceAlias </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Private'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DestinationPrefix </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'0.0.0.0/0'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Confirm:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">$false</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Prevent DHCP lease renewal from restoring the default gateway</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$adapter</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-NetAdapter</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Private'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$guid</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $adapter.InterfaceGuid</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$regPath</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\</span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">guid</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-ItemProperty</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Path </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$regPath</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'DhcpDefaultGateway'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Value </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">@</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">''</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Type MultiString</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Without this registry change, DHCP renews the lease hourly and re-adds the default route, which conflicts with the Public adapter's default route and causes intermittent egress packet loss.</p>
<h3>5. Stop the ICS service</h3>
<p><code>netsh routing ip nat install</code> refuses to install if the SharedAccess service is running. Just stop ICS; leave the firewall on:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Stop-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> SharedAccess </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Force </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ErrorAction SilentlyContinue</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> SharedAccess </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">StartupType Disabled</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Once NAT is configured, having all three Windows Firewall profiles enabled does not affect NAT forwarding — RRAS NAT runs in the kernel via <code>ipnat.sys</code> and bypasses the WFP rule chain.</p>
<h3>6. Enable IP forwarding</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-ItemProperty</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Path </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name IPEnableRouter </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Value </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-NetIPInterface</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">InterfaceAlias </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Public'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Forwarding Enabled</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-NetIPInterface</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">InterfaceAlias </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Private'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Forwarding Enabled</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> RemoteAccess </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Force</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Start-Sleep</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Seconds </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">5</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ipconfig </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">all | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-String</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'IP Routing'</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># IP Routing Enabled. . . . . . . . : Yes</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>7. Configure RRAS NAT</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">netsh routing ip nat install</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Public interface as NAT egress (full = address and port translation)</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">netsh routing ip nat add interface name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Public"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> mode</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">full</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Private interface as internal (private = forward only)</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">netsh routing ip nat add interface name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Private"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> mode</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">private</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">netsh routing ip nat show interface</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>8. Verify</h3>
<p>On the client instance:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">curl.exe</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">s http:</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">//</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">checkip.amazonaws.com</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Egress IP should be the NAT-GW EIP</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ping </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1.1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1.1</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Pitfalls</h2>
<h3>Dual default route (most common)</h3>
<p>The second ENI gets a default route via DHCP with the same metric (20) as the primary adapter. Windows does ECMP load balancing, so half the egress traffic goes out the Private adapter — which has no IGW route and drops the packets. Symptom: intermittent ping/curl failures, occasional TCP timeouts.</p>
<p>Fix: remove the Private adapter's default route + clear <code>DhcpDefaultGateway</code> in the registry, or set the Private adapter InterfaceMetric very high (e.g., 1000).</p>
<h3>New-NetNat does not work on physical adapters</h3>
<p><code>New-NetNat</code> only works with Hyper-V Internal Virtual Switch. On EC2 adapters it shows <code>Active=True</code> but performs no SNAT on forwarded traffic.</p>
<h3>ICS hijacks the IP address</h3>
<p>When ICS is enabled, it automatically changes the Private interface IP to <code>192.168.137.1</code>, overriding the DHCP-assigned VPC address. Packets with mismatched IPs are dropped.</p>
<h3>RRAS does not recognize a hot-attached ENI</h3>
<p>After attaching the second ENI, you must run <code>Restart-Service RemoteAccess</code>, otherwise <code>netsh routing ip show interface</code> will not see the new adapter.</p>
<h2>References</h2>
<ul>
<li><a href="https://docs.amazonaws.cn/vpc/latest/userguide/VPC_NAT_Instance.html" target="_blank" rel="noopener noreferrer">NAT instances - Amazon VPC User Guide</a></li>
<li><a href="https://learn.microsoft.com/zh-cn/powershell/module/remoteaccess/install-remoteaccess" target="_blank" rel="noopener noreferrer">Install-RemoteAccess</a></li>
<li><a href="https://learn.microsoft.com/windows-server/remote/remote-access/ras-gateway/ras-gateway" target="_blank" rel="noopener noreferrer">RAS Gateway</a></li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Windows Sysprep Failure: Notepad++ AppX Package Residue</title>
      <link>https://blog.checo.cc/en/posts/AWS/26.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/26.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Windows Sysprep Failure: Notepad++ AppX Package Residue</source>
      <description>EC2 Windows fails Sysprep when creating an AMI with error 0x80073cf2. Root cause: Notepad++ 8.9+ AppX package residue. Clean up AppX with PowerShell to resolve.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Windows instances fail Sysprep when creating an AMI, reporting error <code>0x80073cf2</code>. The cause is an AppX package registered by Notepad++ 8.9+ that remains even after uninstalling the desktop version.</p>
<!-- more -->
<h2>Symptom</h2>
<p>Three Windows instances failed sysprep. The log at <code>C:\Windows\System32\Sysprep\Panther\setuperr.log</code> shows:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>Error  SYSPRP Package NotepadPlusPlus_1.0.0.0_neutral__2247w0b46hfww was installed for a user, but not provisioned for all users.</span></span>
<span class="line"><span>Error  SYSPRP Failed to remove apps for the current user: 0x80073cf2.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Even after uninstalling the Notepad++ desktop version, sysprep still failed.</p>
<h2>Root Cause</h2>
<p>Notepad++ 8.9 and later register an AppX package (<code>NotepadPlusPlus_1.0.0.0_neutral__2247w0b46hfww</code>). Uninstalling only the desktop version does not remove the AppX package, so sysprep cannot remove the user app.</p>
<p>This is a known Notepad++ issue (<a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13775" target="_blank" rel="noopener noreferrer">GitHub Issue #13775</a>).</p>
<h2>Resolution</h2>
<h3>1. Remove the AppX package</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Remove the Notepad++ AppX package for all users</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-AppxPackage</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">AllUsers </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">*</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">NotepadPlusPlus</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">*</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">ForEach-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">    Remove-AppxPackage</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Package $_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.PackageFullName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">AllUsers </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ErrorAction SilentlyContinue</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Remove the provisioned AppX package</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-AppxProvisionedPackage</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Where-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {$_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.DisplayName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -like</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "*NotepadPlusPlus*"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">} | </span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">    Remove-AppxProvisionedPackage</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>2. Run Sysprep</h3>
<p>Run sysprep with EC2Launch v2 using default settings. After removing the AppX package, sysprep succeeds.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x26; </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"C:\Program Files\Amazon\EC2Launch\EC2Launch.exe"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> sysprep</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2>Summary</h2>
<ul>
<li>Uninstalling only the Notepad++ desktop version does not fix the issue; the AppX package must be removed</li>
<li>Avoid installing Notepad++ 8.9+ before creating a custom AMI, or validate sysprep compatibility beforehand</li>
<li>Create an AMI or snapshot backup before running sysprep</li>
</ul>
<h2>References</h2>
<ul>
<li><a href="https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/sysprep-troubleshoot.html" target="_blank" rel="noopener noreferrer">Troubleshoot Amazon EC2 Windows instance Sysprep issues</a></li>
<li><a href="https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/sysprep-using-ec2launchv2.html" target="_blank" rel="noopener noreferrer">Run Windows Sysprep using EC2Launch v2</a></li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Windows System Time Drifts 8 Hours After Boot</title>
      <link>https://blog.checo.cc/en/posts/AWS/27.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/27.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Windows System Time Drifts 8 Hours After Boot</source>
      <description>After booting, an EC2 Windows instance is 8 hours behind. W32Time applies a one-time 8-hour jump, causing log timestamp chaos and Kerberos failures. Root cause: RTC local time vs UTC confusion.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After an EC2 Windows instance boots, the system time is 8 hours behind. W32Time then applies a one-time 8-hour jump on sync, causing log timestamp chaos and Kerberos failures. The root cause is confusion between RTC local time and UTC.</p>
<!-- more -->
<h2>Symptom</h2>
<p>After boot, the system time is 8 hours behind. After a while (depending on the NTP poll interval), W32Time synchronizes with the NTP source and applies a one-time 8-hour jump, causing application log timestamp chaos, Kerberos authentication failures, and scheduled task anomalies.</p>
<p>This is common on Windows instances with the timezone set to UTC+8 (China Standard Time), especially after stop/start, reboot, or restore from AMI.</p>
<h2>Error Message</h2>
<p>System event log (Event ID 1, source Microsoft-Windows-Kernel-General):</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>System time changed from 2026-06-16T01:52:47Z</span></span>
<span class="line"><span>to 2026-06-16T09:52:47Z</span></span>
<span class="line"><span>Delta: 28800135 ms (~8 hours)</span></span>
<span class="line"><span></span></span>
<span class="line"><span>RTC time in UTC: false</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The key field: <code>RTC time in UTC: false</code> means the hardware RTC clock stores local time, not UTC.</p>
<h2>Root Cause</h2>
<ul>
<li>Windows assumes by default that the RTC hardware clock stores <strong>local time</strong></li>
<li>The EC2 Nitro platform RTC stores <strong>UTC time</strong></li>
<li>When <code>RealTimeIsUniversal</code> is not set, Windows interprets the UTC value in the RTC as local time on boot, then subtracts the timezone offset to get UTC — resulting in 8 hours behind</li>
<li>W32Time then detects the offset and applies a one-time correction (+8h jump)</li>
</ul>
<h2>Solutions</h2>
<p>Create an AMI snapshot backup before proceeding.</p>
<h3>Option 1: Set RealTimeIsUniversal (recommended)</h3>
<p>Tell Windows to treat the RTC hardware clock as UTC:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">reg add </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v RealTimeIsUniversal </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">t REG_DWORD </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">f</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3>Option 2: Disable VMICTimeProvider</h3>
<p>EC2 instances do not need the Hyper-V time sync provider; disable it to avoid interference:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">reg add </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\VMICTimeProvider"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v Enabled </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">t REG_DWORD </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">f</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> w32time</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h3>Option 3: Use Amazon Time Sync Service</h3>
<p>Switch the NTP source to the EC2 link-local time service (169.254.169.123), which has very low latency and does not require internet access:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">w32tm </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">config </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">manualpeerlist:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"169.254.169.123,0x9"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">syncfromflags:manual </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">reliable:no </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">update</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> w32time</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">w32tm </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">resync </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">force</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Shorten the poll interval:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">reg add </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v SpecialPollInterval </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">t REG_DWORD </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">900</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">f</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> w32time</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h3>Combined recommendation</h3>
<p>All three options are compatible and can be applied together. Apply all, reboot, then verify:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">reg query </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v RealTimeIsUniversal</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">w32tm </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">query </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">status</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">w32tm </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">query </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">peers</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>References</h2>
<ul>
<li><a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/windows-set-time.html" target="_blank" rel="noopener noreferrer">AWS - Set the time for a Windows instance</a></li>
<li><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-time-sync.html" target="_blank" rel="noopener noreferrer">AWS - Amazon Time Sync Service</a></li>
<li><a href="https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings" target="_blank" rel="noopener noreferrer">Microsoft Learn - Windows Time Service registry entries</a></li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>FSx for Windows DNS Alias Access Failure: Missing Kerberos SPN</title>
      <link>https://blog.checo.cc/en/posts/AWS/28.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/28.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">FSx for Windows DNS Alias Access Failure: Missing Kerberos SPN</source>
      <description>Clients cannot reach the FSx file server via a DNS alias. Packet capture confirms the network is reachable. Root cause: the alias is missing a HOST/ Kerberos SPN on the FSx AD computer object.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Clients cannot reach the FSx file server via a DNS alias. Packet capture shows the network path is fully reachable; the failure is in Kerberos — the KDC cannot find the service principal for the alias. The root cause is the alias missing a <code>HOST/</code> SPN registered on the FSx AD computer object.</p>
<!-- more -->
<h2>Background</h2>
<p>Clients cannot access the file server <code>\\fileserver01</code>. Security groups or routing (via a firewall ENI) are initially suspected; network connectivity needs to be confirmed.</p>
<p>Environment (from packet capture):</p>
<ul>
<li>Client: <code>10.0.1.100</code></li>
<li>FSx default DNS name: <code>amznfsxexample.corp.example.com</code> -&gt; <code>10.0.2.10</code></li>
<li>DNS alias (the name clients actually use): <code>fileserver01.corp.example.com</code></li>
<li>Domain controller / KDC: <code>10.0.3.5</code></li>
</ul>
<h2>Investigation</h2>
<p>Packet capture analysis on the client:</p>
<p><strong>DNS resolution works</strong> — the alias is a CNAME ultimately pointing to the FSx:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>fileserver01.corp.example.com  CNAME  amznfsxexample.corp.example.com  A  10.0.2.10</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p><strong>Network layer is fine</strong> — TCP handshakes to FSx 445 (SMB) and to KDC 88 (Kerberos) both succeed, and SMB2 Negotiate returns success:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>10.0.1.100 -> 10.0.2.10:445  SYN/SYN-ACK/ACK normal</span></span>
<span class="line"><span>SMB2 Negotiate Protocol Response   NT Status: STATUS_SUCCESS</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>The real failure is in Kerberos</strong> — the client requests a service ticket for the alias from the KDC, which returns error code 7:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>TGS-REQ  SName: cifs/fileserver01 , cifs/fileserver01.corp.example.com</span></span>
<span class="line"><span>KRB-ERROR  error_code 7  = KDC_ERR_S_PRINCIPAL_UNKNOWN</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Without a ticket, SMB2 Session Setup fails (<code>STATUS_NO_LOGON_SERVERS</code>); the client RSTs and retries repeatedly.</p>
<h2>Root Cause</h2>
<p><code>fileserver01</code> is a DNS alias configured for the FSx file system. When a client accesses a share via the alias, it requests a <code>cifs/fileserver01</code> service ticket from the KDC. However, the corresponding <code>HOST/</code> SPN was never registered on the FSx file system's AD computer object, so the KDC cannot find this service principal.</p>
<p>So this is not a security group, route table, or firewall ENI issue — the network is reachable. A quick way to verify: accessing the FSx via its default DNS name <code>amznfsxexample.corp.example.com</code> usually works; if the default name works but the alias does not, it is almost certainly an SPN problem.</p>
<p>When Kerberos is enabled, each DNS alias requires two SPNs:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>HOST/fileserver01</span></span>
<span class="line"><span>HOST/fileserver01.corp.example.com</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h2>Resolution</h2>
<p>Run on a Windows instance joined to the same AD domain, as administrator. This modifies AD computer object SPNs; perform within a change window.</p>
<h3>1. Install the AD PowerShell module</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Install-WindowsFeature</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> RSAT</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">AD</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">PowerShell</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3>2. Check whether the alias SPN is already taken</h3>
<p>SPNs must be unique in the domain. Before adding, confirm the alias <code>HOST/</code> SPN is not already registered on another computer object (e.g., the old file server before migration):</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$ALIAS</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "fileserver01.corp.example.com"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">SetSPN </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Q (</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"HOST/"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> +</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $ALIAS</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">SetSPN </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Q (</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"HOST/"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> +</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $ALIAS.Split</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"."</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">])</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If already present, remove it from the old object first.</p>
<h3>3. Set the alias SPN on the FSx computer object</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FSxDnsName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "amznfsxexample.corp.example.com"</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$Alias</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "fileserver01.corp.example.com"</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FileSystemHost</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Resolve-DnsName</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $FSxDnsName</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">Where</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Type </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-eq</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'A'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">].Name.Split(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"."</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FSxAdComputer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-AdComputer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Identity </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FileSystemHost</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-AdComputer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Identity </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FSxAdComputer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Add </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">@</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"msDS-AdditionalDnsHostname"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$Alias</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$Alias.Split</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"."</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">])}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>4. Verify the SPN</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FileSystemDnsName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "amznfsxexample.corp.example.com"</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FileSystemHost</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Resolve-DnsName</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> ${FileSystemDnsName}</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">Where</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Type </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-eq</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'A'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">].Name.Split(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"."</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$FSxAdComputer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-AdComputer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Identity </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">${FileSystemHost}</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">SetSpn </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">L </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">${FSxAdComputer}.Name</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Confirm the output contains <code>HOST/fileserver01</code> and <code>HOST/fileserver01.corp.example.com</code>.</p>
<h3>5. Purge client tickets and retry</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">klist purge</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Re-access <code>\\fileserver01</code> and confirm the share opens normally.</p>
<h2>Summary</h2>
<p>This issue had nothing to do with security groups, route tables, or the firewall ENI — the network path was fully reachable. The root cause was the DNS alias missing a <code>HOST/</code> SPN on the FSx AD computer object, causing the KDC to return <code>KDC_ERR_S_PRINCIPAL_UNKNOWN</code> and SMB authentication to fail. Adding the two SPNs restores access.</p>
<p>Make &quot;configure SPN&quot; a standard onboarding step whenever associating a new DNS alias with an FSx file system.</p>
<h2>References</h2>
<ul>
<li><a href="https://docs.amazonaws.cn/fsx/latest/WindowsGuide/dns-aliases.html" target="_blank" rel="noopener noreferrer">Accessing data using DNS aliases (FSx for Windows)</a></li>
<li><a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/step2-configure-spn-kerberos.html" target="_blank" rel="noopener noreferrer">Configure SPNs for Kerberos</a></li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>VM Import License Type and License Manager BYOL Conversion</title>
      <link>https://blog.checo.cc/en/posts/AWS/29.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/29.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">VM Import License Type and License Manager BYOL Conversion</source>
      <description>A Windows instance imported via VM Import/Export without --license-type BYOL defaults to Amazon licensing (extra fees). Convert to BYOL afterwards via License Manager.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A Windows instance imported via VM Import/Export without specifying <code>--license-type BYOL</code> defaults to Amazon-provided Windows licensing (incurring extra license fees). Can it be converted to BYOL afterwards? Yes, via License Manager.</p>
<!-- more -->
<h2>Core Concepts</h2>
<h3>Conversion Eligibility</h3>
<p>| Instance Source | Can Convert to BYOL |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows 11 ARM x86/x64 Emulation Layer Internals</title>
      <link>https://blog.checo.cc/en/posts/AWS/30.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/30.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows 11 ARM x86/x64 Emulation Layer Internals</source>
      <description>How Windows 11 on Arm runs x64 programs: Microsoft uses Prism dynamic binary translation (DBT) to JIT-compile x86/x64 instructions into ARM64 in user mode. Deep dive into JIT, caching, and limitations.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>How does Windows 11 on Arm run x64 programs? Microsoft uses dynamic binary translation (DBT) to JIT-compile x86/x64 instructions into ARM64 instructions in user mode. This article dives into the Prism emulator's components, JIT flow, caching, and limitations.</p>
<!-- more -->
<h2>Emulator Components</h2>
<p>Windows 11 ARM ships with multiple emulators (all running in user mode):</p>
<p>| Component | Location | Function |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows Server 2025 Duplicate SID Causes SMB Authentication Failure</title>
      <link>https://blog.checo.cc/en/posts/AWS/31.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/31.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Server 2025 Duplicate SID Causes SMB Authentication Failure</source>
      <description>After Windows Server 2025 installs a cumulative update, SMB access between AMI-cloned instances fails with incorrect password. Root cause: Machine ID validation detecting duplicate SIDs. Fix with Sysprep.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After Windows Server 2025 installs a cumulative update, SMB access between AMI-cloned instances fails authentication with an &quot;incorrect password&quot; error, even though the password is correct. The root cause is the Machine ID validation mechanism detecting duplicate SIDs.</p>
<!-- more -->
<h2>Symptom</h2>
<p>After Windows Server 2025 installs the latest cumulative update, SMB access between instances cloned from the same AMI fails authentication with an &quot;incorrect password&quot; error, even though the password is correct.</p>
<p>The system log records Event ID 6167 (LsaSrv):</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>There is a partial mismatch in the machine ID. This indicates that the ticket</span></span>
<span class="line"><span>issued by user S-1-5-21-xxx has either been manipulated or it belongs to a</span></span>
<span class="line"><span>different boot session. Failing authentication.</span></span>
<span class="line"><span></span></span>
<span class="line"><span>NOTE: This can also happen if the machine was cloned without using sysprep.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Prerequisites</h2>
<ul>
<li>Windows Server 2025 with the latest cumulative update installed</li>
<li>Instance created via AMI clone without running Sysprep</li>
</ul>
<h2>Confirmation</h2>
<p>Run on both machines:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$sid</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">New-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> System.Security.Principal.NTAccount(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Administrator'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)).Translate([</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">System.Security.Principal.SecurityIdentifier</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]).Value</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$machineSid</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $sid.Substring</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$sid.LastIndexOf</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'-'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">))</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Write-Output</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Machine SID: </span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">machineSid</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If the Machine SID is identical on both, the problem is confirmed.</p>
<h2>Temporary Workaround</h2>
<p>Disable SID uniqueness check via the registry (Known Issue Rollback mechanism). Both SMB server and client need it:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">New-Item</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Path </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Force</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-ItemProperty</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Path </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Name </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'1517186191'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Value </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Type DWord</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Computer</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Force</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>Limitation</strong>: Valid until end of 2027; Microsoft will remove this bypass in a future security update.</p>
<h2>Permanent Solutions</h2>
<h3>Option 1: Sysprep to regenerate SID (recommended)</h3>
<p>For N machines with the same SID, keep 1 untouched and run Sysprep on the other N-1:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># In EC2, use EC2Launch v2</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x26; </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"C:\Program Files\Amazon\EC2Launch\EC2Launch.exe"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> sysprep</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Sysprep impact:</p>
<p>| Item | Affected |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Offline Windows Registry Editing from a Linux Rescue Instance (hivex)</title>
      <link>https://blog.checo.cc/en/posts/AWS/32.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/32.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Offline Windows Registry Editing from a Linux Rescue Instance (hivex)</source>
      <description>When an EC2 Windows instance cannot boot or accept RDP, attach its root volume to a Linux rescue instance and use hivex to offline read/write registry hives: fix storage driver BSODs, reset RDP port, disable firewall.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 03 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>When an EC2 Windows instance cannot boot or accept RDP, you can attach its root volume to a Linux rescue instance and use hivex to read/write the registry hive files offline. Common scenarios: enable/disable storage drivers to fix BSODs, reset the RDP port, disable the firewall, or change service startup types.</p>
<!-- more -->
<h2>Prerequisites</h2>
<ul>
<li>An Amazon Linux 2023 rescue instance in the same AZ as the target EBS volume</li>
<li>The target Windows instance is stopped</li>
<li>The target root volume is detached from the original instance and attached to the rescue instance</li>
</ul>
<h2>1. Mount the target volume</h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># AL2023 kernel ships with the ntfs3 driver</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> modprobe</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ntfs3</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Identify the device (use the SERIAL field)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> lsblk</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> NAME,SIZE,SERIAL,MOUNTPOINT,FSTYPE</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Mount</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mkdir</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -p</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/win</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mount</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -t</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ntfs3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> rw</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/nvme1n1p1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/win</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Registry hive files are at <code>/mnt/win/Windows/System32/config/</code>:</p>
<p>| File | Registry hive | Typical use |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Cloudflare Cache Rules Configuration and Hit Verification</title>
      <link>https://blog.checo.cc/en/posts/DevOps/3.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Cloudflare Cache Rules Configuration and Hit Verification</source>
      <description>The blog is proxied through Cloudflare to a GitHub Pages origin. Configure a Cache Rule to cache build artifacts, images, icons, and fonts at the edge to speed up delivery and reduce origin fetches.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Fri, 05 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>The blog domain is proxied through Cloudflare with GitHub Pages as the origin. To improve static asset delivery and reduce redundant origin fetches, a Cache Rule was configured in the Cloudflare Dashboard to cache build artifacts, images, icons, and fonts at the edge.</p>
<!-- more -->
<h2>Configuration Location</h2>
<p>Cloudflare Dashboard path:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Domain -> Caching -> Cache Rules</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2>Design Strategy</h2>
<p>The goal is <strong>not</strong> to cache the entire site HTML. Instead, prioritize caching long-lived static resources like CSS, JS, images, and favicon. VuePress build assets typically include content hashes, making them ideal for long Edge TTLs. HTML pages are left uncached to avoid stale content after updates.</p>
<h2>Final Rule</h2>
<p>Match expression:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>(http.host eq "blog.example.com" and</span></span>
<span class="line"><span> (starts_with(http.request.uri.path, "/assets/") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".css") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".js") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".mjs") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".png") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".jpg") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".jpeg") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".gif") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".webp") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".svg") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".ico") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".woff") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".woff2") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".ttf") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".otf")))</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Rule action:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Eligible for cache</span></span>
<span class="line"><span>Edge TTL: Ignore cache-control header and use this TTL</span></span>
<span class="line"><span>TTL: 1 month</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Browser TTL is not overridden separately to avoid prolonged browser caching that could complicate debugging after updates.</p>
<h2>Issue: <code>matches</code> Regex Not Available</h2>
<p>Initially used a regex expression:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>http.request.uri.path matches "^/(assets/|.*\\.(css|js|mjs|png|jpg|jpeg|gif|webp|svg|ico|woff2?|ttf|otf)$)"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Deployment failed with:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>not entitled: the use of operator Matches is not allowed,</span></span>
<span class="line"><span>a Business plan or a WAF Advanced plan is required</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>The Cloudflare Free plan doesn't support the <code>matches</code> regex operator. The fix was to decompose the regex into a combination of <code>starts_with</code> and <code>ends_with</code> functions, which are available on all plans.</p>
<h2>Verification</h2>
<p>Check cache hit via response headers:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -I</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://blog.example.com/favicon.ico</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>First request:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>cf-cache-status: REVALIDATED</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Second request:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>cf-cache-status: HIT</span></span>
<span class="line"><span>age: 9</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p><code>HIT</code> means the request was served from a Cloudflare edge cache. <code>age</code> is the number of seconds the cached object has lived on the edge node.</p>
<h2>Monitoring Cache Hit Rate</h2>
<p>View overall metrics in the Cloudflare Dashboard:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Domain -> Caching -> Overview</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Key metrics:</p>
<ul>
<li>Cache Analytics</li>
<li>Cache hit ratio</li>
<li>Requests by cache status</li>
<li>Bandwidth saved</li>
</ul>
<p>Filter by hostname for blog-specific traffic:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Domain -> Analytics -> HTTP Traffic -> Filter by hostname</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2>Future Considerations</h2>
<p>The current rule can be kept long-term. If HTML caching is desired later, consider:</p>
<ul>
<li>Refresh delay after homepage/article updates</li>
<li>Automatic Cloudflare Cache Purge after GitHub Actions deployment</li>
<li>Shorter TTL for <code>text/html</code> responses</li>
<li>Priority ordering between Cache Rules and Page Rules</li>
</ul>
<p>For now, static-only caching is the safer approach.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating VuePress Blog to Cloudflare Pages with Blue-Green Deployment</title>
      <link>https://blog.checo.cc/en/posts/DevOps/4.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Migrating VuePress Blog to Cloudflare Pages with Blue-Green Deployment</source>
      <description>Migrate the blog from GitHub Pages to Cloudflare Pages using a blue-green deployment strategy. Eliminate the middle layer for faster edge delivery, with CI/CD config and zero-downtime DNS switch.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Tue, 23 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>The blog was originally hosted on GitHub Pages, accessed through Cloudflare CDN. This migration moves build output directly to Cloudflare Pages, eliminating the GitHub Pages middle layer for faster edge delivery and better cache control. A blue-green deployment strategy ensures zero-downtime migration.</p>
<!-- more -->
<h2>Project Info</h2>
<p>| Item | Value |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Three VuePress slimsearch Search Box Fixes</title>
      <link>https://blog.checo.cc/en/posts/DevOps/5.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Three VuePress slimsearch Search Box Fixes</source>
      <description>Switch the blog search from default search to the slimsearch plugin, trim the number of search results, and fix accidental Enter-key navigation with a Pinyin IME. Root cause, fix, and verification for each.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>This round I did three things to the blog search box: switched from the default <code>search: true</code> to the slimsearch plugin, reined in the number of search results, and fixed an accidental navigation on Enter with a Pinyin IME. Below is each issue, its root cause, the fix, and the pitfalls I hit.</p>
<!-- more -->
<p>The stack is VuePress 2 rc.30 + vuepress-theme-hope rc.107 + <code>@vuepress/plugin-slimsearch@2.0.0-rc.130</code> + slimsearch 2.3.0, bilingual (zh-CN at <code>/</code>, en-US at <code>/en/</code>).</p>
<h2>1. customFields formatter crash (split is not a function)</h2>
<h3>Symptom</h3>
<p>After enabling slimsearch with <code>customFields</code> (categories/tags), searching threw this in the console:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>n[f.value].split is not a function</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>No results came back at all.</p>
<h3>Root cause</h3>
<p><code>@vuepress/plugin-slimsearch</code> merges the <code>customFields</code> <code>formatter</code> with the default locale on the node side via <code>getFullLocaleConfig</code> / <code>deepAssign</code>. When you write it as an object:</p>
<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">formatter</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  "/"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  "/en/"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>deepAssign</code> treats this <strong>string</strong> as an enumerable object and iterates it, so each character index becomes a key and the value becomes a single character. <code>&quot;Category: $content&quot;</code> ends up mangled into <code>{0:&quot;C&quot;, 1:&quot;a&quot;, ...}</code>. The client then calls <code>.split(&quot;$content&quot;)</code> on it and throws <code>split is not a function</code>.</p>
<p>This is not a config mistake; it's a bug in how the plugin + <code>@vuepress/helper</code> locale merge handles <strong>string values</strong>.</p>
<h3>Fix</h3>
<p>In <code>theme.ts</code>, replace <code>search: true</code> with an explicit slimsearch config and write the formatter as an <strong>explicit string</strong> object (to bypass the mangled merge path):</p>
<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">slimsearch</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">  indexContent</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">true</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">// changed to false later, see section 3</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">  customFields</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: [</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">      getter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">=></span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B"> page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">frontmatter</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E06C75">category</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      formatter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/en/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">      },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">      getter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">=></span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B"> page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">frontmatter</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E06C75">tag</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      formatter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Tag: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/en/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Tag: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">      },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  ],</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The formatter is a <code>Record&lt;string,string&gt;</code> (locale -&gt; string); <code>$content</code> is replaced with the getter's return value. The client <code>SearchResult</code> component picks the string for the current routeLocale, then <code>split(&quot;$content&quot;)</code> to stitch the prefix and suffix.</p>
<h3>Verification</h3>
<p>Searching <code>certificate</code> / <code>DevOps</code> on the English site works, the customField shows &quot;Tag: ...&quot; / &quot;Category: ...&quot;, no console error.</p>
<h2>2. Too many search results</h2>
<h3>Symptom</h3>
<p>A single query returned a flood: <code>the</code> -&gt; 31 pages / 438 lines, <code>certificate</code> -&gt; 3 pages / 35 lines.</p>
<h3>Root cause</h3>
<p><code>indexContent: true</code> indexes the <strong>entire body</strong>. The slimsearch <code>SearchResult</code> component lists <strong>all matching paragraphs</strong> for each hit page, and the render loop <code>n.map(...)</code> in the source has no cap. So every paragraph containing the word gets rendered.</p>
<p>theme-hope passes through <code>SlimSearchPluginOptions</code> directly and <strong>does not expose</strong> <code>combineWith</code> / per-page hit cap / prefix / fuzzy, the native slimsearch options (<code>SlimSearchPluginOptions</code> only has <code>indexContent</code>/<code>sortStrategy</code>/<code>indexOptions</code>(tokenize/processTerm)/<code>customFields</code>/<code>filter</code>, etc.). There's no middle ground of &quot;searchable body but few results&quot;.</p>
<h3>Fix</h3>
<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">slimsearch</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">  indexContent</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">false</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">// only index title, headings, excerpt, categories/tags</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">  ...</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>Measured comparison (English /en/)</h3>
<p>| Query | <code>indexContent:true</code> | <code>indexContent:false</code> |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating Yuque Notes to Local Markdown</title>
      <link>https://blog.checo.cc/en/posts/DevOps/6.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/6.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Migrating Yuque Notes to Local Markdown</source>
      <description>Use yuque-dl to bulk-export hundreds of Yuque documents with images to local Markdown, integrate with an Obsidian knowledge base, and contribute a batch-download-all feature back via a PR.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Thu, 25 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>For data safety, offline access, and integration with a local knowledge base, I needed to bulk-export Yuque notes to local Markdown. I ended up using <code>yuque-dl</code> to pull hundreds of documents plus images in one pass, and along the way contributed a &quot;download all knowledge bases at once&quot; feature back to the tool via a PR.</p>
<!-- more -->
<h2>Background</h2>
<p>Yuque is Alibaba's online knowledge-management tool, with notes stored in the cloud. My Yuque workspace held 27 private knowledge bases and 360+ documents, all of which needed to be exported as local Markdown.</p>
<h2>Comparing options</h2>
<p>| Option | Tool | Best for | Pros | Cons |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting iStoreOS IPv6 in NDP Relay Mode</title>
      <link>https://blog.checo.cc/en/posts/DevOps/7.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/7.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Troubleshooting iStoreOS IPv6 in NDP Relay Mode</source>
      <description>A Mac has an IPv6 address but cannot ping public IPv6. Layer-by-layer investigation traces it to iStoreOS&amp;apos;s unstable NDP Relay mode. Flipping one OpenWrt config line from relay to server fixes it.</description>
      <category>DevOps</category>
      <category>Networking</category>
      <pubDate>Sun, 28 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<figure><img src="/assets/images/posts/istoreos-ipv6-topology-gpt-image-2.png" alt="IPv6 NDP Relay troubleshooting and server-mode fix topology" tabindex="0" loading="lazy"><figcaption>IPv6 NDP Relay troubleshooting and server-mode fix topology</figcaption></figure>
<p>The Mac had an IPv6 address but couldn't ping any public IPv6 address. It had always worked, then one day it just stopped, and rebooting the router didn't help. It turned out to be iStoreOS's unstable NDP Relay mode — flipping one line of config from relay to server fixed it. This post walks through the full layer-by-layer investigation down to the root cause.</p>
<!-- more -->
<h2>Environment</h2>
<p>| Item | Value |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/posts/istoreos-ipv6-topology-gpt-image-2.png" type="image/png"/>
    </item>
    <item>
      <title>RustDesk Remote Connection Failure — Disabling UDP Investigation and Fix</title>
      <link>https://blog.checo.cc/en/posts/Mac/3.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">RustDesk Remote Connection Failure — Disabling UDP Investigation and Fix</source>
      <description>RustDesk remote desktop server on a Mac mini fails or times out while the process runs normally. As the only remote access method, this means total loss of access. Full troubleshooting from port to config.</description>
      <category>macOS</category>
      <category>DevOps</category>
      <pubDate>Fri, 19 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A Mac mini runs RustDesk as a remote desktop server with a self-hosted ID/relay server. When connecting remotely from outside, the connection failed or timed out, while the RustDesk process was running locally. Since RustDesk was the only remote access method (no SSH, no other remote desktop), this was equivalent to a complete loss of remote access — a high-priority incident.</p>
<!-- more -->
<h2>Investigation</h2>
<h3>1. Confirm RustDesk Process Status</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">pgrep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -x</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> RustDesk</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Outputs PID — RustDesk is running</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Process is healthy, ruling out crashes or startup failures.</p>
<h3>2. Locate Configuration Files</h3>
<p>RustDesk config directory on macOS:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>~/Library/Preferences/com.carriez.RustDesk/</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Key files:</p>
<p>| File | Purpose |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>macOS SMB Auto-Reconnect: Never Lose Shared Mounts After Sleep/Network Drop</title>
      <link>https://blog.checo.cc/en/posts/Mac/4.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">macOS SMB Auto-Reconnect: Never Lose Shared Mounts After Sleep/Network Drop</source>
      <description>SMB-mounted Windows PC drives and NAS on a Mac mini silently drop after sleep/reboot/disconnect and never auto-recover. Implement auto-reconnect via LaunchAgent and a reconnect script, no manual remounting needed.</description>
      <category>macOS</category>
      <category>Automation</category>
      <pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A Mac mini mounts Windows PC drives (C/D/E) and a NAS via SMB. The core pain point: after macOS sleep, reboot, or network disconnection, SMB mounts drop silently and never auto-recover — requiring manual Finder reconnection every time. This article documents a complete auto-reconnect solution.</p>
<!-- more -->
<h2>Why the Old Approach Failed</h2>
<p>Two separate LaunchAgents existed, each managing different mounts, with these problems:</p>
<ol>
<li><strong>RunAtLoad only fires once</strong> — doesn't re-trigger after sleep wake</li>
<li><strong>No network state detection</strong> — can't sense network recovery</li>
<li><strong>No retry mechanism</strong> — runs before network is ready, fails silently</li>
</ol>
<h2>New Architecture</h2>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>┌─────────────────────────────────────────────────┐</span></span>
<span class="line"><span>│  com.checo.smb-auto (LaunchAgent)               │</span></span>
<span class="line"><span>│  KeepAlive=true → auto-restart on crash         │</span></span>
<span class="line"><span>│  RunAtLoad=true → start on login                │</span></span>
<span class="line"><span>└──────────────┬──────────────────────────────────┘</span></span>
<span class="line"><span>               │</span></span>
<span class="line"><span>    ┌──────────▼──────────┐</span></span>
<span class="line"><span>    │  smb-watcher.sh     │  Background daemon</span></span>
<span class="line"><span>    │  (always running)   │</span></span>
<span class="line"><span>    │                     │</span></span>
<span class="line"><span>    │  Gateway Ping       │  Check every 2 min</span></span>
<span class="line"><span>    │  offline→online     │  Trigger --force remount</span></span>
<span class="line"><span>    │                     │</span></span>
<span class="line"><span>    │  Mount Integrity    │  Missing→auto-remount</span></span>
<span class="line"><span>    └──────────┬──────────┘</span></span>
<span class="line"><span>               │ calls</span></span>
<span class="line"><span>    ┌──────────▼──────────┐</span></span>
<span class="line"><span>    │  smb-mount.sh       │  Unified mount script</span></span>
<span class="line"><span>    │  (supports --force) │</span></span>
<span class="line"><span>    └─────────────────────┘</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Implementation Details</h2>
<h3>1. Unified Mount Script <code>~/bin/smb-mount.sh</code></h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">#!/bin/bash</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Unified SMB auto-mount script</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Usage: smb-mount.sh [--force]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">FORCE</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">0</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[[ </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">$1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> ==</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "--force"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ]] &#x26;&#x26; </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">FORCE</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">1</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Share definition table: IP|user|password|share|display_name</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">SHARES</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|administrator|PASSWORD|C|Win-C"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|administrator|PASSWORD|D|Win-D"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|administrator|PASSWORD|E|Win-E"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|NAS_USER|NAS_PASS|share|NAS"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>Mount detection key function:</strong></p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">is_mounted</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">() {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    local</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> ip</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">$1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> share</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">$2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">    # macOS mount output: //user@IP/share on /Volumes/...</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">    # ⚠️ Must use //.*@IP pattern due to username prefix</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">    mount</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "smbfs"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -q</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "//.*@</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$ip</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$share</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote>
<p><strong>Gotcha:</strong> macOS <code>mount</code> output for SMB includes a username prefix: <code>//administrator@192.168.x.x/C on /Volumes/...</code>. Using <code>//192.168.x.x/C</code> as a pattern will always return false.</p>
</blockquote>
<p><strong>Mount method — osascript (Finder way):</strong></p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">osascript</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -e</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "tell application </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">Finder</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> to mount volume </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">smb://user:pass@IP/share</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><blockquote>
<p><strong>Why not <code>mount -t smbfs</code>?</strong> <code>mount_smbfs</code> requires root. Sudo-mounted volumes belong to root, causing Permission denied for regular users. osascript mounts via Finder with correct permissions.</p>
</blockquote>
<p><strong>Finder mount path naming convention:</strong></p>
<p>| Mount Order | Path |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Planet Coaster Mac Crash Fix: Missing steam_appid.txt</title>
      <link>https://blog.checo.cc/en/posts/Mac/5.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Planet Coaster Mac Crash Fix: Missing steam_appid.txt</source>
      <description>Planet Coaster crashes on launch via Rosetta 2 on Apple Silicon. Root cause is not a compatibility issue but a missing steam_appid.txt causing SteamAPI initialization to fail.</description>
      <category>macOS</category>
      <category>Gaming</category>
      <pubDate>Sun, 14 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Running Planet Coaster on an Apple Silicon Mac via Rosetta 2 crashed on launch. The root cause was not a Rosetta compatibility issue, but a missing <code>steam_appid.txt</code> in the game directory causing SteamAPI initialization to fail.</p>
<!-- more -->
<h2>Crash Symptom</h2>
<p>The game crashed immediately on launch. Crash report:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>Exception Type: EXC_BAD_INSTRUCTION (SIGILL)</span></span>
<span class="line"><span>Code Type: X86-64 (Translated)</span></span>
<span class="line"><span>Triggered by Thread: 8 Main</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The crash occurred during main-thread initialization, with Lua-related strings appearing in registers.</p>
<h2>Environment Check</h2>
<p>| Item | Result |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>About Me</title>
      <link>https://blog.checo.cc/en/intro.html</link>
      <guid>https://blog.checo.cc/en/intro.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">About Me</source>
      <description>Checo&amp;apos;s personal profile, covering an information security background, interests in geography and photography, and a love of Fangdong&amp;apos;s Cat.</description>
      <pubDate>Mon, 15 Jun 2026 12:28:47 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Checo</p>
<ul>
<li>Information Security graduate</li>
<li>Geography enthusiast</li>
<li>Photography lover</li>
<li>Fan of 房东的猫 (Fangdong's Cat)</li>
</ul>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/cover3.jpg" type="image/jpeg"/>
    </item>
    <item>
      <title>Afterword</title>
      <link>https://blog.checo.cc/en/posts/begin.html</link>
      <guid>https://blog.checo.cc/en/posts/begin.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Afterword</source>
      <description>This blog covers two types of content: technical tinkering and troubleshooting records, plus life, photography, and personal interests. Many articles are post-mortems from real-world problem-solving, not standard tutorials.</description>
      <category>Blog</category>
      <pubDate>Mon, 20 May 2024 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>This blog mainly serves two types of content: one is technical tinkering and troubleshooting records, and the other is life, photography, and personal interests. Many articles are not standard tutorials but post-mortems I put together after encountering problems in real environments.</p>
<!-- more -->
<p>For me, blogging isn't about packaging everything neatly — it's about preserving &quot;how I judged the situation at the time, what pitfalls I hit, and how it was ultimately resolved.&quot; Next time I encounter a similar problem, I can take fewer detours; when others find it through search, they can quickly judge whether this approach suits them.</p>
<h2>AI</h2>
<p>The AI category mainly records experiences with large language models and related tools.</p>
<p>Currently planned topics:</p>
<ul>
<li>Local LLM deployment, e.g., LM Studio, Ollama.</li>
<li>Tool chains like DeepSeek, Cherry Studio, SiliconFlow.</li>
<li>API calls, model integration, and some low-cost usage methods.</li>
<li>Practical uses of AI tools in daily work.</li>
</ul>
<p>Articles in this section will be practice-oriented, not just theory. It's only worth recording if it can be run locally, integrated with a client, and solve real problems.</p>
<h2>AWS</h2>
<p>AWS currently has the most content on the blog. This section mainly covers cloud service troubleshooting, EC2 operations, Windows/Linux system issues, S3, ALB, IAM, FSx, SSM, CloudWatch, and similar cases.</p>
<p>These articles typically follow this structure:</p>
<ol>
<li>Problem symptoms</li>
<li>Key logs</li>
<li>Investigation path</li>
<li>Root cause diagnosis</li>
<li>Solution</li>
<li>Follow-up recommendations</li>
</ol>
<p>Many AWS problems look like cloud platform issues, but the root cause may end up being in the operating system, certificate chain, KMS permissions, Windows Update, AD ports, Kerberos tickets, or third-party security software. I write these down as a reminder: troubleshoot in layers, don't attribute the problem to a specific component right from the start.</p>
<h2>DevOps</h2>
<p>The DevOps category covers more general server, container, and service migration records.</p>
<p>For example:</p>
<ul>
<li>1Panel server maintenance</li>
<li>Docker networking and iptables/nftables issues</li>
<li>Migrating new-api from SQLite to MySQL</li>
<li>Blue-green production service switching</li>
<li>Reverse proxy and database connection issues</li>
</ul>
<p>The emphasis in this type of content is reproducibility and rollback capability. Operations in production environments can't just aim for &quot;it works&quot; — you also need to consider backups, verification, traffic switching, and failure rollback.</p>
<h2>VPS</h2>
<p>The VPS category records servers, networking, domains, and common scripts.</p>
<p>Planned additions:</p>
<ul>
<li>Common Linux scripts</li>
<li>VPS benchmarking and network testing</li>
<li>Domain, DNS, and certificate configuration</li>
<li>Nezha Probe, triple-network IPs, proxy and network connectivity</li>
</ul>
<p>This section will be relatively miscellaneous, but all centered around personal server and network asset management.</p>
<h2>macOS</h2>
<p>The macOS category mainly records my own Mac usage, troubleshooting, and hardware inspection.</p>
<p>For example:</p>
<ul>
<li>Hardware inspection after receiving the Mac mini M4</li>
<li>VS Code auto-update failure on external APFS volume</li>
<li>External drives, app migration, system log investigation</li>
</ul>
<p>These articles lean toward personal experience, but many pitfalls are common. Especially on macOS, issues with cross-volume operations, permissions, temporary directories, and app auto-updates are usually not obvious — until something goes wrong, and then they're hard to pinpoint.</p>
<h2>Windows and Security</h2>
<p>The Windows category currently covers WSL, Kali, and Windows environment-related content.</p>
<p>Planned additions:</p>
<ul>
<li>WSL migration and tinkering</li>
<li>Kali tool environment</li>
<li>Windows Server operations experience</li>
<li>Security testing environment setup</li>
</ul>
<p>This differs from the Windows troubleshooting in the AWS category: the AWS category focuses more on cloud cases, while the Windows category is more about local environments and personal use.</p>
<h2>Photography</h2>
<p>Photography is another long-term section.</p>
<p>This section won't focus much on gear specs — it's more about the photos themselves and shooting scenes, like the Southern Anhui Sichuan-Tibet Highway, birds, and football matches. Tech blogs tend to get drier over time; photography keeps this site from being just a problem list and preserves a bit of life.</p>
<h2>Writing Principles</h2>
<p>I'll try to follow several principles for future articles:</p>
<ul>
<li>Don't include sensitive information — accounts, instance IDs, internal IPs, domains, and keys should all be generalized.</li>
<li>Write less vague conclusions, more reasoning behind decisions.</li>
<li>Commands should be directly copyable, but risk warnings must be included.</li>
<li>Explain root causes, not just steps.</li>
<li>Production operations must include backup and rollback reminders.</li>
<li>Unfinished drafts shouldn't be pinned; placeholder content shouldn't be treated as published articles.</li>
</ul>
<h2>Future Plans</h2>
<p>Short-term: clean up existing notes, especially AWS, DevOps, and VPS-related content. Medium-term: further organize the blog's visual design and navigation to make categories clearer and article lists more browsable.</p>
<p>This blog isn't very extensive yet, but it's already developing its own direction: technical problems don't just record &quot;how to do it&quot; but more importantly &quot;why it was done this way.&quot; With long-term accumulation, it will become increasingly valuable.</p>
]]></content:encoded>
      <enclosure url="https://picgo.checo.cc/DSC_0180.jpg" type="image/jpeg"/>
    </item>
    <item>
      <title>Local Deployment of DeepSeek</title>
      <link>https://blog.checo.cc/en/posts/AI/1.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/1.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Local Deployment of DeepSeek</source>
      <description>DeepSeek&amp;apos;s website is often overloaded. This article documents the full process of locally deploying the DeepSeek LLM using LM Studio on Windows 10 with an RTX 3050 Ti, including model download and inference config.</description>
      <category>AI</category>
      <pubDate>Sun, 02 Feb 2025 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<h2>Why Use a Local Large Model</h2>
<ol>
<li>
<p>The DeepSeek official website has been extremely popular recently and often fails to respond<br>
<img src="https://picgo.checo.cc/20250209145239.png" alt="DeepSeek website showing an unresponsive request" loading="lazy"></p>
</li>
<li>
<p>Local deployment offers higher security</p>
</li>
<li>
<p>Local deployment can bypass some official restrictions</p>
</li>
</ol>
<!-- more -->
<h2>Test Environment</h2>
<p><strong>OS</strong>: Windows 10 Pro 22H2<br>
<strong>CPU</strong>: AMD Ryzen 5 5600H (6C12T, Base 3.3GHz / Boost 4.2GHz)<br>
<strong>GPU</strong>: NVIDIA GeForce RTX 3050 Ti Laptop GPU (4GB GDDR6 VRAM)<br>
<strong>RAM</strong>: SAMSUNG 16GB DDR4-3200<br>
<strong>IDE</strong>: LM Studio v0.3.9</p>
<h2>Deployment Method</h2>
<ol start="0">
<li>
<p>It is recommended to use an international network environment and enable TUN mode in your proxy tool</p>
</li>
<li>
<p>Download and install the LM Studio client<br>
<a href="https://lmstudio.ai" target="_blank" rel="noopener noreferrer">Click to go</a></p>
</li>
<li>
<p>Change the model download directory (recommended)<br>
This prevents models from consuming too much space on the C drive<br>
<img src="https://picgo.checo.cc/20250209115213.png" alt="LM Studio model download directory settings" loading="lazy"></p>
</li>
<li>
<p>Download the appropriate model based on your computer configuration<br>
Models with <code>Distill</code> in the name are distilled models<br>
The recommended model is <code>DeepSeek-R1-Distill-Llama-8B-Abliterated-GGUF</code>, which runs smoothly with 4GB of VRAM. This model also removes some of DeepSeek's built-in restrictions, allowing more freedom in local use<br>
<img src="https://picgo.checo.cc/20250209144621.png" alt="LM Studio model search results for a DeepSeek distill model" loading="lazy"></p>
</li>
<li>
<p>Load the model<br>
After the download completes, click the top bar to load the model you just downloaded<br>
It is recommended to increase <code>GPU Offload</code> and enable <code>Fast Attention</code> for better performance<br>
<img src="https://picgo.checo.cc/20250209144950.png" alt="LM Studio loaded model settings with GPU offload and fast attention" loading="lazy"></p>
</li>
<li>
<p>Start using it<br>
<img src="https://picgo.checo.cc/20250209145930.png" alt="LM Studio chat interface running the local DeepSeek model" loading="lazy"></p>
</li>
</ol>
<h2>Advanced Usage</h2>
]]></content:encoded>
      <enclosure url="https://picgo.checo.cc/20250209145239.png" type="image/png"/>
    </item>
    <item>
      <title>Using DeepSeek-R1 via SiliconFlow</title>
      <link>https://blog.checo.cc/en/posts/AI/2.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/2.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Using DeepSeek-R1 via SiliconFlow</source>
      <description>SiliconFlow provides API services for models like DeepSeek-R1. Pair it with the Cherry Studio client. Full guide to account registration, API Key acquisition, and client configuration.</description>
      <category>AI</category>
      <pubDate>Sun, 09 Feb 2025 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>SiliconFlow provides API services for models like DeepSeek-R1, which can be used with clients like Cherry Studio. This article documents the account registration, API Key acquisition, and client configuration process.</p>
<!-- more -->
<h2>Download and Install Cherry Studio</h2>
<p>This section will be supplemented with specific download and installation steps later.</p>
<h2>Register a SiliconFlow Account</h2>
<p><a href="https://cloud.siliconflow.cn/i/YCwowtrD" target="_blank" rel="noopener noreferrer">Click to register</a></p>
<h2>Get an API Key</h2>
]]></content:encoded>
    </item>
    <item>
      <title>Finding Public DeepSeek Services via FOFA</title>
      <link>https://blog.checo.cc/en/posts/AI/3.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Finding Public DeepSeek Services via FOFA</source>
      <description>Use FOFA network space mapping to find publicly exposed DeepSeek / Ollama services on the internet, then filter usable API nodes with connectivity tests. Includes risk boundaries and legality notes.</description>
      <category>AI</category>
      <pubDate>Tue, 11 Feb 2025 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>This article has not been completed yet. If continued in the future, it is recommended to focus on risk boundaries, legality, and read-only verification methods, to avoid writing it as a tutorial for abusing public services.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Training a TinyStories-Style GPT Model from Scratch</title>
      <link>https://blog.checo.cc/en/posts/AI/4.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Training a TinyStories-Style GPT Model from Scratch</source>
      <description>Train a TinyStories-style small GPT model from random initialization on an Apple M4 Mac mini 16GB using MLX. Complete walkthrough of data prep, tokenizer, model architecture, training loop, checkpoint, and inference.</description>
      <category>AI</category>
      <pubDate>Sat, 06 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<figure><img src="/assets/images/posts/llm-from-scratch-hero.png" alt="A minimalist flowchart for training an LLM from scratch" tabindex="0" loading="lazy"><figcaption>A minimalist flowchart for training an LLM from scratch</figcaption></figure>
<p>This project trains a small TinyStories-style GPT model from random initialization on an Apple M4 Mac mini 16GB using MLX. It is not about calling APIs or fine-tuning an existing model, but rather walking through the entire pipeline of data preparation, tokenizer, model architecture, training loop, checkpoint, and inference generation.</p>
<p>This write-up leans more toward an engineering retrospective: the focus is not on training a chat-capable model, but on verifying whether a personal machine can complete an end-to-end small-scale LLM training run.</p>
<p>Project repository: <a href="https://github.com/sergioperezcheco/llm-from-scratch" target="_blank" rel="noopener noreferrer">sergioperezcheco/llm-from-scratch</a></p>
<!-- more -->
<h2>Project Results</h2>
<p>The final trained model is a GPT with 44M parameters:</p>
<p>| Item | Result |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/posts/llm-from-scratch-hero.png" type="image/png"/>
    </item>
    <item>
      <title>Windows Server 2008 CloudWatch Agent Certificate Verification Failure</title>
      <link>https://blog.checo.cc/en/posts/AWS/1.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/1.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Server 2008 CloudWatch Agent Certificate Verification Failure</source>
      <description>CloudWatch Agent on a Windows Server 2008 EC2 instance reports x509: certificate signed by unknown authority. Root cause: outdated root certificates and insufficient TLS support. Fix the certificate chain and restore metric reporting.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 01 May 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<figure><img src="/assets/images/posts/aws-cloudwatch-cert-architecture.svg" alt="CloudWatch Agent certificate chain fix architecture diagram" tabindex="0" loading="lazy"><figcaption>CloudWatch Agent certificate chain fix architecture diagram</figcaption></figure>
<p>On a Windows Server 2008 EC2 instance, the CloudWatch Agent service status was normal, but monitoring metrics could never be reported to CloudWatch. The logs repeatedly showed <code>x509: certificate signed by unknown authority</code>, and the root cause was ultimately traced to outdated system root certificates and insufficient TLS support.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>The CloudWatch Agent logs continuously showed errors like:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>WriteToCloudWatch failure, err: RequestError: send request failed</span></span>
<span class="line"><span>caused by: Post https://monitoring.&#x3C;region>.amazonaws.com.cn/:</span></span>
<span class="line"><span>x509: certificate signed by unknown authority</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Also note two easily misdiagnosed points:</p>
<ul>
<li><code>ping monitoring.&lt;region&gt;.amazonaws.com.cn</code> failing does not necessarily mean the service is unreachable — Interface Endpoints typically do not respond to ICMP.</li>
<li>Opening the CloudWatch API endpoint in a browser and getting <code>404 Not Found</code> is also normal — it is not a regular web service.</li>
</ul>
<h2>Root Cause</h2>
<p>The root certificate store on Windows Server 2008 is too old and may lack the root certificates needed to verify AWS server certificates, such as Amazon Root CA 1. Purely internal instances that cannot access the public internet also cannot automatically pull new trusted root certificates.</p>
<p>Additionally, older versions of Windows Server 2008 may also lack patches that support modern TLS chains. The end result is that the CloudWatch Agent cannot complete certificate chain verification when establishing an HTTPS connection.</p>
<h2>Resolution Steps</h2>
<h3>1. Install SHA-2 / TLS Related Patches</h3>
<p>First, install the required security patches for Windows Server 2008, such as KB4474419. The system must be restarted after patch installation.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">wusa.exe</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> C:\Patches\windows6.</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">kb4474419</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v3</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">x64.msu </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">quiet </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">norestart</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">shutdown </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">r </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">t </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h3>2. Import Amazon Root CA 1</h3>
<p>Download the Amazon Root CA 1 certificate:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>https://www.amazontrust.com/repository/AmazonRootCA1.cer</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>In an internal network environment, you can first download it from a machine with public internet access, then securely copy it to the instance.</p>
<p>Import it into the trusted root certificate store:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">certutil </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">addstore </span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-f</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Root C:\Patches\AmazonRootCA1.cer</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>You can also import it via the <code>certmgr.msc</code> graphical interface into &quot;Trusted Root Certification Authorities.&quot;</p>
<h3>3. Restart the CloudWatch Agent</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">net stop </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Amazon CloudWatch Agent"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">net start </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Amazon CloudWatch Agent"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h2>Verification</h2>
<p>Check the Agent logs to confirm that <code>x509: certificate signed by unknown authority</code> no longer appears.</p>
<p>You can also test TCP 443 connectivity:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">New-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> System.Net.Sockets.TcpClient).Connect(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"monitoring.&#x3C;region>.amazonaws.com.cn"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">443</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If the command completes without errors, TCP layer connectivity is confirmed. Ultimately, verify that metrics are being reported normally in the CloudWatch console.</p>
<h2>Summary</h2>
<p>When running CloudWatch Agent on older Windows Server 2008 systems in a purely internal network environment, the common issue is not VPC Endpoint configuration, but outdated system root certificates and TLS capabilities. The recommended resolution order is:</p>
<ol>
<li>Confirm CloudWatch endpoint TCP 443 is reachable.</li>
<li>Install necessary system patches.</li>
<li>Manually import Amazon Root CA 1.</li>
<li>Restart the CloudWatch Agent and observe the logs.</li>
</ol>
<p>Such legacy systems should be included in a migration plan, as they will continually encounter certificate, TLS, patch, and software compatibility issues over time.</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/posts/aws-cloudwatch-cert-architecture.svg" type="image/svg+xml"/>
    </item>
    <item>
      <title>SSM Patch Manager Windows Patch Scan Failure: Microsoft Update Service 503</title>
      <link>https://blog.checo.cc/en/posts/AWS/10.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/10.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">SSM Patch Manager Windows Patch Scan Failure: Microsoft Update Service 503</source>
      <description>SSM Patch Manager fails scanning Windows Server 2019 patches. WindowsUpdate.log shows Microsoft&amp;apos;s update service returning 503. Root cause is on Microsoft&amp;apos;s side, not AWS. Troubleshooting steps included.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Thu, 04 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>When using Systems Manager Patch Manager to scan Windows Server 2019 patches, if SSM Agent, network, and permissions are all normal, but WindowsUpdate.log shows the Microsoft update service returning 503, the root cause may be on Microsoft's side, not AWS's.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>Executing <code>AWS-RunPatchBaseline</code> scan fails, returning something like:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>The find operation did not complete successfully</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>The HResult may be:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>-2145107934</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Under the same network environment, Windows Server 2016 works normally while Windows Server 2019 fails.</p>
<h2>Troubleshooting Process</h2>
<h3>1. Verify SSM Endpoints</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Test-NetConnection</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ssm.&#x3C;region>.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">amazonaws.com</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Port </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">443</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Test-NetConnection</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ssmmessages.&#x3C;region>.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">amazonaws.com</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Port </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">443</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Test-NetConnection</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ec2messages.&#x3C;region>.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">amazonaws.com</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Port </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">443</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If using China regions or VPC Endpoints, replace with the corresponding domain names.</p>
<h3>2. Verify Windows Update Network</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Test-NetConnection</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> sls.update.microsoft.com</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Port </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">443</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Test-NetConnection</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> download.windowsupdate.com</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Port </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">80</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Also check if WSUS is configured:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-ItemProperty</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ErrorAction SilentlyContinue</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-ItemProperty</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ErrorAction SilentlyContinue</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h3>3. Export Windows Update Log</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-WindowsUpdateLog</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If the log contains:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>The server returned HTTP status code '503'</span></span>
<span class="line"><span>The service is temporarily overloaded</span></span>
<span class="line"><span>*FAILED* [80244022] Web service call</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This means the Windows Update client has connected to the Microsoft service, but the server returned an unavailable status.</p>
<h2>Root Cause</h2>
<p>Windows Server 2019 may be accessing a specific Microsoft update service domain, such as:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>fe3.delivery.mp.microsoft.com</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If that service endpoint is temporarily overloaded, it returns HTTP 503, corresponding to error code:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>0x80244022</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>At the same time, Windows Server 2016 may work fine because it accesses a different set of update service domains that are not affected.</p>
<h2>Workarounds</h2>
<h3>1. Wait for Microsoft Service Recovery</h3>
<p>If you've confirmed that the network, SSM, and WSUS configuration are all normal, and the error is clearly 503, the most straightforward approach is to wait for the service to recover and retry.</p>
<h3>2. Manually Download Patches</h3>
<p>Download the <code>.msu</code> from Microsoft Update Catalog, then install via script or SSM Run Command:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>https://www.catalog.update.microsoft.com/</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3>3. Pre-cache Patches</h3>
<p>Patch Manager itself does not provide a standard &quot;download only, don't install&quot; mode. You can use a custom SSM document to pre-download patches and execute installation during the maintenance window.</p>
<h3>4. Deploy WSUS</h3>
<p>For environments with strict patch window requirements, you can deploy an on-premises WSUS server to pre-sync patches locally, reducing dependency on the public Microsoft update service.</p>
<h2>Summary</h2>
<p>SSM Patch Manager scan failures are not necessarily SSM issues. When troubleshooting, work through the layers:</p>
<ol>
<li>Whether the SSM Agent is online.</li>
<li>Whether AWS endpoints are reachable.</li>
<li>Whether Windows Update endpoints are reachable.</li>
<li>Whether WindowsUpdate.log shows a Microsoft server-side 503.</li>
</ol>
<p>If the logs clearly show <code>0x80244022</code> and HTTP 503, it should generally be treated as a temporary Microsoft update service unavailability — consider retrying, manual patching, pre-caching, or WSUS.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows Server 2016 Keeps Rolling Back After Patch Installation</title>
      <link>https://blog.checo.cc/en/posts/AWS/11.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/11.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Server 2016 Keeps Rolling Back After Patch Installation</source>
      <description>Windows Server 2016 repeatedly rolls back after installing a cumulative update with We couldn&amp;apos;t complete the updates. Root cause: historical user profile corruption causing the per-user registry phase to fail.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Wed, 13 May 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After installing a cumulative update on Windows Server 2016, if the reboot phase displays &quot;We couldn't complete the updates&quot; and repeatedly rolls back, the root cause may not be disk space or component store corruption — it could be historical user profile corruption causing the per-user registry phase to fail.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>The patch installation phase appears successful, but upon reboot:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>We couldn't complete the updates</span></span>
<span class="line"><span>Undoing changes</span></span>
<span class="line"><span>Don't turn off your computer</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>After entering the system, the OS Build has not increased, and reinstalling still results in repeated rollbacks.</p>
<p>WindowsUpdate.log may show:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Post-reboot status ... 0x800f0922</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>CBS.log contains:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>CBS_E_INSTALLERS_FAILED</span></span>
<span class="line"><span>Per-User Registry Installer ... 0x80070002</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>CSI logs may also show historical user <code>NTUSER.DAT</code> unload failures.</p>
<h2>Troubleshooting Approach</h2>
<p>First, rule out common causes:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">sfc </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">scannow</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Cleanup</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Image </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">RestoreHealth</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Also check:</p>
<ul>
<li>Whether SSU is already installed.</li>
<li>Whether the C drive has sufficient space.</li>
<li>Whether failure persists after resetting SoftwareDistribution / catroot2.</li>
</ul>
<p>If all of these are normal, examine the CBS/CSI logs to see if failures are concentrated in the Per-User Registry Installer phase.</p>
<h2>Root Cause</h2>
<p>In this case, the issue was concentrated in historical user profiles. The server had multiple legacy user directories, Unknown Profiles, and even abnormally large user profiles. During the reboot phase, updates need to load or unload user registry hives, and some <code>NTUSER.DAT</code> files cannot be properly unloaded, causing the patch transaction to fail and triggering a rollback.</p>
<h2>Solution</h2>
<h3>1. Back Up First</h3>
<p>Before performing operations in production, create an AMI or snapshot. User profile cleanup carries data risk and should not be done by blindly deleting in production.</p>
<h3>2. Clean Up Unknown Profiles</h3>
<p>Via the GUI:</p>
<ol>
<li>Run <code>sysdm.cpl</code>.</li>
<li>Go to the &quot;Advanced&quot; tab.</li>
<li>Click &quot;Settings&quot; in the &quot;User Profiles&quot; section.</li>
<li>Delete profiles with Unknown status or those confirmed to be no longer in use.</li>
</ol>
<h3>3. Clean Up Registry ProfileList If Necessary</h3>
<p>Carefully open the registry:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Cross-reference the <code>C:\Users</code> directory with SIDs in ProfileList, and clean up invalid entries. Export a registry backup before proceeding.</p>
<h3>4. Reinstall the Patch</h3>
<p>After cleanup, reboot, then reinstall the target cumulative update.</p>
<h3>5. Temporary Workaround</h3>
<p>If profiles cannot be cleaned up immediately and a newer monthly patch has been released, you can test installing the updated cumulative patch directly. Windows cumulative updates typically include the previous month's security content, but this should only be used as a temporary workaround — the underlying issue should still be addressed through cleanup.</p>
<h2>Summary</h2>
<p>When Windows patches roll back during the reboot phase, don't focus solely on Windows Update. If CBS/CSI logs point to the Per-User Registry Installer and user hive unload failures, focus on examining historical user profiles.</p>
<p>Profile accumulation is common on servers that have been accessed by many users over a long period. It is recommended to regularly clean up obsolete profiles to avoid issues surfacing during patch windows.</p>
]]></content:encoded>
    </item>
    <item>
      <title>FSx ONTAP SMB Share Permission Troubleshooting</title>
      <link>https://blog.checo.cc/en/posts/AWS/12.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/12.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">FSx ONTAP SMB Share Permission Troubleshooting</source>
      <description>After adding NTFS permissions to an FSx ONTAP SMB share, users still cannot access it. Troubleshoot the intersection of share and NTFS permissions, plus Kerberos tickets not refreshing group membership.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After adding NTFS security permissions to an FSx ONTAP SMB share, users are still unable to access it. The key to this issue is: the effective Windows SMB permission is the intersection of share permissions and NTFS permissions, and Kerberos tickets do not automatically refresh group membership while the user remains logged in.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>Users receive a permission denied message when accessing the SMB share path. The administrator has already added permissions to the target domain group in the &quot;Security&quot; tab, but access still fails.</p>
<h2>Key Concepts</h2>
<p>SMB share access is controlled by two permission layers simultaneously:</p>
<ul>
<li>Share Permissions</li>
<li>Security Permissions / NTFS Permissions</li>
</ul>
<p>The effective permission is the intersection of both. If only NTFS permissions are configured without share permissions, users may still be denied.</p>
<h2>Troubleshooting Steps</h2>
<h3>1. Check Share Permissions</h3>
<p>Log in to a domain-joined Windows machine with a domain administrator account and open:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>compmgmt.msc</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Connect to the FSx SVM DNS name, then navigate to:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>System Tools -> Shared Folders -> Shares</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Find the target share, open its properties, and check the &quot;Share Permissions&quot; tab. Confirm that the target user or group has at least Read permission.</p>
<h3>2. Check NTFS Permissions</h3>
<p>Then check the &quot;Security&quot; tab to confirm the file system permissions also include the target user or group.</p>
<h3>3. Refresh Kerberos Tickets</h3>
<p>If a user was just added to a domain group, the Kerberos TGT in their current login session may still contain old group membership information.</p>
<p>The most reliable approach is to have the user fully log off and log back in, rather than just locking the screen or disconnecting RDP.</p>
<p>You can also try purging tickets:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">klist purge</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>But in production troubleshooting, a full logoff and logon is more straightforward and reliable.</p>
<h2>Why This Happens</h2>
<p>After a Windows user logs in, they receive a Kerberos ticket containing group membership information. If an administrator modifies group memberships while the user is logged in, the user's existing ticket will not automatically reflect the new group membership. FSx still sees the old identity information, causing the permission check to fail.</p>
<h2>Summary</h2>
<p>When FSx ONTAP SMB share access is denied, investigate in this order:</p>
<ol>
<li>Whether share permissions allow access.</li>
<li>Whether NTFS permissions allow access.</li>
<li>Whether the user has logged off and back in to refresh Kerberos tickets.</li>
</ol>
<p>Only checking the &quot;Security&quot; tab is not enough — this is the most common mistake in SMB permission troubleshooting.</p>
]]></content:encoded>
    </item>
    <item>
      <title>FSx for Windows Creation Fails: TCP 9389 Unreachable to Self-Managed AD</title>
      <link>https://blog.checo.cc/en/posts/AWS/13.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/13.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">FSx for Windows Creation Fails: TCP 9389 Unreachable to Self-Managed AD</source>
      <description>Creating FSx for Windows with a self-managed AD fails with Get-ADComputer: Unable to contact the server. Check TCP 9389 (ADWS) connectivity from the FSx subnet to domain controllers.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Thu, 04 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>When creating FSx for Windows File Server using a self-managed Active Directory, if Single-AZ 2 or Multi-AZ file system creation fails and reports <code>Get-ADComputer: Unable to contact the server</code>, focus on checking TCP 9389 connectivity from the FSx subnet to the domain controllers.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>FSx creation fails, with the following appearing in the console or error message:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>setupFileServerRole failed</span></span>
<span class="line"><span>Get-ADComputer : Unable to contact the server.</span></span>
<span class="line"><span>This may be because this server does not exist, it is currently down,</span></span>
<span class="line"><span>or it does not have the Active Directory Web Services running.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This error typically occurs when FSx is setting up the file server role, joining, or querying AD objects.</p>
<h2>Root Cause</h2>
<p><code>Get-ADComputer</code> depends on Active Directory Web Services, i.e., ADWS. ADWS uses:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>TCP 9389</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>For FSx for Windows Single-AZ 2 and Multi-AZ types, FSx needs to access the domain controller's TCP 9389. If this port is blocked by security groups, NACLs, enterprise firewalls, or cross-region network policies, file system creation will fail.</p>
<h2>Verification Method</h2>
<p>On a domain-joined EC2 Windows instance in the same subnet and same security group as FSx, run the AD validation tool.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Install-WindowsFeature</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> RSAT</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">AD</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">PowerShell</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Invoke-WebRequest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  "https://docs.aws.amazon.com/fsx/latest/WindowsGuide/samples/AmazonFSxADValidation.zip"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">OutFile </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"AmazonFSxADValidation.zip"</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Expand-Archive</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Path </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"AmazonFSxADValidation.zip"</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Import-Module</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> .\AmazonFSxADValidation</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$Credential</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-Credential</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">$Args </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  DomainDNSRoot</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "example.com"</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  DnsIpAddresses</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"DC_IP_1"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"DC_IP_2"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  SubnetIds</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">      =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"subnet-xxxxxxxx"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  Credential</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">     =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $Credential</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$Result</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Test-FSxADConfiguration</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> @Args</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$Result.Failures</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If the output contains a TCP 9389 failure entry, you can confirm it is an ADWS port connectivity issue.</p>
<h2>Why Single-AZ 1 Might Succeed</h2>
<p>Single-AZ 1 has different requirements for TCP 9389 and may succeed in the same environment. This can help determine whether service account permissions, DNS, and basic AD ports are functioning properly.</p>
<p>If Single-AZ 1 succeeds but Single-AZ 2 / Multi-AZ fails, the troubleshooting focus should shift to TCP 9389.</p>
<h2>Solution</h2>
<p>Allow TCP 9389 from the FSx subnet to all domain controllers:</p>
<ul>
<li>FSx security group outbound rules.</li>
<li>Domain controller security group inbound rules.</li>
<li>Network ACL rules in both directions.</li>
<li>Local or cross-region firewall policies.</li>
<li>Intermediate firewalls in enterprise networks.</li>
</ul>
<p>After allowing access, re-run the validation tool to confirm there are no failures, then recreate FSx.</p>
<h2>Summary</h2>
<p>When FSx for Windows fails to join a self-managed AD, don't only check common ports like 389, 445, and 88. For Single-AZ 2 and Multi-AZ, TCP 9389 is equally critical.</p>
<p>When you see <code>Get-ADComputer</code> or ADWS-related errors, prioritize verifying 9389 connectivity from the FSx subnet to all DCs.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Key Points for EC2 SQL Server HA Standby Node License Cost Reduction</title>
      <link>https://blog.checo.cc/en/posts/AWS/14.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/14.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Key Points for EC2 SQL Server HA Standby Node License Cost Reduction</source>
      <description>Amazon EC2 HA for SQL Server reduces license costs for eligible standby nodes. Prerequisites: the standby node cannot carry active workloads or serve as a readable secondary replica.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Wed, 03 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Amazon EC2 High Availability for SQL Server can provide license cost reduction for eligible SQL Server HA standby nodes. However, this cost reduction has strict prerequisites — notably, the standby node cannot carry active workloads or serve as a readable secondary replica for queries.</p>
<!-- more -->
<h2>Prerequisites</h2>
<p>Before enabling SQL Server HA license savings, confirm the environment meets the requirements:</p>
<ul>
<li>Windows Server 2019 or later.</li>
<li>SQL Server 2017 or later.</li>
<li>An HA cluster supports only two EC2 nodes.</li>
<li>Instances need to run SSM Agent.</li>
<li>Instance IAM Role needs EC2 SQL HA and SSM-related permissions.</li>
</ul>
<p>If the environment is still on Windows Server 2016, or the cluster has more than two nodes, the prerequisites for this feature are not met.</p>
<h2>Standby Node Restrictions</h2>
<p>To qualify for license cost reduction, the standby node must remain passive:</p>
<ul>
<li>It does not process incoming business traffic.</li>
<li>It does not run active SQL Server workloads.</li>
<li>It cannot serve as a readable secondary replica to handle read queries.</li>
<li>It should not run standalone databases outside the availability group.</li>
</ul>
<p>The core determination is simple: as long as the node is providing data services, it is no longer a pure standby.</p>
<h2>Readable Secondary Affects Cost Reduction</h2>
<p>When Readable Secondary is enabled in an Always On availability group, the secondary replica can be accessed by applications, reports, or manual queries. Under license logic, this constitutes active use and requires full SQL Server licensing.</p>
<p>Therefore, if the goal is to obtain the standby node license cost reduction, do not enable readable secondary replicas.</p>
<h2>Does Backup Require a Readable Secondary?</h2>
<p>No. SQL Server supports executing certain backup scenarios on non-readable secondary replicas. In other words, for full backups and log backups, there is no need to set the secondary replica as readable.</p>
<p>Before actual configuration, verify against the SQL Server version and availability group backup preferences.</p>
<h2>Enablement Steps Overview</h2>
<h3>1. Confirm SSM Agent Is Online</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ssm</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> describe-instance-information</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>The instance should show <code>PingStatus: Online</code>.</p>
<h3>2. Configure IAM Permissions</h3>
<p>Attach the following to the instance profile:</p>
<ul>
<li><code>AmazonSSMManagedInstanceCore</code></li>
<li><code>AWSEC2SqlHaInstancePolicy</code></li>
</ul>
<h3>3. Prepare SQL Credentials</h3>
<p>By default, <code>NT AUTHORITY\SYSTEM</code> can be used to read SQL Server HA metadata. If the environment restricts this account, place the SQL Server credentials in Secrets Manager and specify them during enablement.</p>
<h3>4. Enable in the EC2 Console</h3>
<p>In the EC2 console, select the HA cluster-related instances and navigate to:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Actions -> Instance settings -> Modify SQL High Availability settings</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Check the prerequisites, and enable license savings after they pass.</p>
<p>After enabling, you should see:</p>
<ul>
<li>Primary node: <code>Active / Full license included</code></li>
<li>Standby node: <code>Standby / Waived</code></li>
</ul>
<h2>Summary</h2>
<p>SQL Server HA standby node license cost reduction is not a simple toggle. What truly matters is that the standby node must remain passive.</p>
<p>If you enable a readable secondary for queries, reports, or application reads, you lose the cost reduction eligibility. For backup scenarios, prioritize using SQL Server's supported secondary replica backup capabilities rather than turning the standby node into a readable workload node.</p>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Windows: Recovering Server Manager After Uninstalling .NET</title>
      <link>https://blog.checo.cc/en/posts/AWS/15.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/15.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Windows: Recovering Server Manager After Uninstalling .NET</source>
      <description>After mistakenly uninstalling .NET Framework 4 Features on Windows Server, Server Manager and Install-WindowsFeature break. Recover the dependency offline using DISM.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Wed, 03 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Do not treat &quot;.NET Framework 4 Features&quot; as a regular application and uninstall it on Windows Server. It is a dependency for many management components, including Server Manager, PowerShell modules, and IIS/WCF-related features. Disabling it by mistake can cause both Server Manager and <code>Install-WindowsFeature</code> to stop working.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>After unchecking <code>.NET Framework 4</code> in Server Manager's &quot;Remove Roles and Features&quot; and rebooting the instance:</p>
<ul>
<li>Server Manager won't open.</li>
<li>PowerShell reports the <code>ServerManager</code> command is not recognized.</li>
<li><code>Install-WindowsFeature</code> reports the feature name doesn't exist.</li>
<li>Some PowerShell management capabilities stop working.</li>
</ul>
<p>Example error:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>ServerManager : The term 'ServerManager' is not recognized</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2>Root Cause</h2>
<p>Windows Server's Server Manager and related PowerShell modules depend on <code>NetFx4-OC-Package</code>. Unchecking <code>.NET Framework 4 Features</code> in the GUI actually disables a batch of OC packages that depend on NetFx4.</p>
<p>This is not the same as the <code>.NET Framework 4.8</code> runtime version. The registry may still show .NET 4.8 is present, but the Windows optional component <code>NetFx4</code> has been disabled.</p>
<p>Additionally, <code>NetFx3</code> cannot substitute for <code>NetFx4</code>. Running:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:NetFx3 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>will not restore Server Manager, which depends on .NET 4.</p>
<h2>Recovery Steps</h2>
<p>Before proceeding, it is recommended to create an AMI backup. All commands should be run as administrator.</p>
<h3>1. Enable NetFx4</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:NetFx4 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3>2. Enable Server Manager GUI Management Components</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:Server</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Gui</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Mgmt </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3>3. Reboot the Instance</h3>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">shutdown </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">r </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">t </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Verify after rebooting.</p>
<h3>4. Restore Other Dependent Components as Needed</h3>
<p>If your workload uses IIS, WCF, PowerShell ISE, or DSC, enable them as needed:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:NetFx4Extended</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ASPNET45 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:WCF</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">HTTP</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Activation45 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:WCF</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TCP</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">PortSharing45 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:IIS</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ASPNET45 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:IIS</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">NetFxExtensibility45 </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:MicrosoftWindowsPowerShellISE </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Enable-Feature</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FeatureName:DSC</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Service </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">All</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Verification</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ServerManager</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-Command</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Install-WindowsFeature</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">DISM </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Online </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-Features</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | findstr </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">I </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"NetFx4 Server-Gui PowerShell"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Summary</h2>
<p>To meet .NET version compliance requirements, the correct approach is to install .NET cumulative updates, not to disable <code>.NET Framework 4 Features</code>. The latter does not make .NET &quot;safely disappear&quot; from the system — instead, it breaks the Windows Server management toolchain.</p>
<p>During recovery, enabling <code>NetFx4</code> alone is not enough — you must also enable <code>Server-Gui-Mgmt</code> and reboot.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Key Considerations for Deploying BitLocker on EC2 Windows Instances</title>
      <link>https://blog.checo.cc/en/posts/AWS/16.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/16.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Key Considerations for Deploying BitLocker on EC2 Windows Instances</source>
      <description>EC2 Windows has no traditional TPM. After enabling BitLocker on the system drive, a password is needed at boot. Use EC2 Serial Console and BitLocker Recovery for key injection and startup.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Sat, 28 Mar 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Enabling BitLocker system drive encryption on EC2 Windows instances is feasible, but the risks are higher than on physical machines. The key issue is that EC2 typically lacks a traditional TPM, so after encrypting the system drive, a password is required during the boot phase, and the standard console may not provide a reliable input channel.</p>
<!-- more -->
<h2>Risk Points</h2>
<p>If you enable BitLocker directly on the C drive and reboot, you may encounter:</p>
<ul>
<li>The instance status shows running, but RDP cannot connect.</li>
<li>The boot phase is waiting for a BitLocker password or recovery key.</li>
<li>The console shows a black screen or cannot accept input.</li>
<li>The workload is unavailable for an extended period, and recovery is only possible through snapshot/AMI rollback.</li>
</ul>
<p>Therefore, you must first verify that the EC2 serial console is available.</p>
<h2>Pre-Operation Preparation</h2>
<ul>
<li>Create an AMI or EBS snapshot.</li>
<li>Perform a complete rehearsal on a test instance.</li>
<li>Record and securely store the recovery key offline.</li>
<li>Confirm acceptance of a reboot and brief downtime window.</li>
</ul>
<h2>Enable Serial Console SAC</h2>
<p>Run the following in an administrator PowerShell session:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdedit </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ems </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'{current}'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> on</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdedit </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">emssettings EMSPORT:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> EMSBAUDRATE:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">115200</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdedit </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">set </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'{bootmgr}'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> displaybootmenu yes</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdedit </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">set </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'{bootmgr}'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> timeout </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">15</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdedit </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">set </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'{bootmgr}'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> bootems yes</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">shutdown </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">r </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">t </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>After rebooting, confirm through the EC2 console via &quot;Connect -&gt; EC2 Serial Console&quot; that you can access the boot interface. If the serial console is not available, do not proceed with encrypting the system drive.</p>
<h2>Install BitLocker Feature</h2>
<p>Add BitLocker via Server Manager, or use PowerShell:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Install-WindowsFeature</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> BitLocker </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">IncludeAllSubFeature </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">IncludeManagementTools</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Computer</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><h2>Configure Boot Without TPM</h2>
<p>Run <code>gpedit.msc</code> and navigate to:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Computer Configuration -> Administrative Templates -> Windows Components -> BitLocker Drive Encryption -> Operating System Drives</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Enable &quot;Require additional authentication at startup&quot; and check &quot;Allow BitLocker without a compatible TPM&quot;.</p>
<h2>Encrypt Data Drives</h2>
<p>For data drives, test first:</p>
<ol>
<li>Right-click the data drive and enable BitLocker.</li>
<li>Choose password unlock.</li>
<li>Save the recovery key.</li>
<li>Configure auto-unlock after encryption completes.</li>
</ol>
<p>Without auto-unlock, the workload may become unavailable after every reboot because the data drive is locked.</p>
<h2>Encrypt the System Drive</h2>
<p>Enable BitLocker on the C drive, choose password unlock, save the recovery key, and run the BitLocker system check.</p>
<p>After rebooting:</p>
<ol>
<li>RDP is temporarily unavailable.</li>
<li>Connect to the EC2 serial console.</li>
<li>At the black screen, enter the BitLocker password and press Enter.</li>
<li>Windows unlocks and continues booting.</li>
<li>Restore RDP after the system finishes booting.</li>
</ol>
<h2>Summary</h2>
<p>The key to using BitLocker on EC2 Windows is not clicking &quot;Enable Encryption&quot; — it's whether you can unlock during the boot phase.</p>
<p>You must:</p>
<ul>
<li>Create an AMI/snapshot before encrypting.</li>
<li>Enable and verify the EC2 serial console first.</li>
<li>Save the recovery key.</li>
<li>Configure auto-unlock for data drives.</li>
<li>Rehearse the complete reboot process in a test environment first.</li>
</ul>
<p>If you only need static EBS encryption in the cloud, prioritize using EBS encryption. BitLocker is more suitable for BYOL or specific compliance scenarios.</p>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Windows Unable to RDP: Winlogon Failure Due to Memory Exhaustion</title>
      <link>https://blog.checo.cc/en/posts/AWS/17.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/17.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Windows Unable to RDP: Winlogon Failure Due to Memory Exhaustion</source>
      <description>An EC2 Windows instance passes status checks and responds to ping but RDP fails. Windows internal Winlogon memory exhaustion causes a crash. Stop &amp; Start restores it. Memory troubleshooting included.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Sat, 25 Apr 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>When an EC2 Windows instance passes status checks, responds to ping, but RDP connections fail, and Stop &amp; Start resolves the issue — don't only look at the network. Windows internal resource exhaustion can also cause critical processes like Winlogon to crash.</p>
<!-- more -->
<h2>Symptoms</h2>
<ul>
<li>Instance is in running state.</li>
<li>System status checks and instance status checks pass.</li>
<li>Security group allows port 3389.</li>
<li>Instance responds to ping.</li>
<li>RDP cannot connect.</li>
<li>Stop &amp; Start resolves the issue.</li>
</ul>
<p>This behavior closely resembles a network issue, but the logs may point to insufficient system resources.</p>
<h2>Key Logs</h2>
<p>The event log may contain:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Not enough storage is available to process this command.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>And:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>System.OutOfMemoryException</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>You may also see Winlogon-related events, such as Winlogon crashing or failing to create a login session.</p>
<p>Here, &quot;storage&quot; does not necessarily refer to disk — in the context of Windows error codes, it can also mean insufficient memory or system resources.</p>
<h2>Root Cause</h2>
<p>When instance memory and page file resources are exhausted, the system cannot allocate resources for critical processes. Components required for RDP login — such as Winlogon, LSASS, and Remote Desktop Services — may fail to function properly.</p>
<p>Stop &amp; Start clears the memory state, so the issue temporarily disappears, but if the instance size or application memory usage is not addressed, the problem will recur.</p>
<h2>Troubleshooting Direction</h2>
<h3>1. Check Event Logs</h3>
<p>Focus on the period around the failure in:</p>
<ul>
<li>Application.evtx</li>
<li>System.evtx</li>
<li>Setup.evtx</li>
</ul>
<p>Look for:</p>
<ul>
<li><code>OutOfMemoryException</code></li>
<li><code>Not enough storage is available</code></li>
<li>Winlogon errors</li>
<li>Security software or monitoring agent anomalies</li>
<li>Windows Update-related anomalies</li>
</ul>
<h3>2. Check Instance Size</h3>
<p>Confirm whether the current instance memory meets peak workload demands. If it is consistently near the upper limit, upgrade the instance size or optimize the application.</p>
<h3>3. Deploy OS Metrics Monitoring</h3>
<p>CloudWatch does not collect Windows memory metrics by default. You need to install the CloudWatch Agent to collect:</p>
<ul>
<li>Memory utilization</li>
<li>Pagefile utilization</li>
<li>Disk utilization</li>
<li>Key process metrics</li>
</ul>
<p>And set up alarms, such as alerting when memory utilization exceeds 85%.</p>
<h2>Recommended Actions</h2>
<h3>Short-Term Recovery</h3>
<p>Stop &amp; Start can release memory and temporarily restore login capability. But this is not a permanent fix.</p>
<h3>Medium-Term Optimization</h3>
<p>Investigate applications, monitoring agents, and security software that consume high memory to determine if there are memory leaks or overly heavy configurations.</p>
<h3>Long-Term Solution</h3>
<p>If peak workloads genuinely require more memory, upgrade to a larger instance size. Before upgrading, create an AMI and confirm instance type compatibility with ENA/NVMe.</p>
<h2>Summary</h2>
<p>RDP login failure is not necessarily a port 3389, security group, or NACL issue. As long as the instance is still pingable and status checks pass, you should also examine the Windows event logs.</p>
<p>If the logs show OOM, insufficient system resources, and Winlogon anomalies, the root cause is most likely memory exhaustion. Stop &amp; Start only provides temporary recovery — long-term, you need to monitor memory and adjust instance size or application configuration.</p>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Windows Unable to Mount SMB: EDR Interception and Workgroup Authentication</title>
      <link>https://blog.checo.cc/en/posts/AWS/18.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/18.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Windows Unable to Mount SMB: EDR Interception and Workgroup Authentication</source>
      <description>Two EC2 Windows instances in the same VPC fail SMB access with error 1792. Packet capture shows STATUS_NETLOGON_NOT_STARTED. Root cause: security software (EDR) intercepting SMB authentication.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Wed, 03 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Two EC2 Windows instances in the same VPC fail to access a shared folder via SMB. Security groups and NACLs are open, Windows Firewall is disabled, but <code>net use</code> reports error 1792, and packet capture shows <code>STATUS_NETLOGON_NOT_STARTED</code>. The root cause is not VPC networking — security software is intercepting the SMB authentication flow.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>Client access attempt:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>\\&#x3C;server-private-ip>\share</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Cannot open, and no authentication prompt appears. Command line execution:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">net use Z: \\&#x3C;</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">server</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">private</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">ip</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">share</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Reports:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>System error 1792 has occurred.</span></span>
<span class="line"><span>The attempt to logon to the network account failed because the network logon service is not started.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Afterward, port 445 connection timeouts and ping failures may even occur.</p>
<h2>Troubleshooting Process</h2>
<h3>1. Rule Out AWS Network Issues First</h3>
<p>Confirm:</p>
<ul>
<li>Both instances are in the same VPC or have routable connectivity.</li>
<li>Security group allows TCP 445.</li>
<li>NACL is not blocking.</li>
<li>Route table has a local or correct route.</li>
<li>Windows Defender Firewall policy is not blocking.</li>
</ul>
<h3>2. Packet Capture on Both Ends</h3>
<p>Packet capture shows the SMB protocol has already begun negotiation:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>SMB2 Negotiate Protocol Request</span></span>
<span class="line"><span>SMB2 Negotiate Protocol Response</span></span>
<span class="line"><span>SMB2 Session Setup Request</span></span>
<span class="line"><span>SMB2 Session Setup Response: STATUS_NETLOGON_NOT_STARTED</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This indicates traffic has reached the server — it is not an AWS underlying network packet drop.</p>
<h3>3. Understanding Netlogon</h3>
<p>In a Workgroup environment, the <code>Netlogon</code> service not running by default is normal. Local account SMB authentication typically completes through local SAM + NTLM, and should not necessarily fail just because Netlogon is stopped.</p>
<p>If <code>STATUS_NETLOGON_NOT_STARTED</code> is returned and then all traffic is blocked, suspect that security software or EDR is intercepting SMB authentication traffic.</p>
<h2>Solution</h2>
<h3>1. Temporarily Disable EDR to Verify</h3>
<p>Temporarily disable security software during a change window to verify whether SMB access is restored. If port 445 and ping both recover after disabling, the root cause is essentially confirmed.</p>
<h3>2. Use Explicit Local Account Authentication</h3>
<p>In a Workgroup environment, do not rely on implicit credentials. Use a server local account:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">net use Z: \\&#x3C;</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">server</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">private</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">ip</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">share</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">user</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:&#x3C;</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">server</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">computer</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">name</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">>\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Administrator</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Note that <code>&lt;server-computer-name&gt;</code> must be the server's computer name, not the client's.</p>
<h3>3. Adjust EDR Policy</h3>
<p>Contact the security software vendor or security team to whitelist normal SMB/NTLM authentication traffic and prevent false positives.</p>
<h3>4. Long-Term Recommendation: Join a Domain</h3>
<p>If multiple Windows instances frequently share files, consider joining Active Directory and using domain accounts with group-based permissions to reduce the complexity of Workgroup + local account authentication.</p>
<h2>Summary</h2>
<p>When EC2 Windows SMB access fails, don't only look at security groups. If packet capture already shows SMB protocol negotiation and authentication-stage errors, the issue has moved into the OS or security software layer.</p>
<p><code>STATUS_NETLOGON_NOT_STARTED</code> in a Workgroup scenario does not necessarily mean Netlogon itself is the root cause. Combined with subsequent traffic being blocked, EDR or security software interception should be a primary investigation focus.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Exporting EC2 Windows Root Volume as VMDK and Booting in VMware</title>
      <link>https://blog.checo.cc/en/posts/AWS/19.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/19.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Exporting EC2 Windows Root Volume as VMDK and Booting in VMware</source>
      <description>Public Windows AMIs cannot be exported as VMDK via VM Import/Export. Workaround: stop the instance, block-read the EBS root volume, convert with qemu-img, and offline-enable generic storage drivers.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Wed, 03 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>EC2 instances launched from public Windows AMIs cannot be directly exported as VMDK via VM Import/Export because they contain AWS-licensed software. The workaround is to perform a block-level read of the EBS root volume after stopping the instance, convert it with <code>qemu-img</code>, and offline-enable Windows generic storage drivers to avoid blue screens in VMware.</p>
<!-- more -->
<h2>Why VM Export Fails</h2>
<p>Running <code>create-instance-export-task</code> may produce:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>An error occurred (NotExportable) when calling the CreateInstanceExportTask operation:</span></span>
<span class="line"><span>The image ID (ami-xxxxxxxx) provided contains AWS-licensed software and is not exportable.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>This is a product limitation, not an IAM permissions issue. Windows / SQL Server / Marketplace images launched from public AWS AMIs are generally non-exportable.</p>
<h2>Alternatives</h2>
<p>Available options:</p>
<ul>
<li>If you can log in to the instance: use Disk2vhd.</li>
<li>If you don't want to spin up a rescue instance: use coldsnap + qemu-img.</li>
<li>If the instance can be stopped or has crashed: use a rescue instance for block-level EBS reading, then qemu-img conversion.</li>
</ul>
<p>This article documents the third approach.</p>
<h2>Key Pitfall: Storage Controller Drivers</h2>
<p>EC2 Windows typically runs on NVMe devices. After exporting to VMware, the controller may change to LSI Logic SAS, SATA, or IDE. If these drivers are not set to Boot start in the Windows registry, you'll get a blue screen at boot:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>UNMOUNTABLE_BOOT_VOLUME</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>So before conversion, you need to offline-modify the SYSTEM hive and set the Start value of common storage drivers to 0.</p>
<h2>Procedure</h2>
<h3>1. Stop Instance and Detach Volume</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ec2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> stop-instances</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --instance-ids</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">instance-i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d></span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ec2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> wait</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> instance-stopped</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --instance-ids</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">instance-i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d></span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ec2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> detach-volume</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --volume-id</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">volume-i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d></span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ec2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> wait</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> volume-available</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --volume-ids</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">volume-i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d></span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ec2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> attach-volume</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --volume-id</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">volume-i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d> </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --instance-id</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">helper-instance-i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">d> </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --device</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/sdg</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>It's recommended to create a snapshot of the volume before proceeding.</p>
<h3>2. Identify Disk on Rescue Instance</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> lsblk</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> NAME,SIZE,SERIAL,MOUNTPOINT,FSTYPE</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>On Nitro instances, EBS appears as <code>/dev/nvmeXn1</code>. You can match volume IDs via the SERIAL field.</p>
<h3>3. Mount Working Disk</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mkfs.xfs</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -f</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/nvme1n1</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mkdir</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -p</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/work</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mount</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/nvme1n1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/work</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The working disk must be larger than the actual output size of the target volume.</p>
<h3>4. Install Tools</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dnf</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> install</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -y</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> qemu-img</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> gcc</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> make</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> perl</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If hivex is not available in the repository, you'll need to install it from source. It's used to edit Windows registry hives.</p>
<h3>5. Mount NTFS and Backup SYSTEM Hive</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> modprobe</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ntfs3</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mkdir</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -p</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/windows</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mount</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -t</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ntfs3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> rw</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/nvme2n1p1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/windows</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> cp</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/windows/Windows/System32/config/SYSTEM</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/work/SYSTEM_BACKUP</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> cp</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /mnt/windows/Windows/System32/config/SYSTEM</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /tmp/SYSTEM_EDIT</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3>6. Enable Generic Storage Drivers</h3>
<p>The following services need their <code>Start</code> set to <code>0</code>:</p>
<p>| Service | Purpose |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Launching a Windows 11 EC2 Instance on AWS</title>
      <link>https://blog.checo.cc/en/posts/AWS/2.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/2.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Launching a Windows 11 EC2 Instance on AWS</source>
      <description>AWS China has no Windows 11 AMI. Launch a Linux EC2 instance first, then use an open-source reinstall script to DD it into Windows 11, with full steps including VNC driver setup.</description>
      <category>AWS</category>
      <pubDate>Wed, 03 Dec 2025 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>AWS China does not directly provide a Windows 11 AMI, and VM Import/Export also requires additional image preparation and import procedures. A compromise approach is to first launch a Linux EC2 instance and then reinstall the system as Windows using an open-source reinstall script.</p>
<p>Project repository: <a href="https://github.com/bin456789/reinstall" target="_blank" rel="noopener noreferrer">bin456789/reinstall</a></p>
<p>Reference documentation: <a href="https://lpwmm.blog.csdn.net/article/details/155258680?spm=1001.2014.3001.5502" target="_blank" rel="noopener noreferrer">CSDN original article</a></p>
<!-- more -->
<h2>Steps</h2>
]]></content:encoded>
    </item>
    <item>
      <title>Installing Windows 11 ARM via DD on EC2 T4g (Graviton) ARM Instances</title>
      <link>https://blog.checo.cc/en/posts/AWS/20.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/20.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Installing Windows 11 ARM via DD on EC2 T4g (Graviton) ARM Instances</source>
      <description>AWS has no Graviton Windows AMI. Use the open-source reinstall project&amp;apos;s one-click DD script to reinstall a t4g instance from Amazon Linux 2023 to Windows 11 Pro ARM64 in place.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Mon, 08 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>AWS does not provide Windows AMIs for the Graviton architecture, but that doesn't mean Graviton can't run Windows. This article documents how to use the open-source project <a href="https://github.com/bin456789/reinstall" target="_blank" rel="noopener noreferrer">bin456789/reinstall</a>'s one-click DD script to reinstall a t4g instance running Amazon Linux 2023 into Windows 11 Pro ARM64 in place.</p>
<figure><img src="/assets/images/posts/graviton2-win11-taskmanager.jpg" alt="Windows 11 Task Manager showing AWS Graviton2 processor" tabindex="0" loading="lazy"><figcaption>Windows 11 Task Manager showing AWS Graviton2 processor</figcaption></figure>
<!-- more -->
<h2>Why Graviton Can't Officially Run Windows</h2>
<p>AWS only provides Windows AMIs for the x86 architecture. Graviton uses the ARM64 architecture. Although Microsoft has Windows on ARM, AWS has not done official driver adaptation and AMI publishing for the Graviton platform. So the normal flow is: choose t3/t3a x86 instances for Windows, and Graviton can only run Linux.</p>
<p>But &quot;not officially supported&quot; doesn't mean &quot;can't run.&quot; The <a href="http://reinstall.sh" target="_blank" rel="noopener noreferrer">reinstall.sh</a> script can directly DD-install Windows on an existing Linux instance, including the ARM64 version. Test environment:</p>
<ul>
<li>Instance type: <code>t4g.large</code> (2 vCPU / 8 GB)</li>
<li>Original system: Amazon Linux 2023 aarch64, 50 GB EBS (gp3), UEFI boot</li>
<li>Target system: Windows 11 Pro 25H2 ARM64 (Build 26200.6584), Chinese version</li>
</ul>
<h2>Core Finding: The Counter-Intuitive NVMe Driver Pitfall</h2>
<p>The most counter-intuitive part of the entire process: <strong>Injecting the official AWS NVMe driver actually causes boot failure; only the Microsoft inbox StorNVMe works properly.</strong></p>
<p><code>StorNVMe.sys</code> is a standard NVMe driver built into the system image by Microsoft since Windows 8.1. It loads automatically during installation without any external injection or manual operation. The <code>Has StorNVMe: true</code> in the <a href="http://reinstall.sh" target="_blank" rel="noopener noreferrer">reinstall.sh</a> log means the script detected the ISO includes this inbox driver.</p>
<p>Real-world comparison:</p>
<p>| Approach | NVMe Driver | ENA Driver | Result |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/posts/graviton2-win11-taskmanager.jpg" type="image/jpeg"/>
    </item>
    <item>
      <title>ALB Certificate Chain Break Causes curl to Report &amp;quot;unable to get local issuer certificate&amp;quot;</title>
      <link>https://blog.checo.cc/en/posts/AWS/3.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">ALB Certificate Chain Break Causes curl to Report &amp;quot;unable to get local issuer certificate&amp;quot;</source>
      <description>After configuring HTTPS on an internal ALB, curl reports unable to get local issuer certificate. Troubleshoot incomplete ACM certificate chains and SAN domain coverage, complete intermediate cert fix and verification.</description>
      <category>AWS</category>
      <pubDate>Wed, 03 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After configuring HTTPS on an internal ALB, clients accessing the domain receive <code>curl: (60) SSL certificate problem: unable to get local issuer certificate</code>. This error is not necessarily a network issue — more commonly it means the ACM certificate chain bound to the ALB is incomplete, or the certificate SAN does not cover the accessed domain.</p>
<!-- more -->
<h2>Symptoms</h2>
<p>Accessing an internal service results in an error:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://service.example.internal/api/v1/health</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>curl: (60) SSL certificate problem: unable to get local issuer certificate</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>The architecture is roughly:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Client -> Internal ALB 443 -> Backend Target 443</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If bypassing the ALB and directly accessing the backend target succeeds, it indicates the backend service itself is most likely not the root cause.</p>
<h2>Troubleshooting Approach</h2>
<h3>1. Don't Rely on Public SSL Check Results</h3>
<p>If the domain resolves to an internal ALB in a Route 53 private hosted zone, a public SSL checker may see a different public DNS record. Public check results cannot represent the certificate actually served by the internal ALB.</p>
<h3>2. Use openssl to Inspect the Actual ALB Certificate</h3>
<p>Run the following on an internal client:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">openssl</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> s_client</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -showcerts</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -connect</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">alb-dns-nam</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">e></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">:443</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -servername</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> service.example.internal</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/dev/null</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Focus on two things:</p>
<ul>
<li>Whether the certificate SAN/CN covers the accessed domain.</li>
<li>Whether the intermediate certificate served by the ALB matches the site certificate's signing chain.</li>
</ul>
<h3>3. Distinguish Between Two Problems</h3>
<p>A broken certificate chain and a domain mismatch are two different problems:</p>
<ul>
<li>A broken chain causes the client to fail to find a trusted parent CA.</li>
<li>SAN not covering the domain causes hostname verification to fail.</li>
</ul>
<p>Either one can cause HTTPS to fail.</p>
<h2>Root Cause</h2>
<p>In this case, the site certificate was issued by a DV intermediate CA, but the one included during ACM import was a different OV intermediate CA. The ALB therefore served a mismatched intermediate certificate chain to the client, and curl could not build a complete trust chain.</p>
<p>At the same time, the ALB-bound certificate's SAN also did not cover the actual domain being accessed. In other words, even if the certificate chain were fixed, it would still fail due to the domain mismatch.</p>
<h2>Solution</h2>
<h3>1. Fix the ACM Certificate Chain</h3>
<p>Re-import the original ACM certificate and upload the correct intermediate certificate chain:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> acm</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> import-certificate</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --certificate-arn</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">certificate-ar</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">n> </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --certificate</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fileb://site.crt</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --private-key</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fileb://site.key</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --certificate-chain</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fileb://correct-chain.crt</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The advantage of using reimport is that it preserves the original ARN, so the ALB listener does not need to re-select a certificate.</p>
<h3>2. Ensure the Certificate Covers the Accessed Domain</h3>
<p>Check whether the certificate SAN includes the domain being used:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">openssl</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> x509</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -in</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> site.crt</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -noout</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -text</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -A1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Subject Alternative Name"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If it does not, you need to request or import a new certificate that covers the target domain and bind it to the ALB HTTPS listener.</p>
<h3>3. Clean Up ALB Listener Certificates</h3>
<p>If the ALB has multiple certificates attached, it is recommended to clean up unused certificates to avoid SNI matching confusion and operational judgment errors.</p>
<h2>Summary</h2>
<p>When ALB HTTPS reports <code>unable to get local issuer certificate</code>, the troubleshooting focus should be the certificate chain actually served by the ALB, not the backend Nginx or public SSL check results.</p>
<p>Recommended fixed troubleshooting order:</p>
<ol>
<li>Use <code>openssl s_client -showcerts</code> on an internal client to inspect the certificate served by the ALB.</li>
<li>Check whether SAN/CN covers the accessed domain.</li>
<li>Check whether the intermediate certificate matches the site certificate's signing chain.</li>
<li>Use ACM reimport to fix the certificate chain, and replace the listener certificate if necessary.</li>
</ol>
]]></content:encoded>
    </item>
    <item>
      <title>Counting Objects with Specific Extensions in an S3 Bucket by Size and Count</title>
      <link>https://blog.checo.cc/en/posts/AWS/4.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Counting Objects with Specific Extensions in an S3 Bucket by Size and Count</source>
      <description>Use AWS CLI to stream-count objects by extension (e.g. jpg/png) in a versioned S3 bucket, including historical versions, without waiting for S3 Inventory.</description>
      <category>AWS</category>
      <pubDate>Sat, 25 Apr 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Sometimes you need to quickly count the number and total size of a certain type of file in an S3 bucket, such as <code>.jpg</code> or <code>.png</code> image objects. If the bucket has versioning enabled, historical versions also need to be included. This kind of requirement may not be suitable for waiting on S3 Inventory — streaming the count directly with AWS CLI is faster.</p>
<!-- more -->
<h2>Scenario</h2>
<p>The goal is to count the following in a versioning-enabled S3 bucket:</p>
<ul>
<li>Number of objects with a specified file extension.</li>
<li>Total size of objects with a specified file extension.</li>
<li>Including all historical versions, not just the current version.</li>
</ul>
<p>If the business requires &quot;results right now,&quot; S3 Inventory may not be suitable because it is an asynchronous report and the first generation typically has a delay.</p>
<h2>Why Use list-object-versions</h2>
<p>The regular <code>list-objects</code> only looks at the current object version and cannot cover historical versions. For buckets with versioning enabled, use:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> s3api</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> list-object-versions</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Then use <code>--query 'Versions[*].[Key, Size]'</code> to extract only the object Key and Size, reducing downstream processing cost.</p>
<h2>Counting Command</h2>
<p>The following example counts <code>.jpg</code> and <code>.png</code> objects:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">aws</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> s3api</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> list-object-versions</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --bucket</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">bucket-nam</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">e> </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --region</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">regio</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">n> </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --query</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'Versions[*].[Key, Size]'</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --output</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> text</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> |</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -Ei</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "\.(jpg|png)[[:space:]]+[0-9]+$"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> |</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">awk</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> '</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">BEGIN {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  fmt = "Total image objects (including historical versions): %d\n"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">}</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">{</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  count++;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  size += $NF;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">}</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">END {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  print "======================";</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  printf fmt, count;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  printf "Total size (including historical versions): %.2f GB\n", size/1024/1024/1024;</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  print "======================";</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">}'</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Example output:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>======================</span></span>
<span class="line"><span>Total image objects (including historical versions): 120446</span></span>
<span class="line"><span>Total size (including historical versions): 56.33 GB</span></span>
<span class="line"><span>======================</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2>Notes</h2>
<ul>
<li>It is recommended to execute this on an EC2 instance in the same region to reduce network latency.</li>
<li>If there are many objects, CLI calls will incur List request costs.</li>
<li>If you only need the current version, do not use <code>list-object-versions</code> — use <code>list-objects-v2</code> instead.</li>
<li>If the object scale is very large and some delay is acceptable, S3 Inventory is more suitable for periodic reporting.</li>
<li>If keys contain special characters such as newlines, text pipeline processing will have edge-case issues. For rigorous scenarios, use JSON + jq.</li>
</ul>
<h2>Summary</h2>
<p>When you need to urgently count objects with specific extensions in an S3 bucket, <code>list-object-versions + grep + awk</code> is a simple and effective solution. Its advantages are that it is real-time, lightweight, and requires no waiting for Inventory; its disadvantage is that it is more suited for one-off counting, not long-term periodic reporting.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Restricting Specific Users from Logging into EC2 via Console After SAML Federated Login</title>
      <link>https://blog.checo.cc/en/posts/AWS/5.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Restricting Specific Users from Logging into EC2 via Console After SAML Federated Login</source>
      <description>In an AD + SAML federated identity setup, use the aws:userid condition key to explicitly Deny specific domain users from accessing EC2 via Session Manager or EC2 Instance Connect.</description>
      <category>AWS</category>
      <category>Security</category>
      <pubDate>Mon, 06 Apr 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>In an AD + SAML federated identity scenario, users may log into the AWS console through the same high-privilege IAM Role. If you only want to restrict a subset of those users from using Session Manager or EC2 Instance Connect to log into instances, you can use the <code>aws:userid</code> condition key to create an explicit Deny.</p>
<!-- more -->
<h2>Scenario</h2>
<p>In an enterprise environment, many domain users log into the AWS console via SAML AssumeRole, potentially using high-privilege roles like <code>PowerUser</code> or <code>Administrator</code>.</p>
<p>Due to compliance requirements, certain users need to be restricted from accessing EC2 instances through the console, primarily involving two capabilities:</p>
<ul>
<li>SSM Session Manager: <code>ssm:StartSession</code></li>
<li>EC2 Instance Connect: <code>ec2-instance-connect:SendSSHPublicKey</code></li>
</ul>
<h2>Why Not Use RoleSessionName</h2>
<p>After SAML federated login, IAM generates a session identifier. The more stable and available global condition key for policy evaluation is <code>aws:userid</code>. It typically contains the role ID and session name, in a format like:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>&#x3C;role-id>:&#x3C;session-name></span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Because the role ID portion changes with the Role, it is not suitable for hardcoding. Instead, you can use a wildcard to match the session suffix:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>*:user-or-ou-id</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2>Example Policy</h2>
<p>Add an explicit Deny to the target IAM Role:</p>
<div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-json"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  "Version"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"2012-10-17"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  "Statement"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: [</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      "Sid"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"DenyEC2LoginForSpecificFederatedUsers"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      "Effect"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Deny"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      "Action"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: [</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "ssm:StartSession"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "ec2-instance-connect:SendSSHPublicKey"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">      ],</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      "Resource"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"*"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      "Condition"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">        "StringLike"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">          "aws:userid"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: [</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">            "*:&#x3C;user-or-ou-id>"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">          ]</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">        }</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">      }</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    }</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  ]</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Explicit Deny takes priority over Allow, so even if the Role already has high-privilege policies, users matching the condition will still be blocked.</p>
<h2>Verification Method</h2>
<ol>
<li>Log into the console as the target SAML user.</li>
<li>Attempt to connect to EC2 via Session Manager.</li>
<li>Attempt to use EC2 Instance Connect.</li>
<li>Then verify that unrestricted users are not affected.</li>
</ol>
<p>If the Deny is working, the target user will be denied when calling the related APIs.</p>
<h2>Recommended Long-Term Approach</h2>
<p>Hardcoding user suffixes based on <code>aws:userid</code> can quickly solve the problem, but the maintenance cost is high. A better approach is to split permissions at the identity source level:</p>
<ul>
<li>Create a restricted user group in AD, e.g., <code>AWS-No-EC2-Login</code>.</li>
<li>Map different user groups to different IAM Roles in the IdP.</li>
<li>Create a dedicated restricted Role that does not grant EC2 login capabilities.</li>
</ul>
<p>This makes permission boundaries clearer and easier to audit and automate.</p>
<h2>Summary</h2>
<p>If you need to temporarily restrict certain SAML users from logging into EC2 via the console, you can use <code>aws:userid</code> + explicit Deny to precisely block <code>ssm:StartSession</code> and <code>ec2-instance-connect:SendSSHPublicKey</code>.</p>
<p>In the long term, it is recommended to manage user grouping and Role mapping at the identity source side, rather than maintaining increasingly complex conditional policies within a single high-privilege Role.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>