如何使用 VScode(在 Win10 上)在 Virtualbox 中的 Alpine Linux guestVM 运行 上进行远程开发?

How to use VScode (on Win10) to do remote dev on Alpine Linux guestVM running in Virtualbox?

一直在我的 Windows 10 Enterprise 主机上的 Virtulbox 上的小型 Alpine Linux 基于 3.13 的 guestVM 上学习 Go-lang 开发。我注意到 VScode 似乎支持 Alpine Linux >=3.9 通过容器或使用扩展的远程 SSH 开发模式下的 WSL2。然而,尽管将 guestVM 设置为具有 wgetgit(根据需要)并确保从主机进行无缝 SSH 访问(使用 Windows 10 内置 SSH 客户端进行测试)无需登录需要密码,VScode 无法连接到 VM。这真的是不受支持的配置吗?使其工作的任何手动解决方法。

PS> 我没有在此主机上启用或使用 Hyper-V 或 WSL2 或 docker 容器。

我最近(刚刚)在 vscode-remote 问题中添加了一个条目:https://github.com/microsoft/vscode-remote-release/issues/6347#issuecomment-1079430646

以下是需要在远程 alpine 上完成的操作 box/vm:

# This is what make vscode remote-ssh work
apk add gcompat libstdc++ curl bash

# 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

警告仍然出现,但到目前为止工作正常。我可以验证 docker 扩展在此设置中工作。