stefanhorning.virtualbox
Ansible Role for VirtualBox
This role installs the headless version of VirtualBox and phpVirtualBox, allowing you to access it remotely through a web interface. It's designed for Ubuntu or Debian servers running without a graphical interface.
After running this role, you can access the VirtualBox GUI by opening your web browser and going to http://<HostnameOrIP>/
. Replace <HostnameOrIP>
with the IP address or hostname used by Ansible. Ensure that port 80 is open and not blocked by any firewalls.
The first time you log in, use the username and password admin:admin
. For more information, check the phpVirtualBox documentation.
Requirements
This role has been tested with Ubuntu versions 14.04 and 16.04. It should work with most versions of Debian and Ubuntu that are not outdated.
Role Variables
Here are some key variables you might want to adjust:
virtualbox_user: vbox
- This is the user that runs the VirtualBox service and to which phpVirtualBox connects. This is NOT the same user you use to log into the phpVirtualBox GUI.virtualbox_user_pw: abc123
- This is the plain text password for the VirtualBox service user, needed for the phpVirtualBox configuration.
There are additional variables you can modify when using this role. For a complete list, check defaults/main.yml
.
Dependencies
This role does not depend on any other roles.
Example Playbook
To use this role in your Ansible project, copy it to the roles/stefanhorning.virtualbox
directory. It's best to add it as a submodule. You can also install it with ansible-galaxy install stefanhorning.virtualbox
.
Here’s an example of how to use the role in your playbook:
- name: My playbook
hosts: servers
roles:
- { role: stefanhorning.virtualbox, virtualbox_user: vbox, virtualbox_user_pw: supersecretvalue }
License
BSD License
Author Information
Stefan Horning
Installs VirtualBox and phpVirtualBox on a headless Ubuntu server.
ansible-galaxy install stefanhorning.virtualbox