VSCode remote support for embedded devices

Specifically

Although I'm not an openwrt developer, I'm sure a number of developers use vscode daily. It would be awesome if I could use vscode to edit config files, etc.

2 Likes

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board

Ah cool, thanks for sharing ... :slight_smile:

How did you get it to work? It hasn't 'just worked' for me. Can you attach the log of remote-ssh succeeding with install and start up?

I just did a quick and unfinished test. To get remote SSH working, I need to install full wget, coreutils-printenv, coreutils-sleep and tar. During the remote installation, the router's file system runs out of space ... :wink:

2 Likes

Thanks for sharing the required packages, sadly on x86 (after installing packages you've mentioned) it's stuck in a loop of "Downloading VS Code Server". :frowning:

I see the same behavior after installing the required packages. How do I know /tmp is filling up vs some other issue?

I did see some stack overflow posts that describe how to install the remote-ssh extension manually. I may try that when I have time to see if that works around whatever is happening during the install script.

I was doing some googling this morning and ran across this older vscode issue: https://github.com/microsoft/vscode-remote-release/issues/542

At the very bottom is the following code:

curl -L https://raw.githubusercontent.com/b01/dl-vscode-server/main/download-vs-code.sh | bash -s -- alpine

It's a script that downloads remote ssh and installs it. The only thing I have to add to this command line is 'arm64' since that's what my router uses, but after using this script and restarting vscode, I'm now connected via ssh!

I did have to install 'getopt' and 'file' to make this work.

1 Like

Thanks, that worked for me, but I've had to increase the rootfs parition size before it completed, which made me wonder, maybe things would have worked with the larger partition size as well thru the vscode app.

Off-topic but while we're at vscode: is there any way to stop vscode from popping up irrelevant suggestions (sorry, I don't know the correct term) when editing shell scripts? I hope vscode users know what I mean.