Skip to content

Using vscode-tailscale in code-server #318

Description

@aasmoe

Have anyone managed to get tailscale extension running on code-server? I have succesfully mounted my stack`s tailscale socket to the extension and I am getting a list of tailscale nodes. When I try to ssh or show file tree of a node, I get a login authentication link in tailscale logs, but after authenticating I get errors in vsc tailscale like this:

2025-07-27 20:48:48.882 [error] [ssh-conn-manager] Failed to connect to xxx.tailxxx.ts.net with username root: Timed out while waiting for handshake 2025-07-27 20:48:48.882 [error] [tsFs-sftp] readDirectory: Error: Timed out while waiting for handshake

Have anyone had success in setting this up? It would be amazingly good if I could. I already love the vsc tailscale extension and I would love to use it remotely.

My docker setup:

(I am using tailscale as code-server´s network mode, as this at least gave me the authentication link)

services:
  tailscale:
    image: tailscale/tailscale:latest
    container_name: tailscale
    hostname: code-stack
    networks:
        - caddy
        - socket_proxy
    environment:
      - TS_AUTHKEY=${TS_AUTHKEY}
      #- TS_EXTRA_ARGS=--advertise-tags=tag:container
      - TS_STATE_DIR=/var/lib/tailscale
      - TS_USERSPACE=false
      - TS_SOCKET=/var/run/tailscale/tailscaled.sock
    volumes:
      - ${PWD}/tailscale-caddy/state:/var/lib/tailscale
      - ./tailscale-caddy/socket:/var/run/tailscale
    devices:
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - net_admin
    restart: unless-stopped
    labels:
      caddy: code.domain.com # Caddy will route traffic for this domain
      caddy.reverse_proxy: "{{upstreams 8443}}"

  code-server:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    network_mode: service:tailscale
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Oslo
    #ports:
    #  - 8443:8443
    volumes:
      - ./config:/config
      - ../../tailscale-caddy/socket:/var/run/tailscale
    restart: unless-stopped

I am suspecting the tailscale extension is not getting a confirmation after authenticating..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions