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
}
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
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
No description
No description
2 Replies
Phorcys
Phorcys2y ago
I think the fact it's installing the "VS Code server" is normal, since it's not the same as code-server, I think it's being used for file transfer and remote actions like installing extensions (i.e it's the server used to communicate from your VSCode to any server). The extensions are not the same on your VSCode and on code-server because they are not using the same extension marketplace, code-server uses OpenVSIX which doesn't have every extension. You can get code-server to use Microsoft's extension store using environment variables but it might be against ToS so I won't help you with that although it is fairly easy to do it.
niik
niik2y ago
Ok that all makes sense. I forgot that "microsoft VS Code" that comes pre-compiled is different than VS code compiled from source. Thanks for the help
Want results from more Discord servers?
Add your server