<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>KVM &amp;mdash; Kicou</title>
    <link>https://blog.kicou.info/tag:KVM</link>
    <description>Random thoughts and ramblings</description>
    <pubDate>Wed, 29 Apr 2026 09:20:34 -0400</pubDate>
    <item>
      <title>Windows 11 VM in Linux</title>
      <link>https://blog.kicou.info/windows-11-vm-in-linux</link>
      <description>&lt;![CDATA[#Windows #Linux #KVM #Libvirt&#xA;&#xA;This procedure has been tested in Arch Linux. Other distributions may have slightly different package requirements or naming conventions.&#xA;&#xA;Required packages&#xA;swtpm — provides TPM 2.0&#xA;edk2-ovmf — provides EFI/Secureboot filesystem image&#xA;&#xA;ISO images needed&#xA;Windows 11 installation disk&#xA;VirtIO driver disk&#xA;&#xA;Extract Windows OEM product key from host system&#xA;If the system was shipped with a pre-installed Windows OS, it has the Windows licencing information in BIOS&#xA;&#xA;$ sudo strings /sys/firmware/acpi/tables/MSDM&#xA;MSDMU&#xA;TLENOVOTP-N32  p&#xA;PTEC&#xA;AAAA1-AAAAA-AAAA1-1A1AA-11AA1 ← not my real product key&#xA;The last line is the product key!--more--&#xA;&#xA;Create a new VM&#xA;&#xA;   &#xA;4 GB of RAM and 2 vCPUs are the minumum requirements for Windows 11&#xA;&#xA;   &#xA;Windows 11 requires a minimum of 64 GB of disk space&#xA;&#xA;   &#xA;Make sure you check the box &#34;Customize configuration before install&#34; and hit &#34;Finish&#34;&#xA;&#xA;Change the &#34;Firmware&#34; setup to &#xA;You can now hit &#34;Begin Installation&#34; and proceed with the Windows 11 installation and initial setup&#xA;&#xA;Install Windows 11&#xA;&#xA;OS installation&#xA;Make sure you select the same OS edition as the one for which you have an OEM licence (e.g.: Windows 11 Professional).&#xA;&#xA;Initial setup&#xA;If you don&#39;t want to enrol a Microsoft Live account, answer that you want to use a Work or Active Directory account (Windows 11 Professional and up): this will take you to the local account creation screens.&#xA;&#xA;Paravirtualized drivers&#xA;VirtIO drivers provide better performance and should be used when possible.&#xA;The Spice video drivers also allow for seamless mouse cursor movement, dynamic resolution changes as well as drag-and-drop operations from Gnome to the Windows desktop (one way only)&#xA;&#xA;VirtIO drivers installation&#xA;mount the VirtIO driver/guest agent ISO&#xA;install the drivers and guest agent&#xA;&#xA;Change system disk (SATA→VirtIO)&#xA;&#xA;The default system disk is created as a SATA drive. Changing it to VirtIO immediately will not work because Windows has to load the VirtIO disk drivers at least once before it is able to boot from a VirtIO system disk. We need to created dummy VirtIO disk first.&#xA;&#xA;shut down the VM&#xA;add a 1GB VirtIO hard disk&#xA;power on the VM and let the OS load completely&#xA;sign in and check that Disk Manager sees an extra disk (you don&#39;t need to initialise it)&#xA;shut down the VM&#xA;delete the 1GB VirtIO drive&#xA;change the system disk type from SATA to VirtIO — you need to edit the XML file to perform this operation (either through virsh or from the virt-manager GUI, after having enabled XML file edition)&#xA;&#xA;Initial disk configuration:&#xA;disk type=&#34;file&#34; device=&#34;disk&#34;&#xA;  driver name=&#34;qemu&#34; type=&#34;qcow2&#34;/&#xA;  source file=&#34;/var/lib/libvirt/images/Windows11.qcow2&#34;/&#xA;  target dev=&#34;sda&#34; bus=&#34;sata&#34;/&#xA;/disk&#xA;&#xA;Modified disk configuration:&#xA;disk type=&#34;file&#34; device=&#34;disk&#34;&#xA;  driver name=&#34;qemu&#34; type=&#34;qcow2&#34;/&#xA;  source file=&#34;/var/lib/libvirt/images/Windows11.qcow2&#34;/&#xA;  target dev=&#34;vda&#34; bus=&#34;virtio&#34;/&#xA;  address type=&#34;pci&#34; domain=&#34;0x0000&#34; bus=&#34;0x05&#34; slot=&#34;0x00&#34; function=&#34;0x0&#34;/&#xA;/disk&#xA;&#xA;Other devices&#xA;Now that the VirtIO drivers have been installed in Windows, you can change the NIC type from Intel e1000e to VirtIO via the virt-manager GUI&#xA;&#xA;Activate Windows&#xA;Use the product key extracted from BIOS information (see above)&#xA;&#xA;You can now proceed witht he system updates and start using the Windows VM.&#xA;&#xA;— Kicou]]&gt;</description>
      <content:encoded><![CDATA[<p><a href="https://blog.kicou.info/tag:Windows" class="hashtag"><span>#</span><span class="p-category">Windows</span></a> <a href="https://blog.kicou.info/tag:Linux" class="hashtag"><span>#</span><span class="p-category">Linux</span></a> <a href="https://blog.kicou.info/tag:KVM" class="hashtag"><span>#</span><span class="p-category">KVM</span></a> <a href="https://blog.kicou.info/tag:Libvirt" class="hashtag"><span>#</span><span class="p-category">Libvirt</span></a></p>

<p>This procedure has been tested in Arch Linux. Other distributions may have slightly different package requirements or naming conventions.</p>

<h2 id="required-packages">Required packages</h2>
<ul><li><a href="https://archlinux.org/packages/community/x86_64/swtpm">swtpm</a> — provides TPM 2.0</li>
<li><a href="https://archlinux.org/packages/extra/any/edk2-ovmf">edk2-ovmf</a> — provides EFI/Secureboot filesystem image</li></ul>

<h3 id="iso-images-needed">ISO images needed</h3>
<ul><li><a href="https://www.microsoft.com/en-us/software-download/windows11">Windows 11 installation disk</a></li>
<li><a href="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso">VirtIO driver disk</a></li></ul>

<h3 id="extract-windows-oem-product-key-from-host-system">Extract Windows OEM product key from host system</h3>

<p>If the system was shipped with a pre-installed Windows OS, it has the Windows licencing information in BIOS</p>

<pre><code class="language-bash">$ sudo strings /sys/firmware/acpi/tables/MSDM
MSDMU
TLENOVOTP-N32  p
PTEC
AAAA1-AAAAA-AAAA1-1A1AA-11AA1 ← not my real product key
</code></pre>

<p>The last line is the product key</p>

<h3 id="create-a-new-vm">Create a new VM</h3>

<p><img src="https://pixelfed-prod.nyc3.cdn.digitaloceanspaces.com/public/m/_v2/192044957266219008/2a69c66ec-4b94d5/Q1gIspgyQUWF/3W9HOJxk50KFvL07FaRFHSVZZgG2dOpLbtxs4kAe.png" alt=""></p>

<p><img src="https://pixelfed-prod.nyc3.cdn.digitaloceanspaces.com/public/m/_v2/192044957266219008/2a69c66ec-4b94d5/RfLOUTz15Rkv/vkjq9DE5yVu3LjHsvspFnMrWHmpfY6sKJR03URfS.png" alt=""></p>

<p><img src="https://pixelfed-prod.nyc3.cdn.digitaloceanspaces.com/public/m/_v2/192044957266219008/2a69c66ec-4b94d5/Nn2pdsCt1HbP/o8fHevJjiUdYJPftSIoMaK552gRFsRXiNxkLgaDV.png" alt=""><br>
4 GB of RAM and 2 vCPUs are the minumum requirements for Windows 11</p>

<p><img src="https://pixelfed-prod.nyc3.cdn.digitaloceanspaces.com/public/m/_v2/192044957266219008/2a69c66ec-4b94d5/hoaOcxug8JTG/8qIw1x9cKTAJfXlhsfhSHPqaYVaKR3R8iBpEyacD.png" alt=""><br>
Windows 11 requires a minimum of 64 GB of disk space</p>

<p><img src="https://pixelfed-prod.nyc3.cdn.digitaloceanspaces.com/public/m/_v2/192044957266219008/2a69c66ec-4b94d5/WcX0lD275w1u/sirngCFgzXSagJnQWkSnfKaki7ETHdjk9lDfF7zS.png" alt=""><br>
Make sure you check the box “Customize configuration before install” and hit “Finish”</p>

<p><img src="https://pixelfed-prod.nyc3.cdn.digitaloceanspaces.com/public/m/_v2/192044957266219008/2a69c66ec-4b94d5/CqsdENRKmAs1/OTGNWIyfXsL4QuctPK4Fg1hMryIr1ZcmLRMW3x82.png" alt="">
Change the “Firmware” setup to <code>UEFI x86_64: /usr/share/edk2-ovmf/x64/OVMF_CODE_secboot.fd</code></p>

<p>You can now hit “Begin Installation” and proceed with the Windows 11 installation and initial setup</p>

<h3 id="install-windows-11">Install Windows 11</h3>

<h4 id="os-installation">OS installation</h4>

<p>Make sure you select the same OS edition as the one for which you have an OEM licence (e.g.: Windows 11 Professional).</p>

<h4 id="initial-setup">Initial setup</h4>

<p>If you don&#39;t want to enrol a Microsoft Live account, answer that you want to use a Work or Active Directory account (Windows 11 Professional and up): this will take you to the local account creation screens.</p>

<h3 id="paravirtualized-drivers">Paravirtualized drivers</h3>

<p>VirtIO drivers provide better performance and should be used when possible.
The Spice video drivers also allow for seamless mouse cursor movement, dynamic resolution changes as well as drag-and-drop operations from Gnome to the Windows desktop (one way only)</p>

<h4 id="virtio-drivers-installation">VirtIO drivers installation</h4>
<ul><li>mount the VirtIO driver/guest agent ISO</li>
<li>install the drivers and guest agent</li></ul>

<h4 id="change-system-disk-sata-virtio">Change system disk (SATA→VirtIO)</h4>

<p>The default system disk is created as a SATA drive. Changing it to VirtIO immediately will not work because Windows has to load the VirtIO disk drivers at least once before it is able to boot from a VirtIO system disk. We need to created dummy VirtIO disk first.</p>
<ul><li>shut down the VM</li>
<li>add a 1GB VirtIO hard disk</li>
<li>power on the VM and let the OS load completely</li>
<li>sign in and check that Disk Manager sees an extra disk (you don&#39;t need to initialise it)</li>
<li>shut down the VM</li>
<li>delete the 1GB VirtIO drive</li>
<li>change the system disk type from SATA to VirtIO — you need to edit the XML file to perform this operation (either through virsh or from the virt-manager GUI, after having enabled XML file edition)</li></ul>

<p>Initial disk configuration:</p>

<pre><code class="language-xml">&lt;disk type=&#34;file&#34; device=&#34;disk&#34;&gt;
  &lt;driver name=&#34;qemu&#34; type=&#34;qcow2&#34;/&gt;
  &lt;source file=&#34;/var/lib/libvirt/images/Windows11.qcow2&#34;/&gt;
  &lt;target dev=&#34;sda&#34; bus=&#34;sata&#34;/&gt;
&lt;/disk&gt;
</code></pre>

<p>Modified disk configuration:</p>

<pre><code class="language-xml">&lt;disk type=&#34;file&#34; device=&#34;disk&#34;&gt;
  &lt;driver name=&#34;qemu&#34; type=&#34;qcow2&#34;/&gt;
  &lt;source file=&#34;/var/lib/libvirt/images/Windows11.qcow2&#34;/&gt;
  &lt;target dev=&#34;vda&#34; bus=&#34;virtio&#34;/&gt;
  &lt;address type=&#34;pci&#34; domain=&#34;0x0000&#34; bus=&#34;0x05&#34; slot=&#34;0x00&#34; function=&#34;0x0&#34;/&gt;
&lt;/disk&gt;
</code></pre>

<h4 id="other-devices">Other devices</h4>

<p>Now that the VirtIO drivers have been installed in Windows, you can change the NIC type from Intel e1000e to VirtIO via the virt-manager GUI</p>

<h3 id="activate-windows">Activate Windows</h3>

<p>Use the product key extracted from BIOS information (see above)</p>

<p>You can now proceed witht he system updates and start using the Windows VM.</p>

<p>— Kicou</p>
]]></content:encoded>
      <guid>https://blog.kicou.info/windows-11-vm-in-linux</guid>
      <pubDate>Fri, 22 Oct 2021 02:47:13 +0000</pubDate>
    </item>
  </channel>
</rss>