Visual Studio Code
The following guide is for connecting to Neurodesktop using a VS Code installation running on your host machine.
Please see additional instructions below if Neurodesktop is running remotely (i.e. Cloud, HPC, VM)
Pre-requisites
Visual Studio Code (https://code.visualstudio.com) installed on your host. Standalone version should work fine Install the following VS Code extensions:
- Docker extension (Required)
- Remote development extension pack. Includes the following extensions
- Remote - Containers (Required)
- Remote - WSL (For windows hosts)
Connecting to Neurodesktop
Open VS Code and open a Folder (File > Open Folder)
This can be any folder (e.g. home or project folder). VS Code runs into errors if no folder is opened.
Open the Command Palette (Ctrl+Shift+P).
Select Remote-Containers: Attach to Running Container
from the dropdown panel
Start typing in ’neurodesktop. Select /neurodesktop
from the list
This should open a VS Code Window connected to the neurodesktop as a Dev Container.
This may take about a minute if it is the first time you are connecting, as VS code has to install the VS Code server onto the container. Repeat connections should be faster.
First time connection
The first time connection will default to using neurodesktop root user. We want the default connection to be as the normal user to avoid permission issues. To check which user is being used, open the terminal in the neurodesktop VS Code instance and check if the user is
user
orroot
Follow the following steps to configure your VS Code instance to connect to neurodesktop as normal user by default:
Open the Command Palette (Ctrl+Shift+P).
Select
Remote-Containers: Open Container Configuration File
from the dropdown panelThis will open a
neurodesktop%3alatest.json
file. Overwrite the file with the following contents
{
"workspaceFolder": "/home/user",
"remoteUser": "jovyan"
}
- Close this VS Code window. Use steps in previous section to connect normally
Useful Additions
Plugins to view neuroimaging data inside VScode: