Skip to content

Host Common Setup

Harry Goldschmitt edited this page Nov 10, 2020 · 23 revisions

At this point, it is time to setup the GMAT2020a box on your host machine. The setup is common to all host platforms.

Obtain the digitalsats/gmat2020a_box Repository

On all OS's enter the following commands to obtain a digitalsats GMAT development Vagrant machine named "gmat2020a_box" and all files needed to populate it.

Next obtain the repository:

cd ~
rm -rf gmat2020a_box
git clone https://github.com/digitalsats/gmat2020a_box

This will create a gmat2020a_box directory in your home directory and clone the installation repository into it.

Repository Contents

Vagrantfile

One of the files included in the repository is a Vagrantfile which is used by the Vagrant software to describe a Vagrant Box. The gmat2020a_box will be set up as a Ubuntu 18.04 box.

Scripts

All scripts in the repository have the .sh extension.

They are used to create the GMAT2020a build environment. All of the scripts included in the GMAT Vagrant box repository, create log files in the vagrant user's $HOME/GMAT_Install_Script_Logs directory, for tracking and debugging purposes. If you run into difficulties or have questions, please check the log files first.

Vagrant Configuration

Directories

Vagrant expects to be invoked from a directory that contains a Vagrantfile. This is what it uses to identify its boxes (VMs). If there is no Vagrantfile in the current directory, the vagrant command will search for Vagrantfiles in all directories leading to the host system's root. A Vagrantfile for the GMAT build Ubuntu box is supplied in the

Use Vagrant to Boot the gmat2020a_box

Vagrant commands to control the gmat2020a_box must be issued from the gmat2020a_box directory, just downloaded. For a more complete explanation of the Vagrant command line interface, please see the Vagrant Command Line Interface page.

Change to your home directory and then issue:

cd gmat2020a_box
vagrant up

This will download the Ubuntu base box and boot it for the first time. After it has booted, you can issue:

vagrant ssh

to log into the gmat2020a_box as user vagrant. If you receive the following error message:

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual modifications made within the Vagrant home directory. Vagrant can attempt to automatically correct this issue by running:

vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible versions of dependencies. To fix this problem please remove and re-install all plugins. Vagrant can attempt to do this automatically by running:

vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest versions:

vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-disksize (= 0.1.3)

Run the following commands to re-install all plugins and to log into the gmat2020a_box as user vagrant.

vagrant plugin expunge --reinstall
vagrant ssh

Once you can successfully run vagrant ssh, use the Linux

exit

command to log out of the box. This might be a good place to take a snapshot, see Snapshots.

Snapshots

Many of the steps in the next sections take hours to run. It is a good idea to periodically issue the following commands from the same directory that the Vagrantfile is in.

vagrant halt  
vagrant snapshot save [name]  
vagrant up  
vagrant ssh

If for some reason, you wish to revert to a saved snapshot, issue the following sequence from the same directory the Vagrantfile is in.

vagrant halt  
vagrant snapshot restore [name]  
vagrant up  
vagrant ssh

Continue with the section on setting up the gmat2020a_box.