8

I am trying to use a virtualbox hard drive over several computers using dropbox (a popular cloud tool) synchronization. I assume no two machines will open the same drive at the same time.

To reduce data transfers, I'd like to use only a differential of my hard drive that will store only a small volume of "documents", not syncing the whole hard drive (I don't trust Dropbox differential synchronization to be very effective). Using this official VirtualBox documentation, I made the following trick that only partly satisfies me.

  • Build up a differential drive with a trick:
    • Make the drive multiattach (see above documentation)
    • Make a simple change to the drive on the guest, that will create a diff file
  • Restore (using the VBox Media Manager, File > Virtual Media Manager) the base drive to "normal" mode (I need this to be able to attach it to several machines)
  • Detach the main drive from the machine, and instead attach the diff
    • This needs an extra trick when attaching to a new machine: attach then detach the main, then attach the diff, else VirtualBox won't recognize the disk GUID

This trick does the job: as I work only with the diff disk, the base is never modified and thus never synchronized over the network. The bad part though is that, even if very little growing in amount of stored data, the diff drive is growing in space the vdi (virtual drive storage file on the host) takes on the host because of how the guest OS fragments and moves files. And thus I am starting to synchronize an ever growing diff hard disk, losing the advantages of having a diff.

The problem is: I want is a way to regularly 'merge' or 'defragment changes' on the diff vdi to keep the synchronization small. I can afford (though I don't want it) to make a full sync of the main vdi every time I make this merge. But the only way I've though of is recreating a diff vdi using the same process and restore the files on that disk through some kind of backup. Not very handy. Anyone has a better idea?

Of course there is the other way to work only on a shared directory (between the host and teh guest), but that will need extra configuration (lots of symbolic links on the guest) and I don't want host users to mess up with guest files.

Have I been clear enough?

3
  • Some extra information: My guest system is a minimal winXP with immutable part of ~5GiB and a 'documents' part of ~500MiB. Hosts are several windows and linux machines, some are small disk laptops with erratic connection
    – PPC
    May 30, 2012 at 13:41
  • You say that you "don't trust DropBox differential synchronization to be very effective". Have you actually tested it? Jul 25, 2012 at 11:10
  • @Colin'tHart: Not a very thorough testing, but I made small changes on the virtual drive (a few new files and modified a few old ones) on production, and the synchronization took roughly the time to upload the whole file. Maybe Dropbox is not to blame (it could be NTFS that makes bigger changes than expected), but the result is: it takes ages
    – PPC
    Jul 25, 2012 at 17:44

2 Answers 2

3

VBoxManage modifyhd --compact will cut out any blocks that you have zeroed out with an appropriate tool (see manual). Not sure whether attaching a separate disk for the documents (maybe write-through) would be better for your needs.

1
  • Sounds like a good idea to investigate. Not sure that it will actually preserve bandwidth (if it works on diff), as such a change will probably mess up a lot the dropbox "intelligent sync" algorithm. I should try to make such a change as systematic as possible (each time a user closes his VM?). Great idea anyway.
    – PPC
    Nov 6, 2012 at 17:12
0

If all your host OS are Mac OS 10.5+, you could use the Sparse Bundle mechanism, that is well suited for incremental sync/backup with tools like Time Machine or rsync: http://en.wikipedia.org/wiki/Sparse_image#Sparse_Bundle

I'm using it over Dropbox with a 3 GB volume, and it works well. Of course, your VM disk is probably at least 10-20 GB, so the first sync will be very slow. It can be sped up by Dropbox with LAN sync though.

Also, afaik you have to be careful to mount it only once at a given moment (as you said), and to allow synching after the VM is stopped/standby state.

1
  • Could not test your solution, my hosts are win7 and Ubuntu Natty :(
    – PPC
    May 30, 2012 at 13:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .