Grupos de Google ya no admite nuevas publicaciones ni suscripciones de Usenet. El contenido anterior sigue siendo visible.

Mounting VirtualBox vdi files

Visto 596 veces
Saltar al primer mensaje no leído

Warren Block

no leída,
5 jul 2010, 22:58:585/7/10
a
Is there any hope of a utility like mdconfig that would allow mounting a
vdi file directly?

There's a tantalizingly-named ImageMounter/VBoxFUSE, which is probably
not what that implies.

It would be great to be able to access vdi files without having to
waste time and space converting them to raw image files.
_______________________________________________
freebsd-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "freebsd-emulat...@freebsd.org"

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-...@muc.de

Wilkinson, Alex

no leída,
5 jul 2010, 23:20:575/7/10
a

0n Mon, Jul 05, 2010 at 08:58:58PM -0600, Warren Block wrote:

>Is there any hope of a utility like mdconfig that would allow mounting a
>vdi file directly?
>
>There's a tantalizingly-named ImageMounter/VBoxFUSE, which is probably
>not what that implies.
>
>It would be great to be able to access vdi files without having to
>waste time and space converting them to raw image files.

Try: http://libguestfs.org/

-Alex

IMPORTANT: This email remains the property of the Department of Defence and is subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have received this email in error, you are requested to contact the sender and delete the email.

Adam Vande More

no leída,
5 jul 2010, 23:20:235/7/10
a
On Mon, Jul 5, 2010 at 9:58 PM, Warren Block <wbl...@wonkity.com> wrote:

> Is there any hope of a utility like mdconfig that would allow mounting a
> vdi file directly?
>
> There's a tantalizingly-named ImageMounter/VBoxFUSE, which is probably not
> what that implies.
>
> It would be great to be able to access vdi files without having to waste
> time and space converting them to raw image files.
>

Not that I'm aware of, all tools that do so depend on having a fixed size
image.

You could use a sparse file for the raw format :P I use some other methods
for getting data from VM's to host and other machines. One place I do work
for is a linux shop with a couple Win 2k8 VM's. All disk's are mapped to
LVM's including 2k8's "dedicated" backup drive. The backup drive(lvm) is
then mapped via kpartx and mounted read-only in the host system so tarsnap
archives can be generated against it. I actually don't know how you'd do
this under FreeBSD since I'm not aware of any equivalent functionality to
kpartx under FBSD.

--
Adam Vande More

Adam Vande More

no leída,
5 jul 2010, 23:21:485/7/10
a
On Mon, Jul 5, 2010 at 10:20 PM, Adam Vande More <amvan...@gmail.com>wrote:

> On Mon, Jul 5, 2010 at 9:58 PM, Warren Block <wbl...@wonkity.com> wrote:
>

>> Is there any hope of a utility like mdconfig that would allow mounting a
>> vdi file directly?
>>
>> There's a tantalizingly-named ImageMounter/VBoxFUSE, which is probably not
>> what that implies.
>>
>> It would be great to be able to access vdi files without having to waste
>> time and space converting them to raw image files.
>>
>

> Not that I'm aware of, all tools that do so depend on having a fixed size
> image.
>
> You could use a sparse file for the raw format :P I use some other methods
> for getting data from VM's to host and other machines. One place I do work
> for is a linux shop with a couple Win 2k8 VM's. All disk's are mapped to
> LVM's including 2k8's "dedicated" backup drive. The backup drive(lvm) is
> then mapped via kpartx and mounted read-only in the host system so tarsnap
> archives can be generated against it. I actually don't know how you'd do
> this under FreeBSD since I'm not aware of any equivalent functionality to
> kpartx under FBSD.
>

Actually just had another idea if you're using ZFS. Just put the raw image
on it's on FS, and set it compressed. Problem solved ;)

--
Adam Vande More

Kyryll A Mirnenko aka Mirya

no leída,
6 jul 2010, 11:01:516/7/10
a
If you're creating the VM from scratch, you may use raw file-backed disk image
along with VMDK format wrapper. You may create a sparse file

# truncate -s 2G img

or a preallocated one

# dd if=/dev/zero of=img bs=1m count=2048

, then create a character device for it

# mdconfig -a -t vnode -f img -u 4

, and wrap it with a vmdk container

# VBoxManage internalcommands createrawvmdk -filename
Img.vmdk -rawdisk /dev/md4

After that you may use Img.vmdk as any other disk image in VirtualBox, and
mount /dev/md4* from the host machine. Just remember you'll need to run
mdconfig after reboot, the md* devices are not preserved magically, and
umount /dev/md4* before starting VBox.
That's how i work with -current FreeBSD snapshots - they're cross-compiled and
cross-installed in the host system (which is faster), then run in the VBox.
--
Regards, Mirya
ICQ #313898202

Juergen Lock

no leída,
2 sept 2010, 16:24:312/9/10
a
(Yes this thread is a bit old but now I may have a solution...)

In article <20100706032...@stlux503.dsto.defence.gov.au> you write:
> 0n Mon, Jul 05, 2010 at 08:58:58PM -0600, Warren Block wrote:
>

> >Is there any hope of a utility like mdconfig that would allow mounting a
> >vdi file directly?
> >
> >There's a tantalizingly-named ImageMounter/VBoxFUSE, which is probably
> >not what that implies.
> >
> >It would be great to be able to access vdi files without having to
> >waste time and space converting them to raw image files.
>

>Try: http://libguestfs.org/

Well that looks like major work to port, but there is a much simpler
fusefs tool in debian called vdfuse that I now finally made a port
of. I don't know how stable this is on FreeBSD or if there still
may be bugs, so please give this a good test and post your results
here. Here's a simple example:

# vdfuse -r -f ~nox/.VirtualBox/HardDisks/win7-64.vdi /mnt
# mdconfig -a -f /mnt/Partition2 -o readonly
md0
# mount -o ro -t ntfs /dev/md0 /mnt2
# ls -l /mnt2
...
# umount /mnt2
# mdconfig -d -u 0
# umount /mnt

I was also able to write onto ntfs using sysutils/fusefs-ntfs, tho
I had to apply a fix to sysutils/fusefs-kmod from this PR first to
get rid of a panic:

http://www.freebsd.org/cgi/query-pr.cgi?pr=149674

# vdfuse -a -f ~nox/.VirtualBox/HardDisks/win7-64.vdi /mnt
# mdconfig -a -f /mnt/EntireDisk
# ntfs-3g /dev/md0s2 /mnt2
# ls -l /mnt2
...

Of course only do any of this while the guest is completely shut
down... (That's because at least all the `regular' filesystems
cannot be mounted more than once at a time or you'll get corruption.)

And here is the shar:

http://people.freebsd.org/~nox/tmp/virtualbox-ose-fuse.shar

Happy testing! :)
Juergen

Warren Block

no leída,
8 sept 2010, 21:44:378/9/10
a
On Thu, 2 Sep 2010, Juergen Lock wrote:

> ...there is a much simpler fusefs tool in debian called vdfuse that I

> now finally made a port of. I don't know how stable this is on
> FreeBSD or if there still may be bugs, so please give this a good test
> and post your results here. Here's a simple example:
>
> # vdfuse -r -f ~nox/.VirtualBox/HardDisks/win7-64.vdi /mnt
> # mdconfig -a -f /mnt/Partition2 -o readonly
> md0
> # mount -o ro -t ntfs /dev/md0 /mnt2
> # ls -l /mnt2
> ...
> # umount /mnt2
> # mdconfig -d -u 0
> # umount /mnt

It works for a .vdi of a UFS drive. The BSD partitions show up on the
md0 device (md0a, etc). Just a trivial test, but looks promising!

Juergen Lock

no leída,
13 sept 2010, 17:14:0113/9/10
a
On Sat, Sep 11, 2010 at 01:06:24PM -0600, Warren Block wrote:
> On Sat, 11 Sep 2010, Juergen Lock wrote:

>
> > On Wed, Sep 08, 2010 at 07:44:37PM -0600, Warren Block wrote:
> >> On Thu, 2 Sep 2010, Juergen Lock wrote:
> >>
> >>> ...there is a much simpler fusefs tool in debian called vdfuse that I

> >>> now finally made a port of. I don't know how stable this is on
> >>> FreeBSD or if there still may be bugs, so please give this a good test
> >>> and post your results here. Here's a simple example:
> >>>
> >>> # vdfuse -r -f ~nox/.VirtualBox/HardDisks/win7-64.vdi /mnt
> >>> # mdconfig -a -f /mnt/Partition2 -o readonly
> >>> md0
> >>> # mount -o ro -t ntfs /dev/md0 /mnt2
> >>> # ls -l /mnt2
> >>> ...
> >>> # umount /mnt2
> >>> # mdconfig -d -u 0
> >>> # umount /mnt
> >>
> >> It works for a .vdi of a UFS drive. The BSD partitions show up on the
> >> md0 device (md0a, etc). Just a trivial test, but looks promising!
> >
> > Yep, those kind of tests worked for me too, I just wasn't sure if it
> > also survives `heavy use', i.e. reading/writing/using files much on
> > the mounted fs.es...
>
> Dumping the partitions of that FreeBSD system worked just now. Not what
> I'd call a thorough test, but it did read everything in the filesystem
> without problems.

Ok that sounds promising... Someone want to do more tests or should I
just commit the port? :)

Thanx,

Warren Block

no leída,
14 sept 2010, 15:21:2614/9/10
a
On Tue, 14 Sep 2010, Warren Block wrote:

> On Mon, 13 Sep 2010, Juergen Lock wrote:
>>>
>>> Dumping the partitions of that FreeBSD system worked just now. Not what
>>> I'd call a thorough test, but it did read everything in the filesystem
>>> without problems.
>>
>> Ok that sounds promising... Someone want to do more tests or should I
>> just commit the port? :)
>

> Testing writes has not been as successful. fdisk and bsdlabel work fine, as
> does writing individual files. But trying to restore onto a vdfuse/mdconfig
> partition just goes away. The machine is idle, restore waits in wdrain, and
> further access to that device does not respond. I think I saw fuse in a
> fuse_msg state, but can't verify that now.

Further information: copying a single file onto the mounted filesystem
works. More than one, with restore or just cp, and vdfuse and the
copying process go to wdrain forever.

Warren Block

no leída,
14 sept 2010, 15:00:1914/9/10
a
On Mon, 13 Sep 2010, Juergen Lock wrote:
>>
>> Dumping the partitions of that FreeBSD system worked just now. Not what
>> I'd call a thorough test, but it did read everything in the filesystem
>> without problems.
>
> Ok that sounds promising... Someone want to do more tests or should I
> just commit the port? :)

Testing writes has not been as successful. fdisk and bsdlabel work

fine, as does writing individual files. But trying to restore onto a
vdfuse/mdconfig partition just goes away. The machine is idle, restore
waits in wdrain, and further access to that device does not respond. I
think I saw fuse in a fuse_msg state, but can't verify that now.

That was all before applying the fusefs-kmod patch; now other processes
also stop responding.

In any case, I'd rather have a port that is not 100% than no port at
all. Announcing possible problems in the pkg-message would be
appropriate.

Juergen Lock

no leída,
15 sept 2010, 13:01:0015/9/10
a
On Tue, Sep 14, 2010 at 01:21:26PM -0600, Warren Block wrote:
> On Tue, 14 Sep 2010, Warren Block wrote:
>
> > On Mon, 13 Sep 2010, Juergen Lock wrote:
> >>>
> >>> Dumping the partitions of that FreeBSD system worked just now. Not what
> >>> I'd call a thorough test, but it did read everything in the filesystem
> >>> without problems.
> >>
> >> Ok that sounds promising... Someone want to do more tests or should I
> >> just commit the port? :)
> >
> > Testing writes has not been as successful. fdisk and bsdlabel work fine, as
> > does writing individual files. But trying to restore onto a vdfuse/mdconfig
> > partition just goes away. The machine is idle, restore waits in wdrain, and
> > further access to that device does not respond. I think I saw fuse in a
> > fuse_msg state, but can't verify that now.
>
> Further information: copying a single file onto the mounted filesystem
> works. More than one, with restore or just cp, and vdfuse and the
> copying process go to wdrain forever.

Hm ok... Which FreeBSD version was this btw?

Thanx, :)
Juergen

Juergen Lock

no leída,
15 sept 2010, 12:59:0115/9/10
a
On Tue, Sep 14, 2010 at 08:11:35PM -0500, Brandon Gooch wrote:

> On Mon, Sep 13, 2010 at 4:14 PM, Juergen Lock <n...@jelal.kn-bremen.de> wrote:
> > On Sat, Sep 11, 2010 at 01:06:24PM -0600, Warren Block wrote:
> >> On Sat, 11 Sep 2010, Juergen Lock wrote:
> >>
> >> > On Wed, Sep 08, 2010 at 07:44:37PM -0600, Warren Block wrote:
> >> >> On Thu, 2 Sep 2010, Juergen Lock wrote:
> >> >>
> >> >>> ...there is a much simpler fusefs tool in debian called vdfuse that I

> >> >>> now finally made a port of.  I don't know how stable this is on
> >> >>> FreeBSD or if there still may be bugs, so please give this a good test
> >> >>> and post your results here.  Here's a simple example:
> >> >>>
> >> >>>   # vdfuse -r -f ~nox/.VirtualBox/HardDisks/win7-64.vdi /mnt
> >> >>>   # mdconfig -a -f /mnt/Partition2 -o readonly
> >> >>>   md0
> >> >>>   # mount -o ro -t ntfs /dev/md0 /mnt2
> >> >>>   # ls -l /mnt2
> >> >>>   ...
> >> >>>   # umount /mnt2
> >> >>>   # mdconfig -d -u 0
> >> >>>   # umount /mnt
> >> >>
> >> >> It works for a .vdi of a UFS drive.  The BSD partitions show up on the
> >> >> md0 device (md0a, etc).  Just a trivial test, but looks promising!
> >> >
> >> > Yep, those kind of tests worked for me too, I just wasn't sure if it
> >> > also survives `heavy use', i.e. reading/writing/using files much on
> >> > the mounted fs.es...
> >>
> >> Dumping the partitions of that FreeBSD system worked just now.  Not what
> >> I'd call a thorough test, but it did read everything in the filesystem
> >> without problems.
> >
> > Ok that sounds promising...  Someone want to do more tests or should I
> > just commit the port? :)
>
> During my first (and only) testing session, I wasn't able to mount the
> md(4) device after I created it. Further, after a few attempts each
> time, vdfuse would segfault.
>
> Image was form Windows XP 32-bit (1 Partition, NTFS).
>
Did you use the correct partition? And did you try ntfs-3g or just
the in-kernel (readonly) ntfs? Also which FreeBSD version was this?

