VirtualBox Configuration Repository

This repository is deprecated.

Please use the RAT Virtualbox creation and 
management scripts to automate and compare 
configuration.  This allows entire config-
uration to be specified in a few lines and
is a more useful way of recording a consis-
tent virtual hardware configuration.

Links pending...


Overview

To attempt to solve a few problems with managing VBox, I've created a subversion repository:

  svn+ssh://svn.inf.ed.ac.uk/disk/svn/vboxconf/

This is intended to hold all the RAT unit virtual machine configuration(s) which we use/develop with on a regular basis.

Inside the repository I propose the following, very simple structure. Each host machine should have its own root directory, within which multiple virtualbox configuration directories can be maintained:

 /hostname/virtualbox.version.number/

And, optionally:

 /hostname/virtualbox.version.number-OSE/

(values of which could be detected for each host using the version.sh script in the repository root). This directory would contain the root of ~/.VirtualBox, holding everything except the VDI / HardDisk directory. Of course the VDI thing is not enforced, so I will need to add a pre-commit hook to prevent VDIs (or snapshots, or perhaps just any large files for that matter) from being inadvertently added to the system.

Placing everything in a repository should give the advantage of actually managing our configuration data, including monitoring changes, logging what does and does not work for different hardware, and allowing configuration to be backed up, shared, and copied conveniently between hosts.

Preparation

To use this system successfully, create yourself a host-directory.

First check out the whole repository. We could create the directory remotely with svn mkdir but we need to do some other things so it's probably easier this way.

 cd /disk/scratch/
 svn co svn+ssh://svn/disk/svn/vboxconf/
 cd ./vboxconf/

Now we should establish hostname and version using the provided script, so that we can create our directory and set the ignore file so that large files can be ignored by default:

 ./version.sh
 mkdir -p ./<hostname>/<version>
 svn add ./<hostname>
 svn propset svn:ignore -F ignore.txt <hostname>/<version>
 svn commit -m 'empty skeleton for <hostname>'

You can now clean up:

 cd -
 rm -fr ./vboxconf/

Initialisation

The next step is to replace your existing configuration...

 svn co svn+ssh://svn/disk/svn/vboxconf/<hostname>/<version> /disk/scratch/$USERNAME/vbox
 mv ~/.VirtualBox/* /disk/scratch/$USERNAME/vboxconf
 rmdir ~/.VirtualBox
 ln -s /disk/scratch/$USERNAME/vboxconf ~/.VirtualBox
 cd /disk/scratch/vboxconf
 svn add *.dat *.xml Machines/
 svn commit -m 'added configuration for my host'

(of course, you'll now need to make sure that every DICE machine you use has a directory /disk/scratch/$USERNAME/vboxconf, whether you are checking it into the repository or not...)

then check that nothing has been missed:

 svn st

Should return silently.

Neat tricks...

So now it's straightforward to compare files, even across versions and hosts, with svn diff:

 cd /disk/scratch/$USERNAME/vboxconf
 svn diff svn+ssh://svn/disk/svn/vboxconf/{hostone,hosttwo}/3.0.2/VirtualBox.xml
 svn diff -r 5:HEAD Machines/myguest/myguest.xml
 svn diff -r "{`date -d yesterday +%F`}" ./myguest.xml

Also, barring hard disk constraints, it's dead easy to assume all guest configuration of another host, using 'svn switch'. This is also the procedure that you'd use to incorporate a new version of VirtualBox:

 svn copy svn+ssh://svn/disk/svn/vboxconf/foobar/3.0.2/ svn+ssh://svn/disk/svn/v$
 cd /disk/scratch/$USERNAME/vboxconf
 svn switch svn+ssh://svn/disk/svn/vboxconf/foobar/3.0.4/

Other notes

Switching and general maintenance should not affect ignored directories, such as HardDrives -- but you might want to be safe by moving the directory out of the danger area and symlinking to it, just to be sure...

Also, I've found with no great surprise that the logs tend to change - a lot - and are probably not worth recording unless there's something particularly interesting going on. To that end you might want to do the following to mask your guest log directories:

 cd /disk/scratch/$USERNAME/vboxconf/Machines/
 for dir in '*'; do
        svn rm ${dir}/Logs/*.log*;
        svn propset svn:ignore '*' ${dir}/Logs/
 done
 svn commit -m 'ignore logs' /disk/scratch/$USERNAME/vboxconf/Machines/

-- GrahamDutton - 26 Aug 2009

Topic revision: r4 - 23 Jan 2019 - 13:45:26 - GrahamDutton
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies