-
Notifications
You must be signed in to change notification settings - Fork 6
Ubuntu VM Setup
This guide is a supplement to Local Setup for getting a development environment running on a Ubuntu Linux VM.
Rather than getting a development environment working on Windows or WSL2, you may find it easier to work within a virtual machine. The following steps will guide you through requesting and setting up VirtualBox on you VA laptop.
Note: While connected to the VA VPN, some HTTPS requests are intercepted, and the network presents its own certificate. This causes connection failures within the virtual machine. A simple solution is to disconnect from VPN when network issues arise.
- Navigate to yourIT and select the "Need Something New? Submit a Request" option.
- Choose "IT Software or Hardware Request" and fill the request form.
- For "Non-Medical Software Details" enter the following as the request for VirtualBox 7.xx (or the latest version):
Please install VirtualBox 7.xx software. https://trm.oit.va.gov/ToolPage.aspx?tid=6679, https://www.virtualbox.org/wiki/Downloads
- For "Justification" enter the following:
VirtualBox is required to conduct official VA business, specifically it facilitates software development for VA.gov, VRO, and other OCTO efforts.
- After filling the request form, click the "Order Now" button.
- IT will contact you in order to remote into your laptop and install the software. It may take several days for them to service your request.
- Download the Ubuntu 22.04 ISO from here
- From VirtualBox, select the "New" button.
- Name your VM and select the ISO Image before moving to the next screen.
- VirtualBox has an unattended installation feature that will install and configure the guest OS for you. On the screen, you may setup a username, password, and hostname for your VM. You may also want to install Guest Additions if given the option.
- Select a reasonable amount of memory for the VM. (For example, I selected 8192 MB for a host laptop with 16 GB of memory.)
- Select a reasonable amount of processors for the VM. (For example, I selected 4 for a host laptop with 8 CPUs.)
- On the disk screen, allocate a virtual hard disk with enough space for development. (I created an 80 GB disk.)
- On the final screen select the Finish button. VirtualBox will install and configure the guest OS for you.
- After the installation is finished, you will want to ensure that
Enable Nested VT-x/AMD-V
is selected in your VM. Go to Settings > System > Processor and select the approprate checkbox. - Start the VM and log in.
- Your user cannot use sudo, but the root account is conifigured with the same password as your username. To add your user to the sudo group, from a terminal type
su
and enter your password. Then,usermod -aG sudo <your username here>
. Typeexit
to leave the root shell. Afterward, you may need to log out and log in again for sudo to work.
Development Prerequisites (adapted from LHDI Developing on Non-Mac OS)
Install git:
sudo apt install git
Configure your name and email for git:
git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "[email protected]"
Don't install VS Code from the Ubuntu Software app. There are some issues with it that cause problems later with Gradle. Download the Linux x64 .deb
file from here instead. Install it with:
sudo apt install <VS Code .deb file>
sudo apt install openjdk-17-jdk
pip3 install --upgrade pip setuptools
Follow the official instructions from Docker:
- Install Docker Engine on Ubuntu | Install using the apt repository
- Linux post-installation steps for Docker Engine
Docker plugins (such as docker-compose) are not put into the PATH by default, you can link docker-compose to /usr/local/bin
to make it easier. You can do similar for other plugins as needed.
sudo ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin/
- Download the latest
hadolint-Linux-x86_64
release. - Rename the file
hadolint
. chmod +x hadolint
sudo mv hadolint /usr/local/bin
Install the binary following the official instructions with this command:
curl -L https://raw.github.com/stoplightio/spectral/master/scripts/install.sh | sudo sh
sudo apt install shellcheck
sudo apt install pre-commit
- Run
pre-commit install
from yourabd-vro
project to install the git hook.
Go is required by some pre-commit hooks. Install it following the Linux instructions here. However, you will need to prefix both commands in step 1 with sudo
for it to work properly.
sudo apt install adr-tools
Follow the offical Install using native package management instructions.
Follow the From Script offical installation instructions.
Follow the download instructions here. Though in addition to step 2, you can permanently add istioctl to your path with the following command:
echo 'export PATH=$HOME/.istioctl/bin:$PATH' >> ~/.profile
Follow the offical installtion steps for Linux here
Follow the Anywhere installation steps. (This requires Docker to have already been installed.
sudo apt install mkdocs
Follow the Linux x86-64 instructions here.
From the offical installation instructions:
- Install jq, which is a dependency of the installer script:
sudo apt install jq
curl https://[email protected]/department-of-veterans-affairs/lighthouse-di-lightkeeper/main/install.sh | bash -s $GITHUB_ACCESS_TOKEN
Note: For this step to work,
GITHUB_ACCESS_TOKEN
must be configured as described in Local Setup.