5.11. vboximg-mount: A Utility for FUSE Mounting a Virtual Disk Image

vboximg-mount is a command line utility for Mac OS and Linux hosts that provides raw access to an Oracle VM VirtualBox virtual disk image on the host system. Use this utility to mount, view, and optionally modify the disk image contents.

The utility is based on Filesystem in Userspace (FUSE) technology and uses the VirtualBox runtime engine. Ensure that Oracle VM VirtualBox is running on the host system.

Note

When using vboximg-mount, ensure that the following conditions apply:

  • The disk image is not being used by any other systems, such as by guest VMs.

  • No VMs are running on the host system.

Raw access using FUSE is preferred over direct loopback mounting of virtual disk images, because it is snapshot aware. It can selectively merge disk differencing images in an exposed virtual hard disk, providing historical or up-to-date representations of the virtual disk contents.

vboximg-mount enables you to view information about registered VMs, their attached disk media, and any snapshots. Also, you can view partition information for a disk image.

The vboximg-mount command includes experimental read-only access to file systems inside a VM disk image. This feature enables you to extract some files from the disk image without starting the VM and without requiring third-party file system drivers on the host system. FAT, NTFS, ext2, ext3, and ext4 file systems are supported.

Use the --help option to view information about the vboximg-mount command usage. The complete command reference is described in Section 7.48, “vboximg-mount”.

When vboximg-mount mounts an Oracle VM VirtualBox disk image, it creates a one level deep file system at a mount point that you specify. The file system includes a device node that represents the synthesized disk image as a readable or readable-writeable bytestream. This bytestream can be mounted either by using the host OS or by using other FUSE-based file systems.

5.11.1. Viewing Detailed Information About a Virtual Disk Image

The following examples show how to use the vboximg-mount command to view information about virtual disk images.

The following command outputs detailed information about all registered VMs and associated snapshots:

$ vboximg-mount --list --verbose
    
    ------------------------------------------------------
    VM Name:   "macOS High Sierra 10.13"
    UUID:      3887d96d-831c-4187-a55a-567c504ff0e1
    Location:  /Volumes/work/vm_guests/macOS High Sierra 10.13/macOS High Sierra 10.13.vbox
       -----------------------
       HDD base:   "macOS High Sierra 10.13.vdi"
       UUID:       f9ea7173-6869-4aa9-b487-68023a655980
       Location:   /Volumes/work/vm_guests/macOS High Sierra 10.13/macOS High Sierra 10.13.vdi

         Diff 1:
              UUID:       98c2bac9-cf37-443d-a935-4e879b70166d
              Location:   /Volumes/work/vm_guests/macOS High Sierra 10.13/
              Snapshots/{98c2bac9-cf37-443d-a935-4e879b70166d}.vdi
         Diff 2:
              UUID:       f401f381-7377-40b3-948e-3c61241b1a42
              Location:   /Volumes/work/vm_guests/macOS High Sierra 10.13/
              Snapshots/{f401f381-7377-40b3-948e-3c61241b1a42}.vdi
       -----------------------
       HDD base:   "simple_fixed_disk.vdi"
       UUID:       ffba4d7e-1277-489d-8173-22ca7660773d
       Location:   /Volumes/work/vm_guests/macOS High Sierra 10.13/simple_fixed_disk.vdi

         Diff 1:
              UUID:       aecab681-0d2d-468b-8682-93f79dc97a48
              Location:   /Volumes/work/vm_guests/macOS High Sierra 10.13/
              Snapshots/{aecab681-0d2d-468b-8682-93f79dc97a48}.vdi
         Diff 2:
              UUID:       70d6b34d-8422-47fa-8521-3b6929a1971c
              Location:   /Volumes/work/vm_guests/macOS High Sierra 10.13/
              Snapshots/{70d6b34d-8422-47fa-8521-3b6929a1971c}.vdi
      ------------------------------------------------------
      VM Name:   "debian"
      UUID:      5365ab5f-470d-44c0-9863-dad532ee5905
      Location:  /Volumes/work/vm_guests/debian/debian.vbox
         -----------------------
         HDD base:   "debian.vdi"
         UUID:       96d2e92e-0d4e-46ab-a0f1-008fdbf997e7
         Location:   /Volumes/work/vm_guests/debian/ol7.vdi

            Diff 1:
                UUID:       f9cc866a-9166-42e9-a503-bbfe9b7312e8
                Location:   /Volumes/work/vm_guests/debian/Snapshots/
                {f9cc866a-9166-42e9-a503-bbfe9b7312e8}.vdi

The following command outputs partition information about the specified disk image:

$ vboximg-mount --image=f9ea7173-6869-4aa9-b487-68023a655980 --list 
    
    Virtual disk image:

       Path: /Volumes/work/vm_guests/macOS High Sierra 10.13/macOS High Sierra 10.13.vdi
       UUID: f9ea7173-6869-4aa9-b487-68023a655980
       
      #     Start  Sectors     Size       Offset  Type                                  
      1        40  409599    199.9M        20480  EFI System                            
      2    409640  67453071   32.1G    209735680  Hierarchical File System Plus (HFS+)  
      3  67862712  1269535   107.8M  34745708544  Apple Boot (Recovery HD)

5.11.2. Mounting a Virtual Disk Image

The following steps show how to use the vboximg-mount command to mount a partition of a virtual disk image on the host OS.

  1. Create a mount point on the host OS. For example:

    $ mkdir macos_sysdisk
  2. Show partition information about the virtual disk image.

    $ vboximg-mount --image=uuid --list

    where uuid is the UUID of the disk image.

  3. Use vboximg-mount to perform a FUSE mount of a partition on the virtual disk image. For example:

    $ vboximg-mount --image=uuid -p 2 macos_sysdisk

    where uuid is the UUID for the disk image.

    In this example, partition 2 is mounted on the macos_sysdisk mount point. The mount includes all snapshots for the disk image.

  4. Use the host OS to mount the vhdd device node. The FUSE-mounted device node represents the virtual disk image.

    $ ls macos_sysdisk
       macOS High Sierra 10.13.vdi  vhdd
    $ sudo mount macos_sysdisk/vhdd /mnt