Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lilumi/997123cf59510a1d17154fcf53f3dd28 to your computer and use it in GitHub Desktop.
Save lilumi/997123cf59510a1d17154fcf53f3dd28 to your computer and use it in GitHub Desktop.
Mount Azure VHD backup when on MacOS arm inside Docker

Run container:

docker run --rm -it \
  --cap-add SYS_ADMIN \
  --device /dev/fuse \
  --security-opt apparmor=unconfined \
  -v ~/Downloads/images:/images \
  ubuntu:24.04 bash

Inside the container (ARM64/aarch64):

apt update && \
apt install -y libguestfs-tools linux-image-virtual qemu-system-arm qemu-utils && \
export LIBGUESTFS_BACKEND=direct

mkdir -p /mnt/vhd && \
guestmount -a /images/abcd.vhd -i --ro /mnt/vhd

it will allow you to browse files in /mnt/vhd in read-only mode. If you want WRITE - simply omit --ro parameter.

ls /mnt/vhd/

Cleanly unmount

sync #when disk with WRITE permission
guestunmount /mnt/vhd

Use guestunmount (not umount) for FUSE mounts from libguestfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment