C
Coder.com7mo ago
-maV.

coder_2.10.2_windows_amd64_installer.exe vs. WSL installation method for code-server? (VS-CODE)

Hey all! I tried using coder_2.10.2_windows_amd64_installer.exe installation and get the Error: Invalid Coder SSH authority. Agent not found! error message. On the web interface, I get a status code 500 error on the Deployment > General page. Just to start things off, I would ideally like to have a simple localhost environment that I can pair my PC and laptop together to test out VS-code environment sharing, then move on from there. Is there something I may have glazed over in the guides? Is there a video tutorial that might help me specifically? I would keep with coder_2.10.2_windows_amd64_installer.exe method, but I would like the most tried and true setup I can use. All help and feedback is super appreciated!!! Thanks!
69 Replies
Codercord
Codercord7mo ago
<#1236013100348604538>
Category
Help needed
Product
Coder OSS (v2)
Platform
Windows
Logs
Please post any relevant logs/error messages.
Atif
Atif7mo ago
How are you running Coder after the installation? Could you uninstall this and try again with winget install Coder.Coder Just to see if installation goes fine.
-maV.
-maV.OP7mo ago
Hey Atif! So I just installed it but it looks like the env VAR isn't working I can't use coder server in powershell or CMD
winget install Coder.Coder
Found Coder [Coder.Coder] Version 2.10.2
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/coder/coder/releases/download/v2.10.2/coder_2.10.2_windows_amd64_installer.exe
██████████████████████████████ 78.8 MB / 78.8 MB
Successfully verified installer hash
Starting package install...
Successfully installed
winget install Coder.Coder
Found Coder [Coder.Coder] Version 2.10.2
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/coder/coder/releases/download/v2.10.2/coder_2.10.2_windows_amd64_installer.exe
██████████████████████████████ 78.8 MB / 78.8 MB
Successfully verified installer hash
Starting package install...
Successfully installed
Atif
Atif7mo ago
And what do you get when you run coder server?
-maV.
-maV.OP7mo ago
PS C:\Windows\system32> coder server
coder : The term 'coder' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ coder server
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (coder:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Windows\system32> coder server
coder : The term 'coder' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ coder server
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (coder:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
so I could just CD to the coder dir but env var should just work no? I CD'd into the dir .\coder server and it starts and I can access my 127.0.0.1:3000 URL just like before still get the status code 500 error
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
and this error when I try to load the workspace in VS Code
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
perhaps I'm setting up a workspace/template incorrectly?
Phorcys
Phorcys7mo ago
did you restart your terminal before running coder server?
-maV.
-maV.OP7mo ago
nope
Phorcys
Phorcys7mo ago
can you open the developer console on that page and screenshot the "Console" tab?
-maV.
-maV.OP7mo ago
yep one moment
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
Are there applications out there that could break the coder install?
Phorcys
Phorcys7mo ago
oh yeah i get the issue this should really be improved (cc: @Atif) you should either access your Coder instance via the temporary URL it gave you or run coder server with --access-url http://127.0.0.1:3000 or edit /etc/coder/coder.env if you're running as a service
-maV.
-maV.OP7mo ago
I think I get similar problems w the temp url sec
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
w temp URL In VS Code when using Temp URL
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
same errors just to reiterate, I did logout of coder on VS code, and tried logging in with both the localhost:3000 and the try.coder.app temp URL address
-maV.
-maV.OP7mo ago
console output on temp URL
No description
-maV.
-maV.OP7mo ago
despite the status code 500 on the General > Deployment page and issues in VS Code
Phorcys
Phorcys7mo ago
yeah you should try to set an access URL
-maV.
-maV.OP7mo ago
ouu ok my mistake will try now
-maV.
-maV.OP7mo ago
w localhost
No description
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
same error in VS Code
Phorcys
Phorcys7mo ago
can you screenshot the workspace's page?
-maV.
-maV.OP7mo ago
I'm on the same network and PC, shouldn't need to worry about externally accessibly at the moment - right?
Phorcys
Phorcys7mo ago
you don't yeah
-maV.
-maV.OP7mo ago
No description
Phorcys
Phorcys7mo ago
oh i meant the actual workspace itself
-maV.
-maV.OP7mo ago
It's very barren
-maV.
-maV.OP7mo ago
No description
-maV.
-maV.OP7mo ago
Shall I start over?
Phorcys
Phorcys7mo ago
what template did you use ?
-maV.
-maV.OP7mo ago
None of them really made sense with being hosted on my PC so I tried From Scratch :S
Phorcys
Phorcys7mo ago
could you send your template over? also you should probably use the Docker template for a setup like this
-maV.
-maV.OP7mo ago
main.tf ?
Phorcys
Phorcys7mo ago
yes
-maV.
-maV.OP7mo ago
terraform {
required_providers {
coder = {
source = "coder/coder"
}
}
}

data "coder_provisioner" "me" {}

data "coder_workspace" "me" {}

resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = data.coder_provisioner.me.os

metadata {
display_name = "CPU Usage"
key = "0_cpu_usage"
script = "coder stat cpu"
interval = 10
timeout = 1
}

metadata {
display_name = "RAM Usage"
key = "1_ram_usage"
script = "coder stat mem"
interval = 10
timeout = 1
}
}

# Use this to set environment variables in your workspace
# details: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/env
resource "coder_env" "welcome_message" {
agent_id = coder_agent.main.id
name = "WELCOME_MESSAGE"
value = "Welcome to your Coder workspace!"
}

# Adds code-server
# See all available modules at https://registry.coder.com
module "code-server" {
source = "registry.coder.com/modules/code-server/coder"
version = "1.0.2"
agent_id = coder_agent.main.id
}

# Runs a script at workspace start/stop or on a cron schedule
# details: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script
resource "coder_script" "startup_script" {
agent_id = coder_agent.main.id
display_name = "Startup Script"
script = <<-EOF
#!/bin/sh
set -e
# Run programs at workspace startup
EOF
run_on_start = true
start_blocks_login = true
}
terraform {
required_providers {
coder = {
source = "coder/coder"
}
}
}

data "coder_provisioner" "me" {}

data "coder_workspace" "me" {}

resource "coder_agent" "main" {
arch = data.coder_provisioner.me.arch
os = data.coder_provisioner.me.os

metadata {
display_name = "CPU Usage"
key = "0_cpu_usage"
script = "coder stat cpu"
interval = 10
timeout = 1
}

metadata {
display_name = "RAM Usage"
key = "1_ram_usage"
script = "coder stat mem"
interval = 10
timeout = 1
}
}

# Use this to set environment variables in your workspace
# details: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/env
resource "coder_env" "welcome_message" {
agent_id = coder_agent.main.id
name = "WELCOME_MESSAGE"
value = "Welcome to your Coder workspace!"
}

# Adds code-server
# See all available modules at https://registry.coder.com
module "code-server" {
source = "registry.coder.com/modules/code-server/coder"
version = "1.0.2"
agent_id = coder_agent.main.id
}

# Runs a script at workspace start/stop or on a cron schedule
# details: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script
resource "coder_script" "startup_script" {
agent_id = coder_agent.main.id
display_name = "Startup Script"
script = <<-EOF
#!/bin/sh
set -e
# Run programs at workspace startup
EOF
run_on_start = true
start_blocks_login = true
}
Phorcys
Phorcys7mo ago
oh yeah that can't work
-maV.
-maV.OP7mo ago
😂 knew it would be something silly like this
Phorcys
Phorcys7mo ago
you need to run the coder agent's script somewhere
-maV.
-maV.OP7mo ago
was this somewhere in the guide that I missed?
Phorcys
Phorcys7mo ago
so in a Docker/k8s container, in a VM, anywhere really the guide probably doesn't mention that because the template handles it
-maV.
-maV.OP7mo ago
I see, so I'll wipe my crap template and workspace and try Docker/k8s container First pass had some errors will try again here
Error: Error pinging Docker server: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/docker_engine: The system cannot find the file specified.

on main.tf line 19, in provider "docker":

19: provider "docker" {
Error: Error pinging Docker server: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/docker_engine: The system cannot find the file specified.

on main.tf line 19, in provider "docker":

19: provider "docker" {
Tried with K8s first now ger this error with Docker need docker on my PC I presume with this type of error Okay I think I'm up and running now
Phorcys
Phorcys7mo ago
yup!
-maV.
-maV.OP7mo ago
Okay so I'm in the workspace things look clean now
Phorcys
Phorcys7mo ago
you should definitely run Coder on a separate server if you can
-maV.
-maV.OP7mo ago
Any free options that you know of? I might just use my laptop unless there's some sort of free cloud tier that's available for just simple testing
Phorcys
Phorcys7mo ago
not really though if you run Coder you have to develop in the workspaces the workspaces won't have access to your files unless you configure them to mount some folders I guess you could do that
-maV.
-maV.OP7mo ago
what's the best way to give my laptop access to my coder server hosted on my PC? is windows firewall port forwarding 3000 good enough? or is there something else I should consider/need to do?
Phorcys
Phorcys7mo ago
no, you will need to open ports on your internet router too
-maV.
-maV.OP7mo ago
even if it's on the same network???
Phorcys
Phorcys7mo ago
oh i thought external
-maV.
-maV.OP7mo ago
just same network for now 🙂 remote later!
Phorcys
Phorcys7mo ago
yeah should be enough also you might wanna use port 80 instead of 3000
-maV.
-maV.OP7mo ago
it's not accessible currently without windows firewall which I thought was strange
Phorcys
Phorcys7mo ago
that way no need for the port in the URL
-maV.
-maV.OP7mo ago
humor me is it TCP or UDP?
Phorcys
Phorcys7mo ago
TCP HTTP is TCP how are you trying to access it from your laptop ? also for external access you could use Tailscale instead of opening ports i gotta go but i'll take a look at this thread later :-)
-maV.
-maV.OP7mo ago
yeah I'm unable to access the ip:port right now 😦 all good though! I appreciate your help! getting close 🙂
Atif
Atif7mo ago
Probably we should add a note in start template that it can't be used as is and is only given for refrence purposes.
-maV.
-maV.OP7mo ago
Or just state that it's like making a VM with no specs attached as-is yes it needs a agent/engine for it to run etc \\wsl.localhost\docker-desktop is where I should see my home directory for my coder server isn't it? I'm not seeing it nvm found it 🙂 \\wsl.localhost\docker-desktop-data\data\docker\volumes\coder-blah-home\_data @Atif any tips for quickly accessing my coder workspace from my PC to my Laptop on the same local network? Should it normally just work?? oopsie nvm :> Have it on my laptop now. This is working super nice @Phorcys 😄 Docker kind of slaughters my RAM usage. Is there a less intense approach?
Atif
Atif7mo ago
What are your system specs? And how many workspaces are you running? Also what are you building/running inside the workspaces?
-maV.
-maV.OP7mo ago
Honestly on my laptop it kind of makes sense, but my main PC runs a Ryzen 7 5700X + 16DDR4 and VM was on SSD. My memory was tapping out at about 4GB of usage, but I think it makes sense, since it is running basically a VM, with a file server + web server (I think?) for the code sync between my 1 workspace My single workspace was being used for VS-code file sharing between my main pc and laptop. I tried out code-server on the web later and it's a nice feature. My laptop uses about 100% usage, where as my PC was only getting tapped out by memory. CPU and SSD usage was just fine. I just had a feeling I guess that there might be a more optimized approach as I probably will use the VSCode remote webUI minimally, and primarily just adding the workspace into VS-code standalone app on both my machines so I can use the same files and see live changes upon CTRL+S If I made my access-url http://10.x.x.x:3000 like my actual host local IP instead of 127.0.0.1:3000, would that normally help with LAN machines connect in? I've hosted other local apps on my network just fine without having to mess with firewalls and such before, so I'm just unsure what's going on
Phorcys
Phorcys7mo ago
yes
Want results from more Discord servers?
Add your server