How to open a VHD or VHDx file in Linux
VHD or VHDx (newer version) is a Virtual Hard Disk file format used by Microsoft’s Hyper-V. To Open a VHD disk on Ubuntu, you can use guestmount command.
To install guestmount, run command
1 |
apt-get install libguestfs-tools |
To see list of partiions available in a VHD/VHDx file, you can run
1 |
virt-list-partitions FILE_NAME.vhdx |
Example
1 2 3 4 |
root@ip-172-30-1-114:/mnt# virt-list-partitions srv-kirikas-storage.vhdx /dev/sda1 /dev/sda2 root@ip-172-30-1-114:/mnt# |
To mount a partition, run
1 |
guestmount -a srv-kirikas-storage.vhdx -m DEVICE --ro MOUNT_POINT |
Example
1 2 3 |
root@ip-172-30-1-114:/mnt# mkdir /vhdx/ root@ip-172-30-1-114:/mnt# guestmount -a srv-kirikas-storage.vhdx -m /dev/sda2 --ro /vhdx/ root@ip-172-30-1-114:/mnt# |
In above example /vhdx is mount point, you need to create an empty folder before mounting.
See mount