-
Notifications
You must be signed in to change notification settings - Fork 1
OpenSPA Development Environment
OpenSPA uses Vagrant to create a virtual development environment in order match the devices that OpenSPA will run on. Currently, the only OS that we are developing for is Debian 8, as that is what the BeagleBone Black natively supports. As we expand compatibility to multiple systems, more dev environments will be added. This guide will walk you through setting up the Debian virtual machine (VM) you'll need to start developing OpenSPA.
- Install VirtualBox if you haven't already
- Linux:
sudo apt-get install virtualbox
- Mac & Windows
- For Vagrant/VirtualBox to work properly, ensure you have the following BIOS settings:
- UEFI Secure boot disabled
- Virtualization Technology (VTx) enabled
- Virtualization Technology Directed I/O (VTd) enabled
- Install the latest version of Vagrant
- Linux, Mac & Windows (Ubuntu users: install the Debian package)
- Install the VB Guest Additions Vagrant plugin
- Mac & Linux:
vagrant plugin install vagrant-vbguest
- Windows:
C:\vagrant\vagrant\embedded\bin\gem.bat install vagrant-vbguest
- If installation of the vagrant-vbguest fails update the sources
C:\vagrant\vagrant\embedded\bin\gem.bat sources --remove https://rubygems.org/
C:\vagrant\vagrant\embedded\bin\gem.bat sources -a http://rubygems.org/
-
Be sure you've cloned in the repository and are in the
/OpenSPA
directory -
Type
vagrant up
into your terminal to launch the VM -
Allow vagrant to finish setting everything up before doing anything in the VM. This will take a number of minutes, and it might appear to be stuck at times. Just give it time. A lot of time. Sometimes it may be a bit finicky and fail to initialize with some error; if that happens, just enter
vagrant destroy
and try again.
Default credentials:
- Login: vagrant
- Password: vagrant
By using the power of VirtualBox synced folders, any files you put into the /OpenSPA
directory will be synced to the corresponding directory on the VM. By default, this directory is /home/OpenSPA
. The files sync in real-time, so there's no need to worry about waiting between saving a file on your machine and executing it on the VM (cool, right?!)
The development philosophy here is that you do all of the editing and file management on your own machine in your preferred way, and all of the testing and running in the VM. This way, you may still use your favorite IDE/text-editor and your favorite operating system on your own machine!
There's two ways of doing this:
- By default, the GUI for Debian is enabled. When you're ready to compile and run files, you may simply work right out of the VM in either the terminal or the desktop-environment by running the command
startx
. - If you'd prefer to not even lay your eyes upon VirtualBox, you have the option of using
vagrant ssh
to log right into the VM from your own terminal. You can disable the GUI entirely by simply changing settingvb.gui = false
in the Vagrantfile and enteringvagrant reload
As for tearing down the VM when you're done working, you have a few options. vagrant halt
is just like shutting down a physical machine. It will take the time to shut down properly, it's state will be saved into main memory, and it will also take some time to boot up the next time you vagrant up
. If you want to just put the VM to sleep for a bit, vagrant suspend
will suspend the session without totally shutting down. When you do this, the VM's state will live in your RAM and thus restrict your late-night gaming performance. Finally, vagrant destroy
just kills the VM and completely erases all traces of it from your computer. The VM will have to completely reinitialize the next time you vagrant up
In the /OpenSPA directory:
vagrant up
-
vagrant halt
to shut down -
vagrant suspend
to sleep -
vagrant destroy
to utterly annihilate every last byte of data