Coder.comC
Coder.com4y ago
2 replies
niik

VS Code remote - SSH re-installing code-server

Hello

Is it normal for VS code to re-install code server on first connect using SSH?
Also the extensions I install from the browser app code-server are not installed when I connect to the workspace with VS Code Remote SSH.

I am running Coder in Kubernetes and using the default Kubernetes template, with the only change being addition of "storage_provider_name" so that data persists correctly in my environment.

The pictures show that the code-server is up and running with me connected from the web-app, and VS code also installing over SSH.
The other picture shows that I have the Terraform extension installed on the web-app but the SSH connection needs me to install it again.

This is the code-server install that is in the workspace template
resource "coder_agent" "main" {
  os             = "linux"
  arch           = "amd64"
  startup_script = <<EOT
    #!/bin/bash

    # home folder can be empty, so copying default bash settings
    if [ ! -f ~/.profile ]; then
      cp /etc/skel/.profile $HOME
    fi
    if [ ! -f ~/.bashrc ]; then
      cp /etc/skel/.bashrc $HOME
    fi

    # install and start code-server
    curl -fsSL https://code-server.dev/install.sh | sh  | tee code-server-install.log
    code-server --auth none --port 13337 | tee code-server-install.log &
  EOT
}

These are the host definitions that VS code is using
Host coder.demo
    HostName coder.demo
    ConnectTimeout=0
    StrictHostKeyChecking=no
    UserKnownHostsFile=/dev/null
    LogLevel ERROR
    ProxyCommand "C:\Program Files\Coder\bin\coder.exe" --global-config C:\Users\samui\AppData\Roaming\coderv2 ssh --stdio demo
Host coder.demo.main
    HostName coder.demo.main
    ConnectTimeout=0
    StrictHostKeyChecking=no
    UserKnownHostsFile=/dev/null
    LogLevel ERROR
    ProxyCommand "C:\Program Files\Coder\bin\coder.exe" --global-config C:\Users\samui\AppData\Roaming\coderv2 ssh --stdio demo.main

P.S. why are there 2 for the same workspace Pod?

Thanks for the help
image.png
image.png
Was this page helpful?