Skip to content

Instantly share code, notes, and snippets.

@kotatsuyaki
Created August 29, 2022 16:19
Show Gist options
  • Save kotatsuyaki/13ced4b6cdb7357041f1b25446492922 to your computer and use it in GitHub Desktop.
Save kotatsuyaki/13ced4b6cdb7357041f1b25446492922 to your computer and use it in GitHub Desktop.
Mount VMware `vmdk` image on Linux

Tl;dr run this command to mount the second partition on fedora.vmdk to the mountpoint ./mnt.

guestmount -a fedora.vmdk -m /dev/sda2 --ro ./mnt

guestmount is part of libguestfs. In nixpkgs, use libguestfs-with-appliance instead of libguestfs, since the latter produces the following error. See NixOS/nixpkgs#37540 for details.

libguestfs: error: cannot find any suitable libguestfs supermin, fixed or old-style appliance on LIBGUESTFS_PATH (search path: /nix/store/c2q57gv3kxl0pvwbdjc8hpqpvykl6n4g-libguestfs-1.48.4/lib/guestfs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment