blog/content/homelab/vscode-alpine.md
Mathieu Broillet 8e9efebeb1
All checks were successful
continuous-integration/drone/push Build is passing
remove draft status
2023-06-11 16:09:58 +02:00

1.7 KiB

title date draft author cover description tags
Use VSCode Remote on Alpine Linux hosts 2023-06-11T16:01:44+02:00 false Mathieu Broillet img/vscode.png Microsoft not even capable of adding a few commands to their install script...
docker
watchtower

When it comes to Microsoft, it's not uncommon to encounter unresolved issues, and one such case is using the VSCode remote agent on Alpine Linux. By default, Alpine Linux utilizes Dropbear, which isn't compatible with remote development in VSCode. However, fret not! I've got a few commands that can help you overcome this hurdle and add support for Alpine.

{{< code language="BASH" title="Add Alpine support for Remote VSCode" expand="Show" collapse="Hide" isCollapsed="false" >}}

Stop and remove Dropbear

rc-service dropbear stop rc-update del dropbear apk del dropbear* -f

Stop and remove SSHD

rc-service sshd stop rc-update del sshd apk del openssh* -f

Clean up Dropbear and SSH configurations

rm -rf /etc/dropbear rm -rf /etc/ssh rm /etc/init.d/ssh

Reboot now if needed

reboot now

Install OpenSSH and necessary packages

apk add openssh gcompat libstdc++ curl bash git grep apk add procps --no-cache

Start and add SSHD to startup

rc-service sshd start rc-update add sshd

Update AllowTcpForwarding setting

sed -i 's/^#AllowTcpForwarding./AllowTcpForwarding yes/' /etc/ssh/sshd_config

Update PermitTunnel setting

sed -i 's/^#PermitTunnel./PermitTunnel yes/' /etc/ssh/sshd_config

Uncomment the line if needed (remove '#' at the beginning)

sed -i 's/^#PermitTunnel.*/PermitTunnel yes/' /etc/ssh/sshd_config

Restart the SSH service to apply the changes

/etc/init.d/sshd restart {{< /code >}}