JASMIN Help Site logo JASMIN Help Site logo
  • Docs 
  • Guides 
  • Training 
  • Discussions   

  •   Search this site  

Can't find what you're looking for?

Try our Google custom search, across all JASMIN sites

Docs
  • getting started
    • get started with jasmin
    • generate ssh key pair
    • get jasmin portal account
    • get login account
    • beginners training workshop
    • how to contact us about jasmin issues
    • jasmin status
    • jasmin training accounts
    • tips for new users
    • how to login
    • multiple account types
    • present ssh key
    • reconfirm email address
    • reset jasmin account password
    • ssh auth
    • storage
    • understanding new jasmin storage
    • update a jasmin account
  • interactive computing
    • interactive computing overview
    • check network details
    • login servers
    • login problems
    • graphical linux desktop access using nx
    • sci servers
    • tenancy sci analysis vms
    • transfer servers
    • jasmin notebooks service
    • jasmin notebooks service with gpus
    • creating a virtual environment in the notebooks service
    • project specific servers
    • dask gateway
    • access from vscode
  • batch computing
    • lotus overview
    • slurm scheduler overview
    • slurm queues
    • lotus cluster specification
    • how to monitor slurm jobs
    • how to submit a job
    • how to submit an mpi parallel job
    • example job 2 calc md5s
    • orchid gpu cluster
    • slurm status
    • slurm quick reference
  • software on jasmin
    • software overview
    • quickstart software envs
    • python virtual environments
    • additional software
    • community software esmvaltool
    • community software checksit
    • compiling and linking
    • conda environments and python virtual environments
    • conda removal
    • creating and using miniforge environments
    • idl
    • jasmin sci software environment
    • jasmin software faqs
    • jaspy envs
    • matplotlib
    • nag library
    • name dispersion model
    • geocat replaces ncl
    • postgres databases on request
    • running python on jasmin
    • running r on jasmin
    • rocky9 migration 2024
    • share software envs
  • data transfer
    • data transfer overview
    • data transfer tools
    • globus transfers with jasmin
    • bbcp
    • ftp and lftp
    • globus command line interface
    • globus connect personal
    • gridftp ssh auth
    • rclone
    • rsync scp sftp
    • scheduling automating transfers
    • transfers from archer2
  • short term project storage
    • apply for access to a gws
    • elastic tape command line interface hints
    • faqs storage
    • gws etiquette
    • gws scanner ui
    • gws scanner
    • gws alert system
    • install xfc client
    • xfc
    • introduction to group workspaces
    • jdma
    • managing a gws
    • secondary copy using elastic tape
    • share gws data on jasmin
    • share gws data via http
    • using the jasmin object store
    • configuring cors for object storage
  • long term archive storage
    • ceda archive
  • mass
    • external access to mass faq
    • how to apply for mass access
    • moose the mass client user guide
    • setting up your jasmin account for access to mass
  • for cloud tenants
    • introduction to the jasmin cloud
    • jasmin cloud portal
    • cluster as a service
    • cluster as a service kubernetes
    • cluster as a service identity manager
    • cluster as a service slurm
    • cluster as a service pangeo
    • cluster as a service shared storage
    • adding and removing ssh keys from an external cloud vm
    • provisioning tenancy sci vm managed cloud
    • sysadmin guidance external cloud
    • best practice
  • workflow management
    • rose cylc on jasmin
    • using cron
  • uncategorized
    • mobaxterm
    • requesting resources
    • processing requests for resources
    • acknowledging jasmin
    • approving requests for access
    • working with many linux groups
    • jasmin conditions of use
  • getting started
    • get started with jasmin
    • generate ssh key pair
    • get jasmin portal account
    • get login account
    • beginners training workshop
    • how to contact us about jasmin issues
    • jasmin status
    • jasmin training accounts
    • tips for new users
    • how to login
    • multiple account types
    • present ssh key
    • reconfirm email address
    • reset jasmin account password
    • ssh auth
    • storage
    • understanding new jasmin storage
    • update a jasmin account
  • interactive computing
    • interactive computing overview
    • check network details
    • login servers
    • login problems
    • graphical linux desktop access using nx
    • sci servers
    • tenancy sci analysis vms
    • transfer servers
    • jasmin notebooks service
    • jasmin notebooks service with gpus
    • creating a virtual environment in the notebooks service
    • project specific servers
    • dask gateway
    • access from vscode
  • batch computing
    • lotus overview
    • slurm scheduler overview
    • slurm queues
    • lotus cluster specification
    • how to monitor slurm jobs
    • how to submit a job
    • how to submit an mpi parallel job
    • example job 2 calc md5s
    • orchid gpu cluster
    • slurm status
    • slurm quick reference
  • software on jasmin
    • software overview
    • quickstart software envs
    • python virtual environments
    • additional software
    • community software esmvaltool
    • community software checksit
    • compiling and linking
    • conda environments and python virtual environments
    • conda removal
    • creating and using miniforge environments
    • idl
    • jasmin sci software environment
    • jasmin software faqs
    • jaspy envs
    • matplotlib
    • nag library
    • name dispersion model
    • geocat replaces ncl
    • postgres databases on request
    • running python on jasmin
    • running r on jasmin
    • rocky9 migration 2024
    • share software envs
  • data transfer
    • data transfer overview
    • data transfer tools
    • globus transfers with jasmin
    • bbcp
    • ftp and lftp
    • globus command line interface
    • globus connect personal
    • gridftp ssh auth
    • rclone
    • rsync scp sftp
    • scheduling automating transfers
    • transfers from archer2
  • short term project storage
    • apply for access to a gws
    • elastic tape command line interface hints
    • faqs storage
    • gws etiquette
    • gws scanner ui
    • gws scanner
    • gws alert system
    • install xfc client
    • xfc
    • introduction to group workspaces
    • jdma
    • managing a gws
    • secondary copy using elastic tape
    • share gws data on jasmin
    • share gws data via http
    • using the jasmin object store
    • configuring cors for object storage
  • long term archive storage
    • ceda archive
  • mass
    • external access to mass faq
    • how to apply for mass access
    • moose the mass client user guide
    • setting up your jasmin account for access to mass
  • for cloud tenants
    • introduction to the jasmin cloud
    • jasmin cloud portal
    • cluster as a service
    • cluster as a service kubernetes
    • cluster as a service identity manager
    • cluster as a service slurm
    • cluster as a service pangeo
    • cluster as a service shared storage
    • adding and removing ssh keys from an external cloud vm
    • provisioning tenancy sci vm managed cloud
    • sysadmin guidance external cloud
    • best practice
  • workflow management
    • rose cylc on jasmin
    • using cron
  • uncategorized
    • mobaxterm
    • requesting resources
    • processing requests for resources
    • acknowledging jasmin
    • approving requests for access
    • working with many linux groups
    • jasmin conditions of use
  1.   Interactive computing
  1. Home
  2. Docs
  3. Interactive computing
  4. Access from VSCode

Access from VSCode

 

Editor   Ssh   Remote  
Editor   Ssh   Remote  
Share via
JASMIN Help Site
Link copied to clipboard

How to access JASMIN from VSCode

On this page
Introduction   Obtaining VSCode   How to connect?   Essential steps   Specifying the key location   Further tips   Troubleshooting   Permission denied   Can’t connect to a remote host that previously worked  

Introduction  

Visual Studio Code  is a richly-featured editor and Integrated Development Environment (IDE) which has remote access and other useful features that can be used with JASMIN.

This article is in response to requests from users about how use VSCode with JASMIN and is not a product endorsement. Other IDEs with similar features are also available, for example PyCharm  .

The following demonstrates how to use VSCode to connect to JASMIN, and mentions some of its features for further reading.

Obtaining VSCode  

Follow the “setup” link from the page linked above to obtain VSCode for your platform: this should be your local machine, not JASMIN.

 

There should be no need for you to install VSCode on JASMIN, and we ask you not to.

We don’t provide it centrally, because the multitude of different extensions and configurations would be too difficult to manage in a multi-user environment, so it makes more sense if you install your own local instance of it, which you can configure as you like: the remote capabilities of VSCode make a central installation unnecessary.

Read about the following extensions and decide which you think you need (you can always “upgrade” later)

  • Remote-SSH extension 
    • enables you connect & remotely edit files
  • Remote Development extension pack 
    • this includes the Remote-SSH extension as well as others which enable a raft of other features.

You should read about those extensions first, at the links above, but actually install the one you choose by using the Extensions menu within VSCode once you’ve installed the application.

You will also almost certainly want the following for working with Python locally and on JASMIN.

  • Python  (includes Pylance and Python Debugger).

There are many, many other extensions to add, but you now have the most relevant ones to get you started.

These extensions are best installed locally, before connecting to any remote hosts.

How to connect?  

You will need to set up at least one SSH connection profile to a remote host on JASMIN: we’ll cover which host(s), shortly.

VSCode has a tool to help you set this up, and creates entries in your ~/.ssh/config file for the SSH client that you’re using.

  1. First consider your SSH client: VSCode will connect using the SSH client of your operating system: there isn’t one built into VSCode itself. See presenting your ssh key for details of the “agent” method: this is more convenient as this is persistent across sessions and you won’t be asked for your passphrase on each connection. If that doesn’t work for you, note the extra configuration below which can be added to specify the location of your key instead.

  2. Next, consider which remote host(s) on JASMIN you want to connect to:

  • login servers are available from any location, but don’t have any software or storage mounted other than your home directory
  • sci servers are probably where you want to work, but aren’t directly accessible from outside of the STFC network.
  • xfer servers might be a good choice if it’s just editing you’re likely to be doing, since they’re directly accessible from anywhere and have all filesystems mounted (except scratch). But they’re not for doing processing.

So the ideal setup might be 2 profiles as follows:

  1. sci server, accessed via a login server
  2. xfer server, accessed directly

If we use the tool provided by VSCode to create these, we can customise them further.

The following video demonstrates these steps, and the initial setup of 2 connection profiles, on Windows. But the interface is almost identical on Mac and Linux.

Notes:

  • the sequences have been shortened slightly while installing extensions and initiating the connection.
  • the demo shown assumes the SSH key is already loaded in an ssh-agent. To specify the key location instead, see below.
  • the -A option is only needed IF you will be making onward SSH connections from the remote host …this can be omitted if not

Essential steps  

  • Install the extensions
  • Create a connection profile
    • start by entering the one-liner command you would use to connect to a sci server via a login server, i.e.
      ssh -A username@sci-vm-01.jasmin.ac.uk -J username@login-01.jasmin.ac.uk
    • this creates an entry in ~/.ssh/config (it’s recommended to choose that location)
  • This entry can be customised, by editing that file
    • note that the Host is a “friendly name” which you can define, whereas HostName is the actual full name of the host including domain, e.g. sci-vm-01.jasmin.ac.uk
  • Add other entries as needed
    • in this case, we added a second profile for xfer-vm-01 which, being an xfer server, is directly accessible so does not need the ProxyJump
  • Save the file ~/.ssh/config and restart VSCode
  • The new profiles are available next time you open it
  • Connect to one of the remote hosts you just made
  • Open a terminal on that host
  • …and now you’re able to work on JASMIN

Specifying the key location  

Alternative method if you can’t get the “agent” method to work (but means that you may be prompted for the key passphrase each time you connect):

  • edit ~/.ssh/config and add the line with IdentityFile as shown:
Host sci-vm-01-via-login-01
  Hostname sci-vm-01.jasmin.ac.uk
  User username
  ProxyJump username@login-01.jasmin.ac.uk
  ForwardAgent yes
  IdentityFile ~/.ssh/id_ecdsa_jasmin

Further tips  

  • Editing large files may be slow compared to editing them in place on the remote server.
  • If you’re using VSCode locally without the remote host connection described above, you can still open a Terminal to use SSH commands to connect to remote hosts, but this will be without the integration that the full remote host connection provides (e.g. won’t display your remote directories and files in the explorer bar).
  • There’s a lot more that you can do with VSCode locally (even without the remote connection that this article describes).

For example:

  • syntax colouring and code auto-completion for a huge range of languages
  • Git integration  , note you need git installed locally(see git  for Windows)
  • Working with Jupyter notebooks  locally in VSCode

and many other features beyond the scope of this article.

This makes an IDE such as VSCode a good choice to install locally, rather than using the (fairly basic) editors available on JASMIN.

Troubleshooting  

Permission denied  

If you get permission denied when connecting, you should troubleshoot this as you would any other SSH connection.

Open a terminal within VSCode and check that your SSH key is being presented correctly. If it’s not listed when you do

ssh-add -l

then:

  • go back to presenting your ssh key and check your setup
  • alternatively, specify the location of your key as detailed above

Can’t connect to a remote host that previously worked  

VSCode starts a small server process on the remote host when you connect. Occasionally this can get stuck. One method of fixing this is to:

  • quit VSCode
  • from a separate SSH client terminal, log in to the same host
  • identify any .vscode-server process running on that host, e.g.
ps -ef | grep $USER | grep vscode
  • note the process ID (PID) number (1st numerical column) and kill that process
kill <PID>
  • recursively delete the ~/.vscode-server directory which VSCode created in your JASMIN home directory
rm -rf ~/.vscode-server
  • Retry connecting to the remote host
  • If that doesn’t work, try rebooting your own machine, then repeating the above steps.
Last updated on 2024-11-15 as part of:  update to ecdsa key (132a12e51)
On this page:
Introduction   Obtaining VSCode   How to connect?   Essential steps   Specifying the key location   Further tips   Troubleshooting   Permission denied   Can’t connect to a remote host that previously worked  
Follow us

Social media & development

   

Useful links

  • CEDA Archive 
  • CEDA Catalogue 
  • JASMIN 
  • JASMIN Accounts Portal 
  • JASMIN Projects Portal 
  • JASMIN Cloud Portal 
  • JASMIN Notebooks Service 
  • JASMIN Community Discussions 

Contact us

  • Helpdesk
UKRI/STFC logo
UKRI/NERC logo
NCAS logo
NCEO logo
Accessibility | Terms and Conditions | Privacy and Cookies
Copyright © 2025 Science and Technology Facilities Council.
Hinode theme for Hugo licensed under Creative Commons (CC BY-NC-SA 4.0).
JASMIN Help Site
Code copied to clipboard