1

I have some work stored on a remote work machine (Linux) and would like to work on it from home (MacOS). I have VSCode as my IDE and would like to know how to use it to open a file/directory of files on my remote machine. The command I tried was:

code magoo@remote.work.machine.com:/home/dev/app/groo/groo.py

But that just opens up VSCode with a new file named groo.py. How do I open up my remote file?

Giacomo1968
  • 55,001

2 Answers2

2

Running VS Code this way doesn't establish bidirectional communication with your remote server, it only pulls the files you tell it to open.

To establish this bidirectional connection, I use FUSE and SSHFS on my mac (OSX FUSE). You can mount a remote directory to a local one through an SSH tunnel

sshfs user@remote:port/path/to/remote/working/dir /path/to/local/working/dir

This allows you to access those remote files on your local machine. Opening VS Code in this local directory allows you to access and edit files on the remote server, using a local application.

0

If you can see the remote source file in the file explorer (in my case that was a windows samba share opened with nautilus) then you can right click it, choose visual code as the application and after asking if you trust it, VS code opens the file, then after this VS code also recognises the directory and you can open the remote folder in the GUI.

This worked to solve the same problem in Linux Debian, maybe it also works in OSX?