是否可以在没有公共IP的GCLOUD上将VS代码与VM-INCENTANE集成在一起?
我尝试与在其中具有公共IP的VM-Insance集成,并且可以正常运行。
但是,当我尝试连接到没有公共IP的VM-INSANCE时,
Host my-host
IdentityFile ~/.ssh/google_compute_engine
User user
HostName instance-name
ProxyCommand gcloud compute ssh --zone "zone" "instance-name" --tunnel-through-iap --project "project-id"
我收到了消息: 无法连接到远程扩展主机服务器(错误:连接时计时)
I try to integrate with vm-instance having public ip in it and it works.
But when I try to connect to vm-instance that does not have public ip,
Host my-host
IdentityFile ~/.ssh/google_compute_engine
User user
HostName instance-name
ProxyCommand gcloud compute ssh --zone "zone" "instance-name" --tunnel-through-iap --project "project-id"
I got message:
Failed to connect to the remote extension host server (Error: The connection timed out)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要考虑使用VS代码远程敲打
https://code.visualstudio.com/docs/docs/remote/隧道#_ using-the-code-cli
在远程Google Cloud private VM上:
获取VS代码远程通道
curl -lk'https://code.visualstudio.com/sha/download?build = stable& os = cli-alpine-x64' - output vscode_cli.tar.gz.gz
tar -xf vscode_cli.tar.gz
./代码隧道
此命令下载并在该计算机上启动VS代码服务器,然后为其创建隧道。 注意:首次在机器上启动隧道时,将提示您接受服务器许可条款。此CLI将输出vscode.dev URL与此远程计算机相关,例如
https://vscode.dev/tunnel/< machine_name&ggt;/此URL在您选择的客户端上。
在您的本地环境上,在认证并提供了一个机器名称后,您可以使用几个连接到远程计算机的选项:
在直接的vs代码的桌面实例上,打开命令调色板并运行命令:远程 - 隧道:连接到隧道并粘贴您从#4
You might want to consider using VS Code Remote-Tunnels
https://code.visualstudio.com/docs/remote/tunnels#_using-the-code-cli
On the remote Google Cloud private VM:
Get the VS Code remote-tunnel
curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
tar -xf vscode_cli.tar.gz
./code tunnel
This command downloads and starts the VS Code Server on this machine and then creates a tunnel to it. Note: You will be prompted to accept the server license terms when you first start a tunnel on a machine.This CLI will output a vscode.dev URL tied to this remote machine, such as
https://vscode.dev/tunnel/<machine_name>/<folder_name>.
You can open this URL on a client of your choosing.On your local environment, after authenticating and providing a machine name, you then have a couple of options for connecting to your remote machine:
Command: Remote - Tunnels: Connect
I hope this helps!
推入云源存储库 - - 然后从那里拉出或使用云构建来部署。
Push to Cloud Source Repositories - and either pull from there or use Cloud Build to deploy.