Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Nov 2011 09:34:20 +0100
From:      Harald Schmalzbauer <h.schmalzbauer@omnilan.de>
To:        freebsd-emulation@freebsd.org
Subject:   mount vdi on host
Message-ID:  <4ECCB00C.2090308@omnilan.de>
References:  CALBk6yJrHniVi8RoTGwLtqWF1nL1r8JZLKbS1mcLMw1DnxeofQ@mail.gmail.com

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig71249FD1A4A9263D413CB661
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

Hello,

I'm not subscribed, so I'm not sure this answer will make it onto the
list...

I found your thread "mount vdi on host" and was told about 'gnop' and
'VBoxManage internalcommands dumphdinfo'. That was the key to success,
so I'd like to answer the last question of the thread, when mounting
didn't work: "Any more idea" ... Yes

You forgot that md0.nop is the disk, not the filesystem. You probably
have partitions on it, so when it comes to 'mount' you have to use
/dev/md0nops1a for example (verified with md3.nops1 and mount_msdosfs).

Hope this helps and thanks for the post!

-Harry

Original thread, found via search engine at
http://lists.freebsd.org/pipermail/freebsd-emulation/2011-July/008995.htm=
l

--- On Mon, 7/25/11, Brandon Gooch <jamesbrandongooch at gmail.com> wrote=
:

From: Brandon Gooch <jamesbrandongooch at gmail.com>
Subject: Re: mount vdi
To: "Andrey V. Elsukov" <bu7cher at yandex.ru>
Cc: "Joe Sciulli" <jsciulli2003 at yahoo.com>, freebsd-emulation at
freebsd.org, nox at jelal.kn-bremen.de
Date: Monday, July 25, 2011, 4:31 PM

2011/7/25 Andrey V. Elsukov <bu7cher at yandex.ru>:
> On 25.07.2011 10:18, Joe Sciulli wrote:
>> Is it possible to mount virtualbox vdi file on the FreeBSD host?
This appears to be doable on
>> windows and linux hosts, which basically is done in two steps: 1.
find offset in the image. 2.
>> mount the image with that offset.
>>
>> I'm trying to do the same thing on FreeBSD, and found the
undocumented and deprecated command
>> still works:
>>
>> VBoxManage internalcommands dumphdinfo freebsd_home.vdi
>>
>> I got the following for the virtual disk image holding the /home (no
root hence no MBR) disk for
>> a FreeBSD guest:
>>
>> Header: offBlocks=3D4096 offData=3D28672
>>
>> Then attempt to mount it:
>>
>> mdconfig -a -t vnode -f /tmp/freebsd_home_56.vdi -u 0
mount /dev/md0 /tmp/aaa/
mount -t cd9660 /dev/md0 /tmp/aaa/
>>
>> unfortunately both the above two mount commands failed with "Invalid
argument".  I tried
>> skip=3D28672 to no avail as well.  Anything did I do wrong?
>
> I have not any Vbox images with fixed size, but i tried this:
> # mdconfig -f 10G_GPT_UFS.vdi
> # gnop create -v -o 41472 /dev/md0
>
> where 41472 is offData value. After that md0.nop was tasted and
reports about invalid GPT.
> So, i think if your image is fixed size disk yout can try this method
and mount UFS (not cd9660).
>
> --
> WBR, Andrey V. Elsukov

There was a CFT sent out a while back about a fuse module for mounting
vdi images:

http://lists.freebsd.org/pipermail/freebsd-emulation/2010-September/00796=
4.html

Not sure about the state of this now though...

-Brandon


Thanks for your replies.

I tried

mdconfig -f  freebsd_home.vdi
gnop create -v -o 28672 /dev/md0

Indeed /dev/md0.nop etc were created.  But mounting with the following
commands still yielded the dreaded "Invalid argument" error:

mount /dev/md0.nop /tmp/aaa/

mount -t ufs /dev/md0.nop /tmp/aaa/

One thing interesting is, in the gnop command, if I change 28672 to
anything else such as 28671 or 28673 or whatever, that gnop command
would fail with:

gnop: Invalid offset for provider md0.

so that suggests the offset is correct.  It's just that how to mount it.

The vdi is a variable size disk in virtualbox.  But I had shutdown
virtualbox and copied it to another file before mdconfig on it.

I looked closer at virtualbox-ose-fuse.shar Brandon linked, it appears
to be hardcoded to work with VirtualBox-3.2.8-OSE, while I only have
VBoxGuestAdditions_4.0.12 as in the ports tree.

Any more idea, thanks.



--------------enig71249FD1A4A9263D413CB661
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk7MsBgACgkQLDqVQ9VXb8i/ZQCfSoZA1QR2J1iuKJ4TbIxzmZ3k
d60AoLee9/eYuFzyuB1mWiBGReCZjENZ
=QhMO
-----END PGP SIGNATURE-----

--------------enig71249FD1A4A9263D413CB661--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ECCB00C.2090308>