Accessing VirtualBox Disks
I was looking to directly access VirtualBox vdi
virtual disks without starting a virtual machine (VM).
Some nominal searching found the vboximg-mount
command. This is a Filesystem in Userspace (FUSE) mount tool for Linux and MacOS systems. The tool recognizes VirtualBox snapshots. The VirtualBox user manual contains a section about using the command.
To list all devices:
vboximg-mount --list
To list the attributes of a specific VM disk requires a full path or the disk UUID. Be sure not to confuse the VM UUID and disk UUID.
vboximg-mount --list --image /full/path/to/the.vdi vboximg-mount --list --image UUID
The output is like fdisk
.
With the output notice any parenthetical numbers in the partition column. Those numbers are important.
To mount the virtual disk, create two mount points.
“Mount” the vdi to the first mount point. This step is somewhat akin to BIOS AHCI hot plugging or using the rescan-sci-bus
command.
vboximg-mount --image /full/path/to/the.vdi /first/mountpoint
List the disk contents:
ls -la /first/mountpoint
The partitions will be labeled as vol[0-X]
where X
will match the previously noted parenthetical numbers.
Find the desired partition to mount using the parenthetical numbers in the list partition column.
Mount the desired partition:
mount /first/mountpoint/volX /second/mountpoint
By default the partition is mounted read-only and respective file date stamps do not change.
When finished browsing the partition contents, unmount the second mount point with umount
and the first mount point with fusermount -u
.
The user manual mentions a -p
parameter, but the option does not seem to work and vboximg-mount --help
does not mention the option.
Thus far I have been unable to successfuly use the read-write option. Any changes I made are not persistent after unmounting.
Virtualbox encryption and raw disks are not unsupported.
A potentially useful tool. I hope development continues and the read-write issues are resolved.
Posted: Usability Tagged: Virtual Machines
Category:Next: Updating Slackware — 6