Skip to content

Instantly share code, notes, and snippets.

@otaviosoares
Last active November 4, 2016 23:42
Show Gist options
  • Select an option

  • Save otaviosoares/529fd90e2c317fd1ab73872af3c0c6e0 to your computer and use it in GitHub Desktop.

Select an option

Save otaviosoares/529fd90e2c317fd1ab73872af3c0c6e0 to your computer and use it in GitHub Desktop.
Mount VHD
Using Ubuntu 15.10, you can install vhdimount and tsk (The Sleuth Kit) via:
sudo apt-get install libvhdi-utils sleuthkit
Then you can proceed as follows:
sudo mkdir -v /mnt/vhd
sudo vhdimount -X allow_root /path/to/file.vhd /mnt/vhd/
sudo mmls -aB /mnt/vhd/vhdi1
Next, you'll have to calculate the offset from the output of mmls like this:
echo offset*512 | bc
And to finish:
sudo mkdir -v /media/${USER}/your/folder
sudo mount -vt ntfs-3g -o ro,noload,offset=offset-found /mnt/vhd/vhdi1 /media/${USER}/your/folder
Replace offset-found by your offset. You may also have to change the fs-type according to the fs-type included in your vhd file.
I've made a script so I don't have to type this every time ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment