WORKAROUND 2026-04-27 ~5 min

Hyper-V Linux offline root reset via qemu-nbd

When passt-fronted libguestfs fails on Hyper-V

Note staged from memory. Full write-up landing soon. The outline below captures the gist — the lesson is real, the production incident is in the rear-view, the workaround works today.

You can't use virt-customize / libguestfs against Hyper-V .vhdx because passt networking fails. Use qemu-nbd on mc1desktop, operate on the base .vhdx (not .avhdx), btrfs Fedora needs subvol=root. id_rsa 1024-bit gets rejected by modern sshd — use ed25519.

The note

The situation

Hyper-V Gen2 Linux VM became unreachable. Need to inject a new SSH key or fix a config file offline without booting.

What doesn't work

virt-customize / libguestfs on the host fail with passt networking errors when the .vhdx is mounted from a Hyper-V parent.

The path that works

Copy the BASE .vhdx (not the .avhdx differential) to mc1desktop. Mount with `qemu-nbd --connect=/dev/nbd0 disk.vhdx`. For Fedora 42: the root subvolume is `subvol=root` (btrfs).

SSH key gotcha

My personal id_rsa is 1024-bit. Modern sshd rejects it. Inject an ed25519 public key instead.

Cleanup

Unmount, `qemu-nbd --disconnect`, copy the .vhdx back, restart the VM. Avoid touching .avhdx files — those are differential overlays that Hyper-V manages.

hyper-vkvmrecoverylinuxworkaround
All Field Notes