-
Notifications
You must be signed in to change notification settings - Fork 329
Remoting SSH support for Alpine Linux #6347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was looking for this for a long time. However I found a way to use remote-ssh to a alpine vm recently. Following is what I did on the alpine(remote) box: # This is what make vscode remote-ssh work
apk add gcompat libstdc++ curl git
# As alpine by default use busybox and some common utilities behave differently, like grep
apk add grep dropbear-scp dropbear-ssh
# Add zsh if using zsh shell
apk add zsh The warning still show up, but work normally so far. I can verify docker extension works in this setup. |
THANK YOU! For ages, this just wouldn't work. Note that I made a couple of changes: I use openssh, and it works just fine. bash works too. Otherwise, everything is flawless with a properly set up .ssh/config file. I can now log into my LXD containers through a proxy tunnel flawlessly. |
Using the packages mentioned above, I'm able to make a remote SSH connection and almost everything works. The only outstanding issues I encounter are :
I don't mind if this is ever officially supported, but fixing git and allowing me to disable the warning would make this a great solution for me. |
Alpine always do minimal installation, so we have to install git ourselves. In the alpine box, as root: apk add git |
Yes, I have git installed. vscode cannot find or use it for some reason. |
In vscode setting, try: "git.ignoreMissingGitWarning": true, |
I already had this setting enabled. Ignoring the warning hides the popup but I want vscode to find the installed git so that the version control integrations work. Is there any way to enable better debugging or troubleshoot the git not found failure? |
I remember spending hours hunting that down after posting here. Solved it but forgot to drop down notes. The cause is VS Code remote server(or the SCM extension) cannot get default environment on Alpine Linux, which include $PATH. I dig through my alpine setup and updated my blog here: https://johnsiu.com/blog/alpine-vscode/#vs-code-and-alpine-git PS: Regarding debugging, as long as ssh tunnel is working, log is located on the remote box: |
Ok, so hardcoding the git path as @J-Siu shows in their blog works. Adding to the remote settings JSON and reloading the window gives SCM functionality:
It would still be better if VSCode could correctly read the path of the git binary from the environment. It's not as if |
Thanks you so much. But after install above package you need to config /etc/ssh/sshd_config and modifed from "#AllowTcpForwarding no" to |
Has anyone got remote containers working through an Alpine SSH host? I seem to have hit #6739 while trying.
|
Physical machine(on amd64) with Alpine Linux still does not work yet. |
@santicalcagno Have you try all steps on my blog yet?: https://johnsiu.com/blog/alpine-vscode/#vs-code-and-alpine-git One quick test is try to ssh to the alpine vm with ssh tunnel, if that doesn't work, then you need to update sshd config in alpine vm. |
@J-Siu yeah, unfortunately I still have those ENOENT errors after following your guide (thanks!). I tried tunneling via FWIW, this is all on aarch64 (M1 mac running VSCode in macOS, SSH'ing to an aarch64 Alpine VM). The issue I linked made me suspicious of the VM arch playing a part in this, but I created an x64 Alpine VM and as far as I could test the issue still happens in my machine. |
1.74.0 introduced a new Remote Tunnels feature. I'm hoping this is something that can simplify connecting to a running container. |
I had the same issue and I can't use VSCode with alpine linux VM. But I realized that I can use another VSCode extension for a remote ssh connection. And It works. The extension's called SSH FS. |
VSCode now can use Remote Tunnels to connect Alpine Linux installed on Physical machines. But latency is a serious problem, and it would be nice to have a native SSH Remote method support. |
This wasn'tenough for me. I also has to install |
Unfortunately with the latest remote requirements (glibc >=2.28, libstdc++ >= 3.4.25) it seems these packages aren't enough to run the remote server. |
use 1.85.2 and disable auto update |
They've backed down on the lastest GLIBC and LIBCXX requirements for another 12 months. I haven't tested yet, but updating to 1.86.1 would probably allow SSH remote to Alpine with the above mentioned packages. |
@mill1000 Yes, I confirm on Alpine 3.19 and on latest code 1.86.1 you can connect to an Alpine server with the gcompat, libstdc++ and bash packages installed as a minimum. You do get an ugly non-dismissable unspported OS banner though. I hope that before the year is up that we get some sort of official support on the server side for musl-based distros. I have Alpine running on most of my servers and cloud instances. VS Code already supports alpine inside of dev containers, so it would appear most of what needs to be working already does. (Perhaps there's a way to fool the code server into thinking it's in a dev container or something?) |
After the recent update I had to install the GNU ps tool, too. So here's my setup:
Then configure the VSCode Server to find the git tool:
|
not procps but procps-ng
update: vscode now has special alpine build and only needs |
All the pieces should be here for this to work (and sounds like various folks have gotten it working). We haven't officially updated the docs in all places, but installing libstdc++, git, and either wget/curl on your machine should enable this in most case. You'll also need bash if you aren't using the default setting for Please feel free to open a new issue with your specific logs if something isn't working right so I can understand any gaps we may have! |
Currently Alpine Linux is supported for WSL-Remoting only. It would be great seeing support for Alpine using SSH on remote machines so that development can be done on cloud-instances running MUSL-based distributions.
The text was updated successfully, but these errors were encountered: