Introduction

The COSMOS Development Environment is provided as an Ubuntu 18.04.4 Vagrant box with necessary tools preinstalled.

VirtualBox and Vagrant are used to ensure the development environment is cross-platform. VirtualBox is used for virtualization of operating systems, and Vagrant is used to set up the virtual machine in a (mostly) platform-independent manner.

Why Linux?

Linux makes working with the kit software much easier, as the operating system as a whole is designed for developers. Our image is also fairly lightweight, meaning that unnecessary software is stripped out so that the download size is minimal.

Supported Operating Systems

The supported operating systems are essentially those that VirtualBox and Vagrant support:

  • Windows
  • macOS
  • Linux

1. Install Dependencies

1.1 VirtualBox

VirtualBox is used to run the virtual machine used as the development environment. Get it here. The install wizard will help you.

1.2 Install Vagrant

Vagrant is used to set up the virtual machine used as the development environment. Get it here. The install wizard will help you.

1.3 Install the Guest Additions Plugin

The Vagrant guest additions plugin automatically installs VirtualBox guest additions into the virtual machine. Install it by opening up a command prompt (Windows) or a terminal (Linux/Mac) and running the following:

$ vagrant plugin install vagrant-vbguest

2. Set up the COSMOS Box

Some of the commands you will need:

  • cd: changes directories. Use the command cd {insert folder name here} to move in to that folder. The command cd .. moves up one folder.
  • dir: shows what is in the current directory. Use this to check what folders/files are in your current directory to ensure everything is done properly.

2.1 Add the Box

Download the COSMOS box from here. An example location of the file on Windows is C:\Users\YOUR_USERNAME\Documents\Vagrant\artemis.

Once in the Command prompt is in the correct folder, Run the following commands.

$ cd "PATH/TO/VAGRANT/BOX"
$ vagrant box add artemis artemis.box

You can now delete the artemis.box file you downloaded if you wish.

2.2 Create the Virtual Machine

Enter the following commands, replacing PATH/TO/VM with the correct folder.

$ cd PATH/TO/VM
$ vagrant init artemis

Download the Vagrantfile file from here and copy it to the folder you previously chose, overwriting the existing Vagrantfile file. The new Vagrantfile will set up the virtual machine with necessary virtualization settings.

2.3 Start the Virtual Machine

Next run the command:

$ vagrant up

After a minute or so should see the virtual machine boot. Login with the password below:

username: vagrant
password: vagrant

Open a terminal inside the virtual machine (Control + Alt + T or the black box icon on the left-hand dock) and enter the following command:

$ sudo apt install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11

2.4 Reboot the Virtual Machine

Reboot the machine by returning to your host terminal and entering:

$ vagrant halt
$ vagrant up

In the future you should be able to start the virtual machine directly from the VirtualBox GUI, or you can continue running vagrant up in the virtual machine folder.

2.5 Enable Useful Features

Once you have logged into the vagrant user again (default password is vagrant), you can enable some useful tools:

Automatic Display Resizing

This feature will resize the guest display when you adjust the size of the container window.

Click on the View menu at the top of the virtual machine and click on Auto-resize Guest Display. If it is already selected, then you should click on it again.

Shared Clipboard

This feature will allow you to copy and paste between the host and guest machines.

Click on the Devices menu at the top of the virtual machine and click on Shared Clipboard > Bidirectional.

3. Update Software

From the virtual machine, open a new terminal (Control + Alt + T) and run the following command:

$ ./update

You will be prompted whether or not you want to update various components. Entering y will overwrite the existing installations, if present.


 


Tags: