VirtualBox

Notre intergiciel propose un script bash pour gérer des machines virtuelles dans VirtualBox. Vous pouvez utiliser ce script pour tester une appliance sur votre ordinateur avec VirtualBox.

Avec ce script vous pouvez:
– voir l’aide en ligne avec ‘-h’ or ‘–help’;
– installer une nouvelle machine virtuelle dans Virtualbox;
– démarrer une machine virtuelle dans Virtualbox;
– arrêter une machine virtuelle dans Virtualbox;
– supprimerune machine virtuelle de Virtualbox.

Exécution


$> ./xwstartvm.sh
Usage : ./xwstartvm.sh --install --name vm_name --hda aFile [install_parameters] | --start --name vm_name | --stop --name vm_name | --uninstall --name vm_name

When running on the Grid Computing, commands are automatically and sequentially executed as follow
[1] install --hda aFile [install_parameters] [2] start
[3] stop
[4] uninstall

--install --name vm_name --hda aFile [--context aFile] [--app aFile] [--input aFile] [--result aFile] [--sshport portNumber] [--sharedfs aDirectory] This installs a new VM in VirtualBox and exits.
Install parameters:
--hda aFile : This is required
This provides the boot disk (an ISO, VDI, VMDK or VHD)

--context aFile : This is optional
This provides a file or a directory as context
If this is not a virtual disk (VD), a new VD is created containing aFile (recursively, if applicable)
If this is a VD (an ISO, VDI, VMDK or VHD), it is kept as is
The VD will be mounted on /mnt/xwcontext

--app aFile : This is optional
This provides a virtual disk (VD) file to mount on /mnt/app
This file may be ISO, VDI, VMDK or VHD file
This typically contains user application stack
This is removed at VM shutdown

--input aFile : This is optional
This provides a virtual disk (VD) file to mount on /mnt/input
This file may be ISO, VDI, VMDK or VHD file
This typically contains user application input files
This is removed at VM shutdown

--result aFile : This is optional
This provides a virtual disk (VD) file to mount on /mnt/result
This file may be ISO, VDI, VMDK or VHD file
If not provided, the script creates, formats
and mounts a new empty 30Gb disk
This will contain user application results
This is kedpt at VM shutdown and sent back to user

--sharedfs : This is optional
This provides a local directory to be mounted inside the VM on /mnt/sharedfs
This is forced to , when running on the Grid Computing
--sshport : This is optional
This provides a port number to forward to VM port 22, to connect through ssh

--start --name vm_name
This starts vm_name

--stop --name vm_name
This stops vm_name

--uninstall --name vm_name
This uninstalls vm_name from VirtualBox

Scripts

bash script "xwstartvm.sh";
bash script "createvdi".