> I'm in the process of rebuilding my system ATM (kernel, world, and
> ports), but I will test further when I'm back up again...

Ok that should be interesting then.

Thanx, :)

Warren Block

no leída,
15 sept 2010, 15:45:5215/9/10
a
On Wed, 15 Sep 2010, Juergen Lock wrote:

> On Tue, Sep 14, 2010 at 01:21:26PM -0600, Warren Block wrote:
>> On Tue, 14 Sep 2010, Warren Block wrote:
>>

>>> On Mon, 13 Sep 2010, Juergen Lock wrote:
>>>>>
>>>>> Dumping the partitions of that FreeBSD system worked just now. Not what
>>>>> I'd call a thorough test, but it did read everything in the filesystem
>>>>> without problems.
>>>>
>>>> Ok that sounds promising... Someone want to do more tests or should I
>>>> just commit the port? :)
>>>
>>> Testing writes has not been as successful. fdisk and bsdlabel work fine, as
>>> does writing individual files. But trying to restore onto a vdfuse/mdconfig
>>> partition just goes away. The machine is idle, restore waits in wdrain, and
>>> further access to that device does not respond. I think I saw fuse in a
>>> fuse_msg state, but can't verify that now.
>>

>> Further information: copying a single file onto the mounted filesystem
>> works. More than one, with restore or just cp, and vdfuse and the
>> copying process go to wdrain forever.
>
> Hm ok... Which FreeBSD version was this btw?

8.1-stable as of Monday, 32-bit i386.

Brandon Gooch

no leída,
14 sept 2010, 21:11:3514/9/10
a
On Mon, Sep 13, 2010 at 4:14 PM, Juergen Lock <n...@jelal.kn-bremen.de> wrote:
> On Sat, Sep 11, 2010 at 01:06:24PM -0600, Warren Block wrote:
>> On Sat, 11 Sep 2010, Juergen Lock wrote:
>>
>> > On Wed, Sep 08, 2010 at 07:44:37PM -0600, Warren Block wrote:
>> >> On Thu, 2 Sep 2010, Juergen Lock wrote:
>> >>
>> >>> ...there is a much simpler fusefs tool in debian called vdfuse that I

>> >>> now finally made a port of.  I don't know how stable this is on
>> >>> FreeBSD or if there still may be bugs, so please give this a good test
>> >>> and post your results here.  Here's a simple example:
>> >>>
>> >>>   # vdfuse -r -f ~nox/.VirtualBox/HardDisks/win7-64.vdi /mnt
>> >>>   # mdconfig -a -f /mnt/Partition2 -o readonly
>> >>>   md0
>> >>>   # mount -o ro -t ntfs /dev/md0 /mnt2
>> >>>   # ls -l /mnt2
>> >>>   ...
>> >>>   # umount /mnt2
>> >>>   # mdconfig -d -u 0
>> >>>   # umount /mnt
>> >>
>> >> It works for a .vdi of a UFS drive.  The BSD partitions show up on the
>> >> md0 device (md0a, etc).  Just a trivial test, but looks promising!
>> >
>> > Yep, those kind of tests worked for me too, I just wasn't sure if it
>> > also survives `heavy use', i.e. reading/writing/using files much on
>> > the mounted fs.es...
>>
>> Dumping the partitions of that FreeBSD system worked just now.  Not what
>> I'd call a thorough test, but it did read everything in the filesystem
>> without problems.
>
> Ok that sounds promising...  Someone want to do more tests or should I
> just commit the port? :)

During my first (and only) testing session, I wasn't able to mount the


md(4) device after I created it. Further, after a few attempts each
time, vdfuse would segfault.

Image was form Windows XP 32-bit (1 Partition, NTFS).

I'm in the process of rebuilding my system ATM (kernel, world, and


ports), but I will test further when I'm back up again...

-Brandon

Juergen Lock

no leída,
15 sept 2010, 14:08:3715/9/10
a
On Tue, Sep 14, 2010 at 01:00:19PM -0600, Warren Block wrote:
>[...]

> In any case, I'd rather have a port that is not 100% than no port at
> all. Announcing possible problems in the pkg-message would be
> appropriate.

Well if we can establish that readonly works consistently at least
for `some' versions of FreeBSD then that might be an option.

Thanx,
Juergen

0 mensajes nuevos