Software Install

Windows

installing docker, git, and visual studio code on a Windows machine.

Winget

Windows comes with its own package manager called winget (the "Windows Package Manager"), and we'll use it to install everything else in this guide. It ships pre-installed as part of "App Installer" on up to date Windows 10 and Windows 11 machines.

Open PowerShell by hitting the Windows key and typing in PowerShell.

Check that winget is installed by running

PowerShell
$ winget --version

Winget missing?

If that command isn't found, open the Microsoft Store, search for App Installer, and hit Update (or Install if you don't have it). Winget ships as part of that app.

WSL2

Docker Desktop needs a Linux backend to actually run containers, and the one we'll use is WSL2 (Windows Subsystem for Linux). It works on Windows Home as well as Pro, unlike the older Hyper-V backend, so we'll set it up before installing Docker.

Open PowerShell as an Administrator, hit the Windows key, type in PowerShell, then hit Ctrl + Shift + Enter (or right click the result and hit "Run as administrator").

Run

PowerShell (Administrator)
$ wsl --install

This enables the required Windows features, installs the WSL2 kernel, and installs Ubuntu as the default Linux distribution.

Restart your computer when prompted.

After restarting, Ubuntu will open automatically and ask you to create a Linux username and password, these are separate from your Windows account so pick whatever you'd like.

Requirements

wsl --install requires Windows 10 version 2004 (Build 19041) or later, or Windows 11. If you're on an older build, run Windows Update first.

Docker

Now that WSL2 is set up you can install Docker Desktop by running

PowerShell
$ winget install --id Docker.DockerDesktop -e

Open Docker Desktop by hitting Windows + S and typing in Docker you will see a service agreement, accept it and let it finish starting up.

In Docker Desktop go to Settings > General and make sure Use the WSL 2 based engine is checked, it should already be on by default.

Next to check if docker is working, open a new PowerShell window and run

PowerShell
$ docker run hello-world

You should see a few messages about docker running and how it pulled that message down.

Docker debugging

If it didn't work try these debug commands.

  • run docker ps if it gives you a message about not being able to connect to the docker daemon, open the Docker Desktop application and it should run again
  • run wsl --status and confirm the default version is 2, if it's not run wsl --set-default-version 2
  • if Docker Desktop complains about virtualization not being enabled, you'll need to enable Intel VT-x/AMD-V in your PC's BIOS/UEFI settings, this varies by manufacturer so search for your specific model
  • try winget uninstall Docker.DockerDesktop then reinstall with the command above for a fresh install. If this doesn't work send a message in general-software and someone will respond back to you

Git

Go to the Github website and make an account skip if you have one. Remember the username and email you used to make the account.

Open PowerShell and run

PowerShell
$ winget install --id Git.Git -e --source winget

Close and reopen PowerShell (this refreshes your PATH) and check it exists by running git --version

Next to configure your username run git config --global user.name "Your username here" and git config --global user.email "Your email here"

Optional Git configuration

If your Github account is shared across multiple machines, you may run into issues with not being able to push since github wasn't able to properly authenticate, if this is the case follow these steps.

OpenSSH Client

These steps use the OpenSSH client that ships with Windows itself rather than the one bundled with Git for Windows. To check it's available run ssh -V in PowerShell. If that command isn't found, go to Settings > Apps > Optional Features > Add a feature, search for OpenSSH Client, and install it.

Run ssh-keygen -t ed25519 -C "Your email here" and follow the prompts on the terminal, You can set up a password but this makes authentication much harder.

Set the ssh-agent service to start automatically and add your key to it, open PowerShell as an Administrator and run

PowerShell (Administrator)
$ Get-Service ssh-agent | Set-Service -StartupType Automatic
$ Start-Service ssh-agent
$ ssh-add ~/.ssh/id_ed25519

Now run Get-Content ~/.ssh/id_ed25519.pub | clip, this copies the key directly into your clipboard.

Next go to github.com, click your profile in the top right and hit settings

In the settings menu click SSH and GPG keys then click New SSH key on that page.

Make sure the new key's type is an Authentication key, give the key an appropriate name and then paste the contents that we copied earlier into the box.

run this command in your terminal

PowerShell
$ New-Item -Path ~\.ssh\config -ItemType File -Force
$ @"
$ Host *
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_ed25519
$ "@ | Add-Content ~\.ssh\config

Test that this works by running ssh -T [email protected] this should show a message about succesful authentication to github.

Warning

This includes an extra hoop to jump through with repos you are going to be contributing to. When you clone a new repo make sure to hit the code button and then hit SSH then copy that link and then git clone using that SSH link

Visual Studio Code

Next we will lead you through the setup for VSCode and all of the extensions we need.

Run

PowerShell
$ winget install -e --id Microsoft.VisualStudioCode

Once the install finishes press the Windows key and type in Visual Studio Code to open it

Follow the installation steps that VSCode prompts you for.

Open the Command Palette (Ctrl + Shift + P), search for Shell Command: Install 'code' command in PATH, and run it. This lets you run code . from the terminal to open the current folder in VSCode, which is handy once you start cloning repos.

Close and reopen PowerShell then test it by running

PowerShell
$ code --version

You should see a version number and commit hash printed out.

We use Dev Containers on our repos so everyone gets an identical, pre-configured environment instead of installing tools by hand. Install the following extensions from the Extensions view (Ctrl + Shift + X):

Naming

The marketplace has several similarly named container/Docker extensions. Search by the extension ID above (or paste it into the Extensions view search bar) to make sure you install the right one.

Nearly finished, now take the URC-2023 Repo copy the link and git clone https://github.com/TrickfireRobotics/urc-2023.git the repo into an appropriate folder, then run code urc-2023 and vscode should open with this new repository opened

A notification should popup that has an option that says "Reopen in Container" click that and VSCode will start building and creating the devcontainer, make sure that Docker Desktop is running in the background before you do this otherwise this will fail.

Performance tip

Docker Desktop on Windows is noticeably slower building and watching files that live on your C:\ drive compared to files inside WSL2. If your dev container feels sluggish, an optional next step is installing the WSL extension (ms-vscode-remote.remote-wsl), cloning the repo from inside your Ubuntu terminal instead (into ~/repos for example), and running code . from there. This isn't required to get started.

A majority of our development is done inside of devcontainers, this is something that you will repeat in the future as you take on more projects.

In the future you may need to install more extensions for specific languages, (EX: Python requires specific python extensions) but VSCode will prompt you for those usually when you open up a new repository.

On this page