Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2011 17:52:19 -0700 (PDT)
From:      Joe Sciulli <jsciulli2003@yahoo.com>
To:        freebsd-emulation@freebsd.org
Subject:   Re: mount vdi on host
Message-ID:  <1311641539.51211.YahooMailClassic@web122305.mail.ne1.yahoo.com>
In-Reply-To: <CALBk6yJrHniVi8RoTGwLtqWF1nL1r8JZLKbS1mcLMw1DnxeofQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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

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

2011/7/25 Andrey V. Elsukov <bu7cher@yandex.ru>:
> On 25.07.2011 10:18, Joe Sciulli wrote:
>> Is it possible to mount virtualbox vdi file on the FreeBSD host? =A0This=
 appears to be doable on
>> windows and linux hosts, which basically is done in two steps: 1. find o=
ffset in the image. 2.
>> mount the image with that offset.
>>
>> I'm trying to do the same thing on FreeBSD, and found the undocumented a=
nd deprecated command
>> still works:
>>
>> VBoxManage internalcommands dumphdinfo freebsd_home.vdi
>>
>> I got the following for the virtual disk image holding the /home (no roo=
t 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=20
mount /dev/md0 /tmp/aaa/=20
mount -t cd9660 /dev/md0 /tmp/aaa/
>>
>> unfortunately both the above two mount commands failed with "Invalid arg=
ument". =A0I tried
>> skip=3D28672 to no avail as well. =A0Anything 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 a=
bout 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/007964.=
html

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

-Brandon
=0A
Thanks for your replies.=A0=20

I tried=20

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

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

mount /dev/md0.nop /tmp/aaa/=20
=0Amount -t ufs /dev/md0.nop /tmp/aaa/

One thing interesting is, in the gnop command, if I change 28672 to anythin=
g else such as 28671 or 28673 or whatever, that gnop command would fail wit=
h:

gnop: Invalid offset for provider md0.

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

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

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

Any more idea, thanks.



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