Page 5 of 13

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 26. Apr 2009, 06:30
by TerryE
Sorry, I'll do it tomorrow. I've been debugging some horrible utilities to automate a bunch of forum stuff. Alternately can't you just upload it as an attachment?

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 27. Apr 2009, 23:24
by rainbow.hippie
h2o wrote:Update 2/12/09: Use this, it's better http://forums.virtualbox.org/viewtopic. ... 9678#59678
1) Get the package nbd:
On Ubuntu:

Code: Select all

apt-get install nbd-client
2) Compile it
Download it, compile it with:

Code: Select all

gcc vdimount.c -o vdimount -pthread -l:/path/to/virtualbox/VBoxDD.so -Wl,-rpath,/path/to/virtualbox -I/path/to/includes/for/virtualbox
I've installed nbd-client and run '' gcc vdimount.c -o vdimount -pthread -l:/usr/lib/virtualbox/VBoxDD.so -Wl,-rpath,/usr/lib/virtualbox -I/usr/bin '' (according to my installation of VirtualBox).
It ends with following error message: '' gcc: vdimount.c: No such file or directory ''
I allready expected this error message, because how should gcc know of any vdimount.c ? I don't know where I could find this vdimount.c (I searched all /usr for this file, no where).

Anybody an idea?

Thanks, Ulrich

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 29. Apr 2009, 10:58
by mlafauci
Is it possible to mount the VDI file automatically at the system startup?
for example using /etc/fstab, etc.?

Thanks

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 10. May 2009, 03:15
by h2o
Sorry for making everyone wait; heres the next version!
vdfuse50.c
vdfuse v50
(22.34 KiB) Downloaded 1246 times

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 10. May 2009, 11:56
by stefan.becker
Works perfectly. Compile with no errors, mont XP and Windows 7 Images.

That *must* be a Feature of VBOX in the Original Version.

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 10. May 2009, 13:44
by TerryE
Thanks h2o. The attachment idea is far better than relying on me. Sorry. A fantasic job. Well done

Invalid arguments

Posted: 10. May 2009, 14:16
by rainbow.hippie
I've compiled vdfuse50.c without errors.
In /etc/fuse.conf, I have uncomment 'user_allow_other'
/dev/fuse has chmod 20666
/mnt/loop/ is rw for any user.

When I try to mount the DVI with following command: vdfuse -t VDI -v -f /media/sda2/VirtualBox/HardDisks/WindowsXP.vdi /mnt/loop/

I receive as error:
. fusermount:
. failed to open /etc/fuse.conf: Permission denied
. fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
Which is strange, since I've uncomment it.

When I try to do this as root, I get error message:
. Partition Size Offset
. ========= ==== ======

. Partition1 32256 10725732864


. fuse: mount failed: Invalid argument

Strange, isn't it?

Furthermore: does some HOWTO exist, where everything is explained?

Thanks for any help.

Re: Invalid arguments

Posted: 10. May 2009, 20:36
by h2o
rainbow.hippie wrote: . failed to open /etc/fuse.conf: Permission denied
Check the permissions on /etc/fuse.conf.

patch: **** malformed patch at line 16: @@ -104,7 +104,11 @@

Posted: 10. May 2009, 21:15
by rainbow.hippie
I changed the permissions of /etc/fuse.conf.

Now I can use vdfuse, which gives me two files: EntireDisk and Partition1. I have to use the latter, but then I receive the error:
# mount -o loop /mnt/loop/Partition1 /mnt/iso/ -t ntfs
/mnt/loop/Partition1: No such file or directory

I read on this thread that vdfuse.c has to be patched, but that fails with the error:
patch: **** malformed patch at line 16: @@ -104,7 +104,11 @@ (as allready was mentioned)
I use Kubuntu 8.10 (Linux)

:cry:

Re: (Loop) mount any VBox disk type (VDI,VMDK,VHD) on Host

Posted: 11. May 2009, 00:01
by h2o

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

Posted: 11. May 2009, 08:13
by rainbow.hippie
Yes, vdfuse50.c

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

Posted: 11. May 2009, 11:37
by TerryE
The latest version doesn't need patched. If you are mounting the VDI on /mnt/loop then what do you see when you do a
  • ls -l /mt/loop
    file /mnt/loop/Partition1

Partition1: No such file or directory SOLVED ?

Posted: 11. May 2009, 13:16
by rainbow.hippie
The problem seems to be solved (more or less).

I've vdfuse'd the VDI to another directory, and now I can mount Partition1.
The directory which fails AND the one which succedes are owned by the user (Ulrich) and have permissions set: dr-xr-xr-- (octal: 40554).
Partition1 in both directories has octal: 10644


ulrich@Phaedon:~$ ls -l /mnt/loop
insgesamt 20960109
-rw-r--r-- 1 ulrich ulrich 10737418240 2009-05-10 23:06 EntireDisk
-rw-r--r-- 1 ulrich ulrich 10725732864 2009-05-10 23:06 Partition1

ulrich@Phaedon:~$ file /mnt/loop/Partition1
/mnt/loop/Partition1: writable, regular file, no read permission

root@Phaedon:~# mount -o loop /mnt/loop/Partition1 /mnt/iso/ -t ntfs
/mnt/loop/Partition1: No such file or directory

Strange and important detail: when I try to open/read Partition1 with MC, I also receive a 'no such file or dierectory'.

Now I've vdfuse'd to /mnt/iso:
ulrich@Phaedon:~$ ls -l /mnt/iso
insgesamt 20960109
-rw-r--r-- 1 ulrich ulrich 10737418240 2009-05-11 12:58 EntireDisk
-rw-r--r-- 1 ulrich ulrich 10725732864 2009-05-11 12:58 Partition1

ulrich@Phaedon:~$ file /mnt/iso/Partition1
/mnt/iso/Partition1: x86 boot sector, Microsoft Windows XP Bootloader NTFS (german) (!!!!!!!!!!!!!!!!???!!!!!!!!!!!!!!!!!!!!!!)
Mounting as loop device works now.

Does vdfuse not like directories that are named 'loop'?

Mounting snapshots ?

Posted: 11. May 2009, 13:49
by rainbow.hippie
Is it also possible to mount snapshots this way?
I have a corrupt virtual machine, and would like to retrieve information that must be stored inside a snapshot.
When I try to do so, I receive as error: ERROR: opening vbox image failed

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

Posted: 12. May 2009, 05:20
by h2o
Unfortunately this version doesn't support snapshots. I have no idea why because I have no idea what a snapshot is composed of. Maybe Terry would know why...