Florin Andrei wrote:
Brian J. Murrell wrote:
On Tue, 2009-09-29 at 14:21 -0700, Florin Andrei wrote:
I want to use VBox to test a distributed filesystem, but it won't let me launch two virtual machines sharing the same virtual volume (data volume, not root; root is separate). Is there a way around this issue?

The last time I wanted to do this (to test Lustre, which also wants to
share block devices) I had to use the VMDK disk format as opposed to the
VDI format.  I think there is documentation floating around on how to
make a VMDK shared.

Are you sure it was VirtualBox?

I had a .vmdk floating around, which I attached to both machines. Booted one of them, could access the .vmdk just fine, launched fdisk, deleted some partitions, all was good.

Then tried to launch the other machine, but it failed with "locked for writing by another task". :-(

Googled for virtual volume sharing between machines, no luck.

I'm out of ideas (besides switching to VMware).


Seems I need to give the necessary hints, as the person who already mentioned that one can make it work didn't provide details.

As everyone noticed, VirtualBox is pretty paranoid about image locking, and as such the lock checks can't be prevented. There is a way to fool the checks however.

The easiest way is if you have a dedicated physical disk which should store the data - you can just create two separate "raw disk VMDKs" (see section 9.10 of the manual), both referring to the same device attached to the host drive. Assign the first one to the first VM, and the second to the other VM.

There's another way using file-backed images, but that requires a bit of VMDK file editing. Create two flat VMDK images (works with VirtualBox command line tools for quite some time now), and edit the descriptor file of the second to refer to the data file of the first (you can delete the data file of the second).

Both ways will result in two "images" giving access to the same storage. No guarantees that this will work on Windows host, as file locking on that platform adds additional complexity.

Klaus


_______________________________________________
vbox-users mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-users

Reply via email to