Search This Blog

Thursday, June 27, 2013

Mounting VHD Image file in Linux

Back again,

So i have been playing around with so called VHD based image for a while. Here came the requirement, where i needed to mount this image and push in some keys... This is the solution i found

Step 1: Install the virtualbox fuse package which is required to open up this vhd image into its raw form

# apt-get install virtualbox-fuse

Step 2: Open up VHD image

# vdfuse -w -f <path to vhd image> <path to mount point>

Step 3: Check the extracted Files

# ls <path to mount point>

Here it could list either 

# EntireDisk

Lets mark this CASE 1


# EntireDisk Partition1 Partion2 . ...

Depending on the number of partitions made on the Disk while creating and lets mark this as CASE 2

Step 4: Mount the extracted RAW image

# mount <path to vhd image>/EntireDisk <path to one more new mount point path>

In case of CASE 1


# mount <path to vhd image>/Partition1 <path to one more new mount point>

In case of CASE 2
Partition here could be the one you wanted to mount

Step 5: unmounting the IMG and VHD after usage

# umount <path to mounted IMG partition>

# umount <path to vhd image>

Hope this is useful for all of you who see this :)