Void.app 使用 open-remote-ssh 插件连接 Windows 远程主机指南

🚀 Void.app 使用 open-remote-ssh 插件连接 Windows 远程主机指南

本文档适用于第三方 VSCode 编辑器(如 Void.app)使用 jeanp413.open-remote-ssh 插件远程连接 Windows 主机。


微软官方 remote-ssh 插件仅支持在 Visual Studio Code 中运行,不兼容第三方编辑器。为此,open-remote-ssh 作为开源替代品提供了类似功能。但在连接远程 Windows 主机 时存在一些特定限制,需要手动配置支持。


  • 本地编辑器:Void.app / VSCode OSS

  • 远程主机:Windows 10+,已开启 SSH 服务

  • 可通过 .ssh/config 配置无密码登录(使用公钥)



Windows SSH 默认使用 cmd.exe,这会导致安装脚本失败。需将其替换为 PowerShell:

powershell

New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellCommandOption -Value "/c" -PropertyType String -Force

💡 重启 sshd 服务或重启主机生效:

powershell

Restart-Service sshd

open-remote-ssh 在连接时会尝试开启 agent forwarding,这在 Windows 上 会导致连接失败

ssh

Host win11
    HostName 192.168.1.100
    User youruser
    ForwardAgent no

由于 GitHub 下载经常失败,这时候只能手动安装:

bash

DISTRO_VERSION="1.99.30044"
DISTRO_COMMIT="b5a41840a0ce29fe5a86b2fa07c26b07f92684d2"

bash

curl -LO https://github.com/voideditor/binaries/releases/download/1.99.30044/void-reh-win32-x64-1.99.30044.tar.gz

bash

scp void-reh-win32-x64-1.99.30044.tar.gz youruser@yourhost:/c/Users/youruser/.void-server/bin/b5a41840a0ce29fe5a86b2fa07c26b07f92684d2/

powershell

cd $HOME/.void-server/bin/b5a41840a0ce29fe5a86b2fa07c26b07f92684d2
tar -xf void-reh-win32-x64-1.99.30044.tar.gz --strip-components 1

解压后应包含:

text

C:\Users\youruser\.void-server\
└── bin\
    └── b5a41840a0ce29fe5a86b2fa07c26b07f92684d2\
        └── bin\
            └── void-server.cmd ✅

  1. 启动 Void.app

  2. 打开命令面板:

    text

    Remote-SSH: Connect to Host...
  3. 选择你的 win11 配置

插件会自动检测 void-server 已安装并启动远程服务。


步骤 内容
✅ 设置 Windows SSH 默认 shell 使用 PowerShell 替代 CMD
✅ 禁用 SSH Agent Forwarding 防止连接失败
✅ 手动部署 void-server 下载解压到对应 commit 目录
✅ 插件连接远程 连接稳定,不需重复安装