{"slug":"use-the-tailscale-extension-for-visual-studio-code","title":"Use the Tailscale extension for Visual Studio Code","tags":["tailscale"],"agent_summary":"Last validated: Jan 5, 2026","trigger_phrases":[],"runnable":false,"markdown":"\r\n# Use the Tailscale extension for Visual Studio Code\r\n\r\nLast validated: Jan 5, 2026\r\n\r\nThe Tailscale extension for [Visual Studio Code](https://code.visualstudio.com/) lets you interact with resources in your tailnet from within the VS Code IDE.\r\n\r\n## [Download and install the extension](https://tailscale.com/docs/integrations/vscode-extension\\#download-and-install-the-extension)\r\n\r\nYou can find the extension in the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Tailscale.vscode-tailscale), or [open the extension in VS Code](vscode:extension/Tailscale.vscode-tailscale).\r\n\r\n## [Using the Machine explorer](https://tailscale.com/docs/integrations/vscode-extension\\#using-the-machine-explorer)\r\n\r\nYou can interact with the machines in your tailnet from the primary sidebar in VS Code. Select the Tailscale icon, open the Tailscale Machine explorer, then select the machine that you want to access.\r\n\r\n![VS Code with the Tailscale Funnel and Machine explorer panels.](https://tailscale.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fmachine-explorer.55a5c75f.png&w=3840&q=75)\r\n\r\n[Tailscale SSH](https://tailscale.com/docs/features/tailscale-ssh) must be enabled on a machine to connect to it. Currently, this is only available on Linux devices or macOS devices running our [open source tailscale + tailscaled CLI](https://tailscale.com/docs/concepts/macos-variants).\r\n\r\n### [Connecting to a machine in your tailnet](https://tailscale.com/docs/integrations/vscode-extension\\#connecting-to-a-machine-in-your-tailnet)\r\n\r\nYou can start a new terminal session or attach VS Code to a machine for remote development in one selection. Hover over the machine you'd like to connect to, then select either the ![VS Code Terminal Icon](https://tailscale.com/_next/static/media/terminal.5150e7b8.svg) icon to start a terminal session, or the ![VS Code Remote Explorer Icon](https://tailscale.com/_next/static/media/remote-explorer.8d6cb6ae.svg) icon to attach the VS Code window to the machine.\r\n\r\n#### [Resolving common issues with SSH usernames](https://tailscale.com/docs/integrations/vscode-extension\\#resolving-common-issues-with-ssh-usernames)\r\n\r\nIf you are using the VS Code remote connection feature and your username on the remote instance is different from your local username, you'll need to specify the remote username in your local SSH configuration. Otherwise, you may encounter connection issues.\r\n\r\nFollow the steps below to configure your SSH settings:\r\n\r\n1. Find the remote instance by opening the Tailscale machine explorer. Right-click on the node you want to connect to, and select **Copy DNS name**.\r\n2. Edit your SSH configuration by opening your local SSH configuration file. This is typically located in `~/.ssh/config`.\r\n3. Add the remote user configuration by inserting a new section into the configuration file for the remote server. Replace `my-server.example.ts.net` with the copied DNS name from the first step and `alice` with your remote username.\r\n\r\n```markup\r\nHost my-server.example.ts.net\r\n  User alice\r\n```\r\n\r\nBy configuring the SSH settings with the correct remote username, you should be able to successfully connect to the remote instance using VS Code.\r\n\r\n### [Editing files on a machine in your tailnet](https://tailscale.com/docs/integrations/vscode-extension\\#editing-files-on-a-machine-in-your-tailnet)\r\n\r\nTo read and edit files on a machine in your tailnet, expand the machine, then select the **File explorer** item. You must have [enabled Tailscale SSH](https://tailscale.com/docs/features/tailscale-ssh) on the machine to use the file explorer.\r\n\r\nThe first time you open the file explorer for a machine, the extension will prompt you for an SSH username to use for that machine. This username will be locally cached to use for future connections to this machine. If you'd like to change the SSH username later, right-click on the machine and select **Change SSH username** from the context menu.\r\n\r\nYou can add new files or directories in the file explorer by right-clicking on a directory and selecting **New file** or **New directory**. To rename or delete an existing file or directory, right-click on the item and select **Rename** or **Delete** from the context menu.\r\n\r\nDeleting a file or folder from the file explorer is a permanent action and cannot be undone.\r\n\r\n#### [Changing the root directory](https://tailscale.com/docs/integrations/vscode-extension\\#changing-the-root-directory)\r\n\r\nBy default, the File explorer will open the home folder (`~/`) of the username you provided. You can change the root folder by right-clicking on the machine and selecting **Change root directory** from the context menu.\r\n\r\n## [Start Tailscale Funnel](https://tailscale.com/docs/integrations/vscode-extension\\#start-tailscale-funnel)\r\n\r\nYou can set up [Tailscale Funnel](https://tailscale.com/docs/features/tailscale-funnel) inside of VS Code using the command palette or the Tailscale panel. You must have Funnel [enabled in your tailnet access control policies](https://tailscale.com/docs/features/tailscale-funnel#setup) to take advantage of this feature.\r\n\r\nThe VS Code extension lets you expose one port on your local machine to the public internet with Funnel. To expose multiple ports, use the [Funnel CLI](https://tailscale.com/docs/reference/examples/funnel).\r\n\r\nTo use Funnel, you must [enable MagicDNS](https://tailscale.com/docs/features/magicdns#enabling-magicdns) and [HTTPS certificates](https://tailscale.com/docs/how-to/set-up-https-certificates) in the admin console, and [add the appropriate node attribute](https://tailscale.com/docs/features/tailscale-funnel#node-attribute-required) (`nodeAttrs`) to your tailnet policy file.\r\n\r\n### [Using the Funnel panel](https://tailscale.com/docs/integrations/vscode-extension\\#using-the-funnel-panel)\r\n\r\nYour browser does not support the video tag.\r\n\r\n1. Open the panel. You can use the keyboard shortcut `CMD` \\+ `J`.\r\n2. Enter the local port you want to expose over the internet in the **port** field.\r\n3. Select **Start** to begin serving this port over the internet.\r\n\r\nYou can open the public URL in your default browser or copy it to your clipboard. To edit the existing Funnel configuration in this panel, change the port number and select the **Update** button.\r\n\r\n### [Using Funnel from the command palette](https://tailscale.com/docs/integrations/vscode-extension\\#using-funnel-from-the-command-palette)\r\n\r\nYour browser does not support the video tag.\r\n\r\n1. Open the command palette with the keyboard shortcut `CMD` \\+ `Shift` \\+ `P`.\r\n2. Type **Tailscale** to explore all the extension's commands.\r\n3. To start Tailscale Funnel, choose **Tailscale: Share port publicly using Funnel**.\r\n4. Enter the port number that you wish to share through Funnel.\r\n\r\n### [Port discovery](https://tailscale.com/docs/integrations/vscode-extension\\#port-discovery)\r\n\r\nYour browser does not support the video tag.\r\n\r\nWhen you start a local server from VS Code, Tailscale will ask if you'd like to share that port over the internet with Funnel.\r\n\r\n## [Troubleshooting](https://tailscale.com/docs/integrations/vscode-extension\\#troubleshooting)\r\n\r\n### [Troubleshooting the machine explorer in the VS Code extension](https://tailscale.com/docs/integrations/vscode-extension\\#troubleshooting-the-machine-explorer-in-the-vs-code-extension)\r\n\r\nIf the Machine explorer isn't working as expected, we recommend the following steps:\r\n\r\n1. Check that Tailscale SSH is enabled in access control policies on the machines you want to connect to. For now, this functionality is only available on Linux devices and macOS devices running our [open source Tailscale + tailscaled CLI](https://tailscale.com/docs/concepts/macos-variants). This means that some features of the Machine explorer won't work for Windows devices, iOS/Android devices, or macOS devices running the App Store or Standalone variant of the macOS app.\r\n2. Check that your [access control policies](https://tailscale.com/docs/features/access-control) are set to [allow Tailscale SSH access](https://tailscale.com/docs/features/tailscale-ssh) between your local machine and the machine you want to connect to.\r\n3. Ensure that you're using a valid username that already exists on the machine. If you need to change the username to something else, right-click on the machine and select **Change SSH username** from the context menu.\r\n\r\n### [Troubleshooting Funnel in the VS Code extension](https://tailscale.com/docs/integrations/vscode-extension\\#troubleshooting-funnel-in-the-vs-code-extension)\r\n\r\nIf Funnel isn't working as expected, we recommend the following steps:\r\n\r\n1. Check to ensure that Tailscale is signed in and active. On macOS and Windows, you can do this by selecting the Tailscale icon in your OS status bar. On Linux, run `tailscale status` in your CLI.\r\nIf you have signed in to multiple Tailscale accounts on your device, ensure that the correct account is active.\r\n2. Ensure that your tailnet [access controls](https://tailscale.com/docs/features/access-control) are [configured to allow Tailscale Funnel](https://tailscale.com/docs/features/tailscale-funnel#setup) on your device.\r\n3. Ensure that [MagicDNS and HTTPS Certificates are enabled](https://tailscale.com/docs/how-to/set-up-https-certificates) in your tailnet.\r\n4. Ensure `tailscale` is available in the environment path. You can check this by running `tailscale status` in your CLI; if no command is found, you may need to add the Tailscale executable to your path. Alternatively, you can set its path using the `tailscale.path` setting in VS Code.\r\n\r\n## [Configuration](https://tailscale.com/docs/integrations/vscode-extension\\#configuration)\r\n\r\n- `tailscale.path`: A path to the `tailscale` executable. If unset, the extension will use\r\nthe environment path to resolve the `tailscale` executable. If set, the extension\r\nwill use the supplied path. The path should include the executable name (for example,\r\n`/usr/bin/tailscale`, `C:\\Program Files\\tailscale\\tailscale.exe`).\r\n","html":"<h1>Use the Tailscale extension for Visual Studio Code</h1>\n<p>Last validated: Jan 5, 2026</p>\n<p>The Tailscale extension for <a href=\"https://code.visualstudio.com/\">Visual Studio Code</a> lets you interact with resources in your tailnet from within the VS Code IDE.</p>\n<h2><a href=\"https://tailscale.com/docs/integrations/vscode-extension#download-and-install-the-extension\">Download and install the extension</a></h2>\n<p>You can find the extension in the <a href=\"https://marketplace.visualstudio.com/items?itemName=Tailscale.vscode-tailscale\">VS Code Marketplace</a>, or <a href=\"vscode:extension/Tailscale.vscode-tailscale\">open the extension in VS Code</a>.</p>\n<h2><a href=\"https://tailscale.com/docs/integrations/vscode-extension#using-the-machine-explorer\">Using the Machine explorer</a></h2>\n<p>You can interact with the machines in your tailnet from the primary sidebar in VS Code. Select the Tailscale icon, open the Tailscale Machine explorer, then select the machine that you want to access.</p>\n<p><img src=\"https://tailscale.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fmachine-explorer.55a5c75f.png&#x26;w=3840&#x26;q=75\" alt=\"VS Code with the Tailscale Funnel and Machine explorer panels.\"></p>\n<p><a href=\"https://tailscale.com/docs/features/tailscale-ssh\">Tailscale SSH</a> must be enabled on a machine to connect to it. Currently, this is only available on Linux devices or macOS devices running our <a href=\"https://tailscale.com/docs/concepts/macos-variants\">open source tailscale + tailscaled CLI</a>.</p>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#connecting-to-a-machine-in-your-tailnet\">Connecting to a machine in your tailnet</a></h3>\n<p>You can start a new terminal session or attach VS Code to a machine for remote development in one selection. Hover over the machine you'd like to connect to, then select either the <img src=\"https://tailscale.com/_next/static/media/terminal.5150e7b8.svg\" alt=\"VS Code Terminal Icon\"> icon to start a terminal session, or the <img src=\"https://tailscale.com/_next/static/media/remote-explorer.8d6cb6ae.svg\" alt=\"VS Code Remote Explorer Icon\"> icon to attach the VS Code window to the machine.</p>\n<h4><a href=\"https://tailscale.com/docs/integrations/vscode-extension#resolving-common-issues-with-ssh-usernames\">Resolving common issues with SSH usernames</a></h4>\n<p>If you are using the VS Code remote connection feature and your username on the remote instance is different from your local username, you'll need to specify the remote username in your local SSH configuration. Otherwise, you may encounter connection issues.</p>\n<p>Follow the steps below to configure your SSH settings:</p>\n<ol>\n<li>Find the remote instance by opening the Tailscale machine explorer. Right-click on the node you want to connect to, and select <strong>Copy DNS name</strong>.</li>\n<li>Edit your SSH configuration by opening your local SSH configuration file. This is typically located in <code>~/.ssh/config</code>.</li>\n<li>Add the remote user configuration by inserting a new section into the configuration file for the remote server. Replace <code>my-server.example.ts.net</code> with the copied DNS name from the first step and <code>alice</code> with your remote username.</li>\n</ol>\n<pre><code class=\"language-markup\">Host my-server.example.ts.net\r\n  User alice\n</code></pre>\n<p>By configuring the SSH settings with the correct remote username, you should be able to successfully connect to the remote instance using VS Code.</p>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#editing-files-on-a-machine-in-your-tailnet\">Editing files on a machine in your tailnet</a></h3>\n<p>To read and edit files on a machine in your tailnet, expand the machine, then select the <strong>File explorer</strong> item. You must have <a href=\"https://tailscale.com/docs/features/tailscale-ssh\">enabled Tailscale SSH</a> on the machine to use the file explorer.</p>\n<p>The first time you open the file explorer for a machine, the extension will prompt you for an SSH username to use for that machine. This username will be locally cached to use for future connections to this machine. If you'd like to change the SSH username later, right-click on the machine and select <strong>Change SSH username</strong> from the context menu.</p>\n<p>You can add new files or directories in the file explorer by right-clicking on a directory and selecting <strong>New file</strong> or <strong>New directory</strong>. To rename or delete an existing file or directory, right-click on the item and select <strong>Rename</strong> or <strong>Delete</strong> from the context menu.</p>\n<p>Deleting a file or folder from the file explorer is a permanent action and cannot be undone.</p>\n<h4><a href=\"https://tailscale.com/docs/integrations/vscode-extension#changing-the-root-directory\">Changing the root directory</a></h4>\n<p>By default, the File explorer will open the home folder (<code>~/</code>) of the username you provided. You can change the root folder by right-clicking on the machine and selecting <strong>Change root directory</strong> from the context menu.</p>\n<h2><a href=\"https://tailscale.com/docs/integrations/vscode-extension#start-tailscale-funnel\">Start Tailscale Funnel</a></h2>\n<p>You can set up <a href=\"https://tailscale.com/docs/features/tailscale-funnel\">Tailscale Funnel</a> inside of VS Code using the command palette or the Tailscale panel. You must have Funnel <a href=\"https://tailscale.com/docs/features/tailscale-funnel#setup\">enabled in your tailnet access control policies</a> to take advantage of this feature.</p>\n<p>The VS Code extension lets you expose one port on your local machine to the public internet with Funnel. To expose multiple ports, use the <a href=\"https://tailscale.com/docs/reference/examples/funnel\">Funnel CLI</a>.</p>\n<p>To use Funnel, you must <a href=\"https://tailscale.com/docs/features/magicdns#enabling-magicdns\">enable MagicDNS</a> and <a href=\"https://tailscale.com/docs/how-to/set-up-https-certificates\">HTTPS certificates</a> in the admin console, and <a href=\"https://tailscale.com/docs/features/tailscale-funnel#node-attribute-required\">add the appropriate node attribute</a> (<code>nodeAttrs</code>) to your tailnet policy file.</p>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#using-the-funnel-panel\">Using the Funnel panel</a></h3>\n<p>Your browser does not support the video tag.</p>\n<ol>\n<li>Open the panel. You can use the keyboard shortcut <code>CMD</code> + <code>J</code>.</li>\n<li>Enter the local port you want to expose over the internet in the <strong>port</strong> field.</li>\n<li>Select <strong>Start</strong> to begin serving this port over the internet.</li>\n</ol>\n<p>You can open the public URL in your default browser or copy it to your clipboard. To edit the existing Funnel configuration in this panel, change the port number and select the <strong>Update</strong> button.</p>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#using-funnel-from-the-command-palette\">Using Funnel from the command palette</a></h3>\n<p>Your browser does not support the video tag.</p>\n<ol>\n<li>Open the command palette with the keyboard shortcut <code>CMD</code> + <code>Shift</code> + <code>P</code>.</li>\n<li>Type <strong>Tailscale</strong> to explore all the extension's commands.</li>\n<li>To start Tailscale Funnel, choose <strong>Tailscale: Share port publicly using Funnel</strong>.</li>\n<li>Enter the port number that you wish to share through Funnel.</li>\n</ol>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#port-discovery\">Port discovery</a></h3>\n<p>Your browser does not support the video tag.</p>\n<p>When you start a local server from VS Code, Tailscale will ask if you'd like to share that port over the internet with Funnel.</p>\n<h2><a href=\"https://tailscale.com/docs/integrations/vscode-extension#troubleshooting\">Troubleshooting</a></h2>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#troubleshooting-the-machine-explorer-in-the-vs-code-extension\">Troubleshooting the machine explorer in the VS Code extension</a></h3>\n<p>If the Machine explorer isn't working as expected, we recommend the following steps:</p>\n<ol>\n<li>Check that Tailscale SSH is enabled in access control policies on the machines you want to connect to. For now, this functionality is only available on Linux devices and macOS devices running our <a href=\"https://tailscale.com/docs/concepts/macos-variants\">open source Tailscale + tailscaled CLI</a>. This means that some features of the Machine explorer won't work for Windows devices, iOS/Android devices, or macOS devices running the App Store or Standalone variant of the macOS app.</li>\n<li>Check that your <a href=\"https://tailscale.com/docs/features/access-control\">access control policies</a> are set to <a href=\"https://tailscale.com/docs/features/tailscale-ssh\">allow Tailscale SSH access</a> between your local machine and the machine you want to connect to.</li>\n<li>Ensure that you're using a valid username that already exists on the machine. If you need to change the username to something else, right-click on the machine and select <strong>Change SSH username</strong> from the context menu.</li>\n</ol>\n<h3><a href=\"https://tailscale.com/docs/integrations/vscode-extension#troubleshooting-funnel-in-the-vs-code-extension\">Troubleshooting Funnel in the VS Code extension</a></h3>\n<p>If Funnel isn't working as expected, we recommend the following steps:</p>\n<ol>\n<li>Check to ensure that Tailscale is signed in and active. On macOS and Windows, you can do this by selecting the Tailscale icon in your OS status bar. On Linux, run <code>tailscale status</code> in your CLI.\r\nIf you have signed in to multiple Tailscale accounts on your device, ensure that the correct account is active.</li>\n<li>Ensure that your tailnet <a href=\"https://tailscale.com/docs/features/access-control\">access controls</a> are <a href=\"https://tailscale.com/docs/features/tailscale-funnel#setup\">configured to allow Tailscale Funnel</a> on your device.</li>\n<li>Ensure that <a href=\"https://tailscale.com/docs/how-to/set-up-https-certificates\">MagicDNS and HTTPS Certificates are enabled</a> in your tailnet.</li>\n<li>Ensure <code>tailscale</code> is available in the environment path. You can check this by running <code>tailscale status</code> in your CLI; if no command is found, you may need to add the Tailscale executable to your path. Alternatively, you can set its path using the <code>tailscale.path</code> setting in VS Code.</li>\n</ol>\n<h2><a href=\"https://tailscale.com/docs/integrations/vscode-extension#configuration\">Configuration</a></h2>\n<ul>\n<li><code>tailscale.path</code>: A path to the <code>tailscale</code> executable. If unset, the extension will use\r\nthe environment path to resolve the <code>tailscale</code> executable. If set, the extension\r\nwill use the supplied path. The path should include the executable name (for example,\r\n<code>/usr/bin/tailscale</code>, <code>C:\\Program Files\\tailscale\\tailscale.exe</code>).</li>\n</ul>\n"}