You want to use GitHub Copilot for code suggestions while editing files on a remote server through VS Code’s SSH FS extension. The SSH FS extension mounts remote directories as a local filesystem, but Copilot’s language server cannot connect to the remote environment by default. This article explains how to configure VS Code and the SSH FS extension so Copilot can provide inline completions and chat assistance on remote files.
Key Takeaways: Enabling Copilot on SSH FS Remote Code
- VS Code Remote SSH extension: The recommended alternative to SSH FS for full Copilot integration with remote language servers.
- GitHub Copilot extension settings: Set
github.copilot.advancedto allow remote connections when using SSH FS. - SSH FS workspace configuration: Add
"remote.SSH.path"in settings.json to point Copilot to the remote Node.js runtime.
Understanding the SSH FS and Copilot Compatibility Gap
SSH FS is a VS Code extension that mounts a remote server’s filesystem as a virtual workspace. It does not run VS Code’s remote server on the remote machine. This means Copilot’s language server, which analyzes code context and generates suggestions, runs only on your local machine and cannot access the remote runtime environment. When you open a file via SSH FS, Copilot sees a local copy of the file but lacks the remote project’s dependencies, build tools, and language services.
The root cause is that Copilot relies on the Language Server Protocol to understand code structure. The SSH FS extension does not implement a remote language server bridge. As a result, Copilot may show no suggestions, show generic suggestions, or fail to activate entirely. To fix this, you need to either switch to a fully remote VS Code setup or manually configure Copilot to connect to the remote Node.js process.
How Copilot Detects Remote Workspaces
Copilot checks the workspace type in VS Code. When using SSH FS, the workspace appears as a local folder. Copilot’s internal logic treats it as a local workspace and attempts to start the language server locally. Because the remote dependencies are missing, the language server cannot parse the code correctly and returns no completions.
Steps to Configure GitHub Copilot for SSH FS Workspaces
- Install the required extensions
Open VS Code and install the GitHub Copilot extension from the marketplace. Also install the SSH FS extension if you have not already. Restart VS Code after installation. - Open your SSH FS workspace
Use the SSH FS extension to connect to your remote server. Navigate to the SSH FS view in the activity bar, click the plus icon, and enter your SSH connection details. Select the remote folder you want to work with. - Enable Copilot for remote workspaces
Open VS Code settings by pressing Ctrl + , on Windows or Cmd + , on Mac. Search forgithub.copilot.advanced. Set the optionGitHub Copilot: AdvancedtoAllow. This tells Copilot to treat SSH FS workspaces as remote and start the language server accordingly. - Configure the remote Node.js path
In the same settings window, search forremote.SSH.path. Enter the full path to the Node.js executable on your remote server, for example/usr/bin/node. This step is required only if the remote server does not have Node.js in the default PATH. Copilot uses Node.js to run the language server. - Restart the Copilot language server
Press Ctrl + Shift + P to open the command palette. TypeDeveloper: Reload Windowand press Enter. This restarts VS Code and applies all settings. Open a code file in the SSH FS workspace. You should see Copilot suggestions appear as you type.
Alternative Method: Use VS Code Remote SSH Instead
If the above configuration does not work, the most reliable solution is to switch from SSH FS to the official VS Code Remote SSH extension. This extension runs the full VS Code server on the remote machine, including the Copilot language server. To use it, install the Remote SSH extension, click the blue remote indicator in the bottom-left corner, and select Connect to Host. Enter your SSH details. VS Code reloads with a remote context, and Copilot works natively.
Copilot Still Not Working in SSH FS Workspaces
Copilot shows no suggestions at all
If Copilot does not appear after configuration, check the Copilot status icon in the bottom-right corner of VS Code. A circle with a line through it means Copilot is disabled. Click the icon and select Enable Copilot. Also verify that your GitHub account is signed in and has an active Copilot subscription.
Copilot suggests local code instead of remote project code
This happens when Copilot cannot access the remote project’s context. Open the VS Code output panel by pressing Ctrl + Shift + U. In the dropdown, select GitHub Copilot. Look for errors such as ENOENT or cannot find module. These indicate that the remote Node.js path is incorrect. Update the path in settings and reload the window.
Copilot chat does not work in SSH FS workspace
Copilot Chat requires the same remote language server as completions. If you configured the advanced setting but chat still fails, ensure you have the GitHub Copilot Chat extension installed. Then open the command palette, type Copilot: Open Chat, and check if the chat panel loads. If it shows an error, switch to the Remote SSH method described above.
SSH FS vs VS Code Remote SSH for Copilot: Key Differences
| Item | SSH FS | VS Code Remote SSH |
|---|---|---|
| Description | Mounts remote filesystem as a local workspace | Runs full VS Code server on the remote machine |
| Copilot language server | Runs locally, may lack remote context | Runs on remote machine with full project context |
| Configuration effort | Requires manual settings for remote Node path | Works out of the box after connecting |
| Performance | Faster for simple file editing | Slower initial connect, but smoother for complex projects |
| Best for | Quick edits on a few files | Full development on remote codebases |
If you need Copilot for occasional file edits on a remote server, the SSH FS method with manual configuration can work. For daily development with multiple files and dependencies, use VS Code Remote SSH.
You can now configure GitHub Copilot in SSH FS workspaces by enabling the advanced remote setting and specifying the remote Node.js path. For a more reliable experience, consider switching to the VS Code Remote SSH extension which provides full language server support. As an advanced tip, you can set the github.copilot.advanced setting at the workspace level in .vscode/settings.json so each SSH FS project uses its own configuration.