jclouds-virtualbox is a local cloud provider modelled on the virtualbox hypervisor. Similar to other jclouds supported providers, it supports the same portable abstractions offered by jclouds.
##Setup
Please follow these steps to configure your workstation for jclouds-virtualbox:
- install the latest VirtualBox release (please visit https://www.virtualbox.org/wiki/Downloads)
- assign passwordless ssh and passwordless sudo rights to your user
### Passwordless ssh
jclouds-virtualbox uses the current user.name and private key for sending commands to localhost over ssh.
The current user (user.name) should have passwordless ssh. On a *nix system, you can enable this feature using `ssh-keygen` and `ssh-copy-id`.
- ssh-keygen \- creates the public and private keys (by default in `${user.home}/.ssh/id_rsa.pub` and `${user.home}/.ssh/id_rsa`)
> $ ssh-keygen
- ssh-copy-id \- copies the user’s public key to a specified host’s `authorized_keys` file.
ssh-copy-id also assigns proper permission to the remote-host’s home, ~/.ssh, and ~/.ssh/authorized_keys
You need to have passwordless sudo rights on localhost. This is done by editing the sudoers file (/etc/sudoers). Use caution when editing this file, as introducing errors will lock you out of the system. Therefore, it is recommended to edit this file through the visudo command.
The sudoers file should have a line like this (replace your-user):
> your-user ALL=(ALL) NOPASSWD: ALL
At this point, you should be able to login to localhost with `ssh your-user@localhost` without password.
The OS supported by jclouds-virtualbox are described in a YAML file `default-images.yaml` stored at `src/main/resources/`.
For each OS supported, it stores the following information:
a unique id, a name, a description, an os_arch, os_family, os_description, os_version, the iso url, the iso md5, username and credential to access this vm, a keystroke sequence for the OS installer and a preseed configuration file that contains the settings for this OS installation.
For example, the corresponding YAML section for ubuntu 10.04.4 server (32 bit) looks like:
By default, a new node is cloned from a matching 'Image' with 'CloneOptions.Link'. This advanced option will save a lot of disk space and installation time as opposed to creating completely unique VMs for each new node.
### Networking
Each Node will have 2 NICs (Network Interface Cards) to enable an NAT+Host-Only networking strategy:
* NIC1 at port 0 will be attached to Host-Only network to allow localhost-nodes communication and node-node communication
* NIC2 at port 1 will be attached to NAT network to give each node internet access
By default, jclouds-virtualbox will try to use the current user (with passwordless ssh and sudo rights), but you can also override this default by specifying
`-Dvirtualbox.identity` and `-Dvirtualbox.credential`, if you want to use another user available on your local machine.
In order to make available a preseed file, jclouds-virtualbox will start a PreseedServer at `http://localhost:23232` that will serve a preseed.cfg file.
Make sure your firewall rules are not blocking this port.
If you need to override this default you can use `-Djclouds.virtualbox.preconfigurationurl=http://localhost:PORT/preseed.cfg`, with a different PORT.
jclouds-virtualbox needs an Host-Only network with DHCP enabled. This DHCP server will be responsible for assigning local IP addresses to the Nodes created by jclouds-virtualbox.
- jclouds-virtualbox is still at alpha stage please report any issues you find at [jclouds issues](https://github.com/jclouds/jclouds/issues?state=open) or [jclouds google group](http://groups.google.com/group/jclouds).
- jclouds-virtualbox has been tested on Mac OSX, it might work on Linux iff vbox is running and set up correctly. However, it will not currently run on Windows.