Remote development on VS Code

Payam Zahedi
Snapp Embedded
Published in
4 min readJan 30, 2024

--

Embarking on remote development can be a daunting task, riddled with uncertainties.
Where do you begin? Do you install your entire development stack on the remote machine before diving into coding? The intricacies of remote development have long been a stumbling block for many developers. However, with the advent of Visual Studio Code’s Remote — SSH extension, navigating these complexities becomes a breeze. Imagine a scenario where you can seamlessly connect to a remote machine, eliminating the need for extensive setup before you start coding.

In this article, we delve into the transformative realm of Visual Studio Code’s Remote — SSH extension, guiding you on the journey to seamlessly develop your code directly on your remote machine.

How did I find it?

As a Flutter developer focused on embedded Flutter, a recurring challenge involves crafting and deploying code on the Raspberry Pi. The Remote SSH extension was an absolute turning point that quickly became an integral part of my daily development routine.

Picture the traditional scenario: setting up a Raspberry Pi with an array of peripherals, from mouse and keyboard to a monitor, not to mention the obligatory software installations. This ritual was a time-consuming necessity until the Remote — SSH extension entered the scene.

In essence, my use case illustrates a crucial point: this extension isn’t limited to server development. It’s your go-to solution for coding anywhere with an SSH connection — be it on a Raspberry Pi, a server, or any SSH-capable device.

Installation

Setting up the Remote — SSH extension in your VSCode is quick and easy. Open VS Code on your Host machine and follow these steps.

  1. Navigate to the Extension Section
  2. Search for “Remote SSH”
  3. Install the Remote-SSH Extension
Remote SSH installation

Connect to Remote device

Once you’ve successfully installed the Remote — SSH extension, connecting to your remote device is a straightforward process. Here’s a simple guide to get you started:

  1. Open the Command Palette: Press Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac) to open the command palette within VSCode.
  2. Type and Select “Remote-SSH: Add New SSH Host…”

In the upcoming section, you’ll be prompted to input the specific SSH command necessary for establishing a connection with your remote machine.

Feel free to use either the IP address or hostname of your remote machine for connection.

Feel free to use either the IP address or hostname of your remote machine for connection. In my case, the username for my Raspberry Pi is “pi,” and I’ve assigned the hostname “kiosk.” Consequently, I’ve entered the SSH command as follows:

ssh pi@kiosk.local

Now, locate your device within the dedicated Remote-SSH tab. Utilize the “Connect” button (→) to establish a connection with your remote device. Be sure to input the password for your remote machine when prompted. This straightforward process ensures a secure and hassle-free connection through the Remote — SSH extension.

Congratulations! You’re now seamlessly connected to your device. Effortlessly open a folder through the “Explorer” tab. If prompted, you might need to re-enter the password for added security.

Developing

This extension significantly enhances your development experience. Consider a scenario where delving into library source code is essential for a deeper understanding. With the Remote — SSH extension, you can seamlessly install libraries on your host machine and effortlessly navigate through their source code. This proves invaluable, especially when dealing with platform-specific libraries that might be challenging to install directly on your local environment. This feature not only streamlines your workflow but also opens up new avenues for learning and exploring code in a hassle-free manner.

Conclusion

In a nutshell, the Remote — SSH extension for Visual Studio Code is a game-changer, simplifying and enhancing your development experience. From effortless installation to connecting to remote devices and exploring source code, it streamlines every step of the process.

This extension transcends the limits of local development, making it a versatile tool for various scenarios.

Incorporate the Remote — SSH extension into your toolkit for a seamless coding experience anywhere. It opens new horizons and redefines the way developers work.

If you are interested on Flutter embedded topic, make sure to follow Me and Snapp Embedded on 𝕏.

--

--

Payam Zahedi
Snapp Embedded

I’m a Software Engineer, Flutter Developer, Speaker & Open Source Lover. find me in PayamZahedi.com