Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

FunTimeCoding/virtual-box-tools

Repository files navigation

VirtualBoxTools

Tools for VirtualBox to simplify manual usage and automated integration.

Setup

Install project dependencies:

script/setup.sh

Install pip package from GitHub:

pip3 install git+https://git@github.com/FunTimeCoding/virtual-box-tools.git#egg=virtual-box-tools

Install pip package from DevPi:

pip3 install -i https://testpypi.python.org/pypi virtual-box-tools

Uninstall package:

pip3 uninstall virtual-box-tools

Configuration file location: ~/.virtual-box-tools.yaml

(Optional) Use a host configuration from a different location:

host_file: ~/srv/salt/pillar/host.sls

Optional: Run virtual machines as a different user:

sudo_user: vbox

Usage

Run the main program:

bin/vbt

Run the main program inside the container:

docker run -it --rm funtimecoding/virtual-box-tools

Show help:

vbt --help
vbt host --help

Create a host:

vbt host create --name example

Create a host and connect it to a bridge interface:

vbt host create --name example --bridge-interface en0

Destroy a host:

vbt host destroy --name example

Run the web service:

vbt-web-service

Show users:

bin/show-users.sh

Development

Configure Git on Windows before cloning:

git config --global core.autocrlf input

Install NFS plug-in for Vagrant on Windows:

vagrant plugin install vagrant-winnfsd

Create the development virtual machine on Linux and Darwin:

script/vagrant/create.sh

Create the development virtual machine on Windows:

script\vagrant\create.bat

Run tests, style check and metrics:

script/test.sh [--help]
script/check.sh [--help]
script/measure.sh [--help]

Build project:

script/build.sh

Install Debian package:

sudo dpkg --install build/python3-virtual-box-tools_0.1.0-1_all.deb

Show files the package installed:

dpkg-query --listfiles python3-virtual-box-tools

Run the web service in a virtual environment:

script/start.sh

Run VirtualBox commands as a different user:

sudo -u virtualbox vboxmanage showvminfo --machinereadable ${MACHINE_NAME}

Send a request to the web service:

curl --silent --header 'Authorization: Token example' localhost:5000/host
curl --silent --header 'Authorization: Token example' --header 'Content-Type: application/json' --request POST --data '{"name": "example"}' localhost:5000/host
curl --silent --header 'Authorization: Token example' --request DELETE localhost:5000/host/example

About

Helper scripts for running VirtualBox.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published