Search This Blog

Friday, January 28, 2011

VirtualBox 4.0 Machine Cloner

I've written a simple application in Java for cloning Virtual Machines.
My environment includes Ubuntu 10.04 Server Edition with btrfs file system.
There is an option of reflinking files in that fs - which means a little like
'copying them without taking any space', just making references to source file
and creating a diff file instead. Only the changed-parts of the file are stored on HD :).

The application uses reflink option and it's main purpose is to clone VMs.
I will just describe its main functions - configuration and run of VBox Cloner will be added in
later posts.

- cloning machines of a specific user
- listing registered VMs
- changing source/destination clone directory
- source user check (which user should VBoxCloner user to register new VM)
- Issuing commands to VM - running in headless mode, restarting etc (which the main Virtual Box 4.0 GUI lacks btw.)
- Controlling VM snapshots - listing, restoring snapshots

http://sites.google.com/site/bkosarzyckiaboutme/VBoxClonerScreen1.png
http://sites.google.com/site/bkosarzyckiaboutme/VBoxClonerScreen2.png
http://sites.google.com/site/bkosarzyckiaboutme/VBoxClonerScreen3.png






VirtualBox Cloner is now open source :)!!!
project home page is located at:

Current release:
Previous one:

Documentation can be found here:






5 comments:

  1. As you can see above softpedia has found VBoxCloner :)
    http://www.softpedia.com/get/System/System-Miscellaneous/VBox-Cloner.shtml

    version 0.31 coming soon :)

    ReplyDelete
  2. Hi,
    Just downloaded your application which looks great but it cannot find my VMs...
    Where should I "install" your application.
    My VMs are not in the default folder.
    Thanks.

    Win7 64 - Virtualbox 4.0.12r72916

    ReplyDelete
  3. @Christophe
    Just use the config file that is shipped with the application (app.config). There are separate example config files for Windows and Linux (app.config.windows & app.config.linux). Remember that the application reads app.config file, so rename the config file to that name first if u use the example config.

    The config sections you need are:
    VMPath - where vm templates are stored (vm images that will be cloned)
    VMCoreDir - where the vms should be cloned (or where you have your vms)

    The install directory is not important. You can install this application wherever you want to.

    ReplyDelete
  4. Thank you for your feedback.
    I'm sorry I shoud have read the info file first.
    I tried again and can see my VMs in the second tab (uses vboxmanage), but not in the first panel.
    Obviously I must miss the xml and descr files.
    My VMs have only .vbox, .vbox-prev and .vdi files.
    How can I generate the missing files ?
    Is it because my VMs are all registered ?
    They are not templates but "real VMs". Do I need a special tool to build templates instead of usable vms ?
    Thank you for your help.

    ReplyDelete
  5. It turned you're right. But first things first.
    a) The .descr files you need are just plain text files. The program reads vm info from them. All you need to do is to create a simple text file with the name your_vm_name.descr and it will be ok.
    Maybe I should've let the program discover vms without that file;) (explanation later on)
    b) The .vbox files you have are actually .xml files. Oracle changed the naming concept. The .vbox files are plain xml files.

    I wrote the program for the division I no longer work for. That's where it gets tricky. If you confirm that the solution does not work I can try to change it myself if I have free time.
    The source code is available for free at: http://vboxcloner.svn.sourceforge.net/viewvc/vboxcloner/

    However try:
    a) your vdi has to be: vm_name.vdi
    b) create .descr text file vm_name.descr
    c) rename the .vbox file to vm_name.xml

    All the files HAVE to be in your VMTEMPLATE directory.
    e.g.:
    C:\VMTEMP\vm_name.descr
    C:\VMTEMP\vm_name.vdi
    C:\VMTEMP\vm_name.xml


    And to your last question: no, VMTEMPLATES are just Virtual machines. That is: these are vdi files with the hard drive, xml (or vbox) file with the xml hardware description and .descr file with the description string.

    Good luck,
    Bert

    ReplyDelete

If you like this post, please leave a comment :)