Overview
Virtual hard disks (VHD/VHDX) from Hyper-V or backups can be mounted on Ubuntu for file recovery without booting Windows.
Tools include guestmount from libguestfs and losetup with partition offsets.
Implementation
Install libguestfs-tools. Inspect partitions: virt-filesystems -a disk.vhdx --all --long. Mount: guestmount -a disk.vhdx -m /dev/sda1 /mnt/vhd.
For fstab, use a UUID from the guest filesystem after loop-mounting the partition. Use nofail so boot is not blocked.
When implementing guidance from Mount (Automount) VHD partition in Ubuntu host, start in a controlled environment that mirrors production versions of operating systems, runtimes, and network policies. Capture a baseline before changes: export configs, snapshot VMs, or tag releases in source control so rollback stays straightforward if behavior regresses.
Document prerequisites, expected outcomes, and verification steps in a short runbook. Automated checks—smoke tests, health endpoints, or query validations—catch regressions early when platforms receive patches. Security belongs in every workflow: apply least privilege, rotate secrets, and review audit logs after deployment.
If results differ across machines, compare environment variables, permission models, time zones, and regional settings. Intermittent issues often trace to caching layers, stale DNS, or duplicated services bound to the same port.
Example
sudo guestmount -a /data/backup.vhdx -m /dev/sda1 /mnt/vhd
# /etc/fstab:
# /path/disk.vhdx /mnt/vhd vhd defaults,nofail 0 0
Tips
- VHDX needs recent libguestfs.
- Unmount before copying the VHD on Windows.
- Read-only mount protects evidence disks.
- Check ntfs-3g for NTFS partitions.
- Re-verify after reboots, certificate renewals, or failover exercises.
- Align monitoring and alerts with the failure modes described in this guide.
- Keep vendor documentation links handy for breaking changes between versions.
- Pair automation with a manual spot check during initial production rollout.