VSCode Remote Devcontainer
Overview
A quick run through on the basics of Devcontainers on a remote system.
Prerequisites
- A remote system you can SSH or SSM into
- VSCode and the Visual Studio Code Remote Development Extension Pack
Connecting
- Open VSCode
- Connect to the remote system
- Connect VSCode to the remote
-
If they are not present, install the remote prerequisites
$ sudo apt-get update $ sudo apt -y install git docker.io $ sudo usermod -aG docker admin -
killthe remote VSCode server to reinvoke a login shell and reread supplemental group membership. Reconnect and verify membership of thedockergroupNote: see this issue for further detail.
$ pkill -f .vscode-server $ groups admin adm dialout cdrom floppy sudo audio dip video plugdev docker -
Set up the VSCode workspace
$ mkdir ~/workspace $ cd ~/workspace/ $ git clone https://github.com/wmcdonald404/devcontainer-python - In VSCode,
CTRL-SHIFT-Pand selectDev Containers: Clone Repository in Container Volume..., clone the repository into a new running devcontainer on the remote host.