Page 2 of 2

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 26. May 2011, 10:27
by NeBlackCat
NeBlackCat wrote:Anyone know if it's possible to copy the vdfuse program from an OSE installation to a PUEL one, and use it to mount VHDs?
To answer my own question, yes it is. You just extract the single vdfuse executable from its distribution package (eg. virtualbox-ose-fuse.deb on Debian derivatives) into somewhere on the path of your PUEL system . It just seems to use VirtualBox's VBoxDDU.so library, which seems the same on both PUEL and OSE (as far as vdfuse is concerned anyway).

But I'm finding vlosetup (with its vloop.ko driver) from the VBoot project to be a far superior tool for mounting/manipulating virtual and raw disk image files independently of (or together with) VirtualBox.

Anyone else using that?

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 27. May 2011, 20:07
by tobermory
Can you expand on your use of vlosetup? I am looking to use vdfuse as a way of traversing/acquiring the 'dd image' inside a .vdi file. What makes vdfuse great is that Snapshot merges are transparent to the user. Can VBoot offer similar functionality?

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 27. May 2011, 23:47
by NeBlackCat
afaik vlosetup also supports snapshotted virtual disks, ie. you pass the snapshot and parent filenames together on the command line and get the whole thing. I haven't used that myself though. I don't think it can read .vbox files to automatically find parents if you only specify the child.

I just wanted a way to mount virtual and raw disk images in Linux, such that they worked like physical disks in all respects, including with the GUI disk management tools like Gnome Disk Utility and GParted (couldn't get vdfuse-mounted ones to do that).

What I liked about it was that the GUI tools work, it handles loop/partition mounting automatically, it can also create/resize virtual disks, it supports raw images (partition and full disk) as well as VDI/VHD/VMDK, and doesn't require VirtualBox to be installed for any of that.

So I can now standardise on VHD files as my imaging format of choice, and have the tools to manipulate them (including differenced images) on both Linux and Windows 7/Server hosts, as well as being able to boot into them on both physical (with VBoot and/or Windows 7) and virtual (with VirtualBox) machines. That is a first!

On the downside, the versions of kernels currently supported are limited. However the next version will apparently work in FUSE mode too. That is, if you have a supported kernel it works inside of it, otherwise it works in FUSE mode.

It seems to be mix of code from losetup, kpartx, vboxmanage, and virtualbox itself, all wrapped up into one. IIRC they're also planning to add more disk image related functionality from vboxmanage (eg. convertfromraw), and support encrypted images (within Truecrypt containers).

Here is the help:

Code: Select all

> vlosetup -h

Usage:
 vlosetup loop_device                             give info
 vlosetup -a | --all                              list all used
 vlosetup -d | --detach <loopdev> [<loopdev> ...] delete
 vlosetup -f | --find                             find unused
 vlosetup -c | --set-capacity <loopdev>           resize
 vlosetup -j | --associated <file> [-o <num>]     list all asso'ed with <file>

 vlosetup --createhd <filename>.vhd|.vdi|.vmdk --sizemeg <num of megabytes>
  create a new virtual diskfile of given megabytes, without setup to loopdev

 vlosetup --creatediff <diff_filename> <parent_filename> [<parent1_filename> <parent2_filename> ...] 
  create a differencing disk file to a base image or another differencing disk.

 vlosetup [ options ] {-f|--find|loopdev} <file>  setup a loopdev with file

Options:
 -h | --help              this help
 -o | --offset <num>      start at offset <num> into file
      --sizelimit <num>   loop limited to only <num> bytes of the file
 -p | --pass-fd <num>     read passphrase from file descriptor <num>
 -r | --read-only         setup read-only loop device
      --show              print device name (with -f <file>)
 -i | --immutable         mount disk as immutable, changes are discarded
 -v | --verbose           verbose mode

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 30. May 2011, 08:07
by kihjin
Kind of surprised that no one has noticed this, but vdfuse no longer works for 4.0.8 OSE AND it cannot be built. The VBoxHDD.h header file is gone, "vd.h" needs to be used instead. The VDCreate function takes another parameter, the VDTYPE, which you can use VDTYPE_HDD:

Line 267 Before: if (RT_FAILURE(VDCreate(&vdError, &hdDisk)))

Line 267 After: if (RT_FAILURE(VDCreate(&vdError, VDTYPE_HDD, &hdDisk)))

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 5. Jul 2011, 10:00
by fixedwheel
kihjin wrote:Kind of surprised that no one has noticed this, but vdfuse no longer works for 4.0.8 OSE AND it cannot be built. (...)
JFTR ...
http://packages.debian.org/virtualbox-fuse
http://packages.ubuntu.com/virtualbox-fuse

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 6. Jul 2011, 14:23
by StarNamer
As far as I can see, the vloop code from VMLite is not Open Source. In any event, they don't seem to have the source available for download and simply provide versions for Ubuntu (unless I just haven't found it).

Does an Open Source version exist? If so, where can I get it?

I've been mounting VHD disks under Windows 7 for some time when needing to fix/extract something and would like to be able to do the same thing under Linux (with all supported formats). I don't need/want the vboot capability, just the vloop driver. If an Open Source version doesn't exist, I may start looking as hacking something together... :)

Re: Discuss: Mount any VBox-compatible disk image on the hos

Posted: 28. Oct 2013, 16:52
by ChipMcK
StarNamer wrote:Does an Open Source version exist? If so, where can I get it?
refer to vdfuse

Best

Re: Discuss: Mount any VBox-compatible disk image on the hos

Posted: 11. Nov 2013, 17:43
by Emile
virtualbox-fuse has been removed from Debian testing/jessie. I asked the Debian package maintainer, it won't come back.

Re: Discuss: Mount any VBox-compatible disk image on the hos

Posted: 12. Nov 2013, 03:26
by ChipMcK
in the OSX Host forum, check out vdfuse.

The information may be of use.

Best

Re: Discuss: Mount any VBox-compatible disk image on the hos

Posted: 24. Nov 2014, 08:36
by Begun
subscribe

Re: Discuss: Mount any VBox-compatible disk image on the hos

Posted: 24. Nov 2014, 14:09
by ChipMcK
Begun wrote:subscribe
refer to Virtual Disk Mounting tools
Best

Re: Discuss: Mount any VBox-compatible disk image on the host

Posted: 22. Jul 2017, 21:40
by DdB
Wow!
I know, this thread is outdated by now, but it was an interesting read anyway.

If i was to solve a similar problem today, i would definitely not use tools, that have limitations (like the one restricted to primary partitions). Instead, i am using vboxes own code from the host via ssh -> guest, where i just attach and mount any vdi or snapshot thereof. Advantage: It is easy to play with this, snapshot, integrate, write to or read from anything, even filesystems, only the guest knows about (like zfs or such).

Still, i can sense some theoretical advantage to the use of compiled code, but it left me smiling to think of all the corner cases, that would not be handled properly.
And if space permits, even an entire copy of the logical contents of a VDI can easily be created as a readonly compressed image, which can in turn be mounted as a loop device, even separating partitions, that arent primary on the way.

Just saying: There are alternative solutions.