Many VB instances for many projects...

This is for discussing general topics about how to use VirtualBox.
Post Reply
mick123
Posts: 1
Joined: 25. Oct 2010, 21:24
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Many VB instances for many projects...

Post by mick123 »

Hi all,

I have the following problem.
Every time I get a project, it contains many subprojects - each of these subprojects requires manual setting of different options, libraries, sometimes additional materials need to be downloaded.
Every time I switch to another subproject, I need to reset all the settings, and sometimes I need to open these suprojects two, three times.
The software is stupid enough that it doesn't save the settings in the subprojects - and it's developers' fault, because they did not predict such a possibility.

So I am wasting a lot of time changing settings of 2-3 applications over and over again, and nobody pays me for that, just for the job done within the subprojects, not to mention that it makes me crazy.
Last time I received 287 such files... and I told myself that it's time to do something about it.
I think that Virtual Box could help, but as I am not very well acquainted with this software, I am not quite sure.

What I have in mind (solution to the problem):
1. I need to populate many virtual machines (many instances). Each of these virtual machines will contain fresh install of the software I use, so I will be able to change settings without the influence from previous settings. Yet only one instance will be running at the same time.
2. Each virtual machine will be able to run even after some time after initial deployment (in case I need to check or change something).
3. I should be able to run the virtual machine by clicking a file. This is necessary, because I want to put that file in the project's folder - so that each project would have separate virtual machine assigned. (Question A) Is there a way to populate these virtual machines in a simple way (like using a batch file)?
4. I should be able to change some settings in the virtual machine - especially the folder that it has the access to, because I need to have the access to the project's folder. (Question B) How can I provide such an access to differing folders?
5. From what I have seen, each virtual machine installation needs at least 1 GB of space on a hard drive. That may be too much, considering that I can get e.g. 3 such projects a day = 3 GB of space used a day.
(Question C) Is there a way to compact these virtual machines? Compression? Deleting swapfile? Some kind of incremental backup (practically containing only the settings and files for the project, because it's the only information that changes).


I was also thinking about doing some kind of registry backup and restore (or registry virtualization like in sandboxie) to achieve the same effect, but I am pretty sure it won't work, especially that I often need to use additional software, download libraries, etc. And it's also too complicated...

I just want to navigate to the project's folder, click the virtual machine script file (that will run the machine), and have the environment set up, just the way it was set up the last time it was used.

I am completely aware that my way of thinking may be naive - right now I am looking for the solution to that problem - it may include Virtual Box or not.
So if you have the solution to my problem, can answer any of the questions (A, B, or C) or have any other idea how to save and restore settings in a way I described, please don't hesitate to answer.

Regards,
Mick
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: Many VB instances for many projects...

Post by Technologov »

Question A:
Yes, it is possible to create such a file. On Windows host, it should be a DOS batch file (*.bat) that launches the VirtualBox process with your VM.

Question B:
Since you need to run only 1 VM concurrently, the best idea here is to create one VM and use snapshots on it.
Configure "Shared Folders" correctly, and just modify this parameter for each project.
Each project would become new snapshot.
Snapshot do remember all of your VM settings, which means, that different snapshots will have different Shared Folders (aka different projects) attached to them, if you configure it before making a snapshot.

Snapshots Tree should look like:
+ Clean Install of my Guest OS
+-- VBox 3.2.10 Guest Additions + Install your applications
+----Project A (with configured shared folders for project A)
+----Project B (with configured shared folders for project B)
+----Project C (with configured shared folders for project C)

Question C:
Snapshots are incremental, so disk usage should be minimal. Further optimizations (such as removal of swap file) are possible.
For Compression, you can try host-side or guest-side NTFS comression.
This means only the "base image" will take the disk space for OS and applications.
The "child snapshots" will only take space that is required by your projects.

Limitation: currently it is hard to backup VMs with snapshots, and on restore it may require manual editing of XML config file.

-Technologov
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Many VB instances for many projects...

Post by mpack »

If you are going to use a system of 2 level branching snapshots then I recommend that you back up the base VDI very carefully, otherwise damage to that single file will take out all the child projects.
Post Reply