<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Sysinternals on inetshell</title><link>https://inet.sh/en/tags/sysinternals/</link><description>Recent content in Sysinternals on inetshell</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 25 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://inet.sh/en/tags/sysinternals/index.xml" rel="self" type="application/rss+xml"/><item><title>Windows: convert a running machine to VHDX with Disk2vhd (live P2V)</title><link>https://inet.sh/en/posts/windows/disk2vhd-p2v-vhdx-live-machine/</link><pubDate>Fri, 25 Sep 2026 00:00:00 +0000</pubDate><guid>https://inet.sh/en/posts/windows/disk2vhd-p2v-vhdx-live-machine/</guid><description>Sysinternals Disk2vhd takes a consistent VHD/VHDX image of a running Windows using Volume Shadow Copy, with no shutdown or USB boot. What to tick, where to store the image, how to boot it on Hyper-V (Gen 1 vs Gen 2) and on Proxmox/KVM with qm disk import, and the traps: BitLocker, disk signature, virtio drivers, and licensing.</description><content:encoded><![CDATA[<h2 id="tldr">TL;DR</h2>
<ol>
<li>
<p>Download <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/disk2vhd">Disk2vhd</a> or run it straight from <code>\\live.sysinternals.com\tools\disk2vhd.exe</code>.</p>
</li>
<li>
<p>As administrator: tick <strong>Use Vhdx</strong> and <strong>Use Volume Shadow Copy</strong>, select <strong>every volume on the system disk</strong> (including the <em>System Reserved</em> or <em>EFI System Partition</em>), pick a destination on <strong>another disk or a network share</strong>, and <strong>Create</strong>.</p>
</li>
<li>
<p>From the command line (the whole disk, handy for scripts):</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">disk2vhd * D:\p2v\server01.vhdx
</span></span></code></pre></td></tr></table>
</div>
</div><p><code>disk2vhd /?</code> shows the switches equivalent to the checkboxes in the current version.</p>
</li>
</ol>
<p>Result: one <code>.vhdx</code> per physical disk, bootable on Hyper-V and convertible for Proxmox/KVM.</p>
<h2 id="what-it-does">What it does</h2>
<p>Disk2vhd (Sysinternals, version 2.02 from 2021) takes a <strong>Volume Shadow Copy</strong> snapshot of the volumes you tick and dumps it into a VHD or VHDX. That is why it runs <strong>on a live system</strong>: the copy is consistent as of the snapshot even though the server keeps writing. It preserves the disk&rsquo;s partition table (MBR or GPT) and copies only the data of the selected volumes, so you can take the system and leave a data disk behind.</p>
<p>It runs on Vista/Server 2008 and later, x86 and x64.</p>
<h2 id="before-creating-the-image">Before creating the image</h2>
<ul>
<li><strong>Space</strong>: the VHDX is dynamic and grows to the size of the used data. The destination should be on another disk; on the same disk you are converting it works, but slowly.</li>
<li><strong>BitLocker off</strong> on the volumes to convert, fully decrypted. Disk2vhd does not support encrypted volumes.</li>
<li><strong>Hibernation off</strong> (<code>powercfg /h off</code>): <code>hiberfil.sys</code> weighs as much as the RAM and is useless in the VM.</li>
<li><strong>Hardware tools out</strong>: RAID utilities, NIC teaming, vendor agents; in the VM they only get in the way.</li>
<li><strong>Drivers for the target</strong>: if you are going to KVM/Proxmox, install the <a href="https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers">virtio-win drivers</a> on the physical machine first (the <code>virtio-win-guest-tools</code> installer). Windows only boots on new hardware if it already has the disk controller driver; if you cannot install them beforehand, boot the VM on SATA/IDE and switch to virtio later.</li>
<li><strong>Dynamic disks</strong>: convert to basic first. Disk2vhd copies them, but booting from LDM on another machine is a source of trouble.</li>
</ul>
<h2 id="booting-the-image">Booting the image</h2>
<h3 id="hyper-v">Hyper-V</h3>
<table>
  <thead>
      <tr>
          <th>Source disk</th>
          <th>VM</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>MBR / BIOS</td>
          <td><strong>Generation 1</strong>, disk attached as <strong>IDE</strong> (as the Disk2vhd documentation asks)</td>
      </tr>
      <tr>
          <td>GPT / UEFI</td>
          <td><strong>Generation 2</strong>, <strong>SCSI</strong> disk; Secure Boot off if the Windows is older than 8.1</td>
      </tr>
  </tbody>
</table>
<p>On first boot Windows detects the new hardware and installs what it has; the <em>Integration Services</em> fill in the rest.</p>
<h3 id="proxmox--kvm">Proxmox / KVM</h3>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">qm create <span class="m">120</span> --name server01 --memory <span class="m">8192</span> --cores <span class="m">4</span> --net0 virtio,bridge<span class="o">=</span>vmbr0 --ostype win11
</span></span><span class="line"><span class="cl">qm disk import <span class="m">120</span> /mnt/p2v/server01.vhdx local-lvm            <span class="c1"># qemu-img converts the VHDX</span>
</span></span><span class="line"><span class="cl">qm <span class="nb">set</span> <span class="m">120</span> --sata0 local-lvm:vm-120-disk-0 --boot <span class="nv">order</span><span class="o">=</span>sata0   <span class="c1"># first boot without depending on virtio</span>
</span></span><span class="line"><span class="cl">qm <span class="nb">set</span> <span class="m">120</span> --bios ovmf --efidisk0 local-lvm:1                   <span class="c1"># only if the source was GPT/UEFI</span>
</span></span><span class="line"><span class="cl">qm <span class="nb">set</span> <span class="m">120</span> --cpu x86-64-v2-AES                                  <span class="c1"># do not use &#34;host&#34; with Windows</span>
</span></span><span class="line"><span class="cl">qm start <span class="m">120</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>Once it boots, install virtio-win, shut down, switch the disk to <code>virtio0</code> or <code>scsi0</code> with <code>virtio-scsi</code>, and boot again. The <a href="/en/posts/proxmox/windows-slow-cpu-type-host/"><code>host</code> CPU is slow with Windows</a>; that post explains why <code>x86-64-v2-AES</code>.</p>
<h3 id="if-it-does-not-boot">If it does not boot</h3>
<p>Windows usually recovers the boot from the installation ISO: <strong>Repair your computer → Command Prompt</strong>:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-cmd" data-lang="cmd"><span class="line"><span class="cl">bootrec /fixmbr
</span></span><span class="line"><span class="cl">bootrec /fixboot
</span></span><span class="line"><span class="cl">bcdboot C:\Windows
</span></span></code></pre></td></tr></table>
</div>
</div><p>On UEFI, <code>bcdboot C:\Windows /s S: /f UEFI</code> with the ESP mounted as <code>S:</code> (<code>diskpart</code> → <code>select disk 0</code>, <code>list partition</code>, <code>select partition 1</code>, <code>assign letter=S</code>).</p>
<h2 id="traps">Traps</h2>
<ul>
<li><strong>Do not mount the VHDX on the source machine</strong> if you plan to boot it: Windows changes its disk signature to avoid a clash with the original, and the BCD, which references disks by signature, stops finding the boot disk. It is the most important warning in the documentation.</li>
<li><strong>Two identical machines on the network</strong>: the VM is a clone with the same name, SID, and IP. Do not power both on at the same time on the same network, and if it is a domain member, decide which one stays.</li>
<li><strong>Activation</strong>: the hardware change triggers reactivation; OEM licenses are not transferable to a VM under Microsoft&rsquo;s terms.</li>
<li><strong>The 127 GB limit</strong> the documentation mentions is Virtual PC&rsquo;s; Hyper-V and KVM do not have it (VHDX goes up to 64 TB).</li>
<li><strong>Linux</strong> is not converted with this; there it is <code>dd</code>, Clonezilla, or <code>qemu-img</code> over the disk.</li>
</ul>
<h2 id="see-also">See also</h2>
<ul>
<li><a href="/en/posts/proxmox/windows-slow-cpu-type-host/">Windows slow on Proxmox with CPU host</a></li>
<li><a href="/en/posts/proxmox/cloud-image-templates/">cloud-init templates on Proxmox</a> — the opposite path: new VMs from an image</li>
</ul>
]]></content:encoded></item></channel></rss>