windows Visual studio code如何打开远程ubuntu主机中的文件夹或者文件

20 篇文章 0 订阅

1、安装visual studio code忽略,
2、按照如图所示添加ubuntu主机IP、用户
在这里插入图片描述
鼠标放在IP地址上面右键如下图:

在这里插入图片描述
3、点击上图中的“Connect to Host in current window”后会出现下面的信息

linux@192.168.3.37's password:
2bcac52f48d0: running
Acquiring lock on /home/linux/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3/vscode-remote-lock.linux.c3f126316369cd610563c75b1b1725e0679adfb3
Found existing installation at /home/linux/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3...
Checking /home/linux/.vscode-server/.c3f126316369cd610563c75b1b1725e0679adfb3.log and /home/linux/.vscode-server/.c3f126316369cd610563c75b1b1725e0679adfb3.pid for a running server
Starting server with command... /home/linux/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown  --port=0  &> "/home/linux/.vscode-server/.c3f126316369cd610563c75b1b1725e0679adfb3.log" < /dev/null
printenv:
    SHELL=/bin/bash
    XDG_SESSION_COOKIE=1ef0a58a352d7d9e80d30e4500000003-1626882160.976378-1293310083
    SSH_CLIENT=192.168.3.19 61305 22
    USER=linux
    VSCODE_AGENT_FOLDER=/home/linux/.vscode-server
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    MAIL=/var/mail/linux
    PWD=/home/linux
    LANG=zh_CN.UTF-8
    HOME=/home/linux
    SHLVL=2
    LANGUAGE=zh_CN:zh
    LOGNAME=linux
    SSH_CONNECTION=192.168.3.19 61305 192.168.3.37 22
    _=/usr/bin/printenv

Waiting for server log...
Waiting for server log...
Waiting for server log...

*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*

2bcac52f48d0: start
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==52910==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/tmp==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==132==
connectionToken==eea0f0fd-d5ba-4e9c-b1b4-e87ea8d3b813==
2bcac52f48d0: end

1)如果出现问题首先删除:“C:\Users\lm.ssh\known_hosts”文件
2)提取出commit:xxx中的xxx
3)把2)中的xxx替换替换如下的xxx,根据不同的版本下载

vscode版本为insider
https://update.code.visualstudio.com/commit:xxxx/server-linux-x64/insider
vscode版本为stable
https://update.code.visualstudio.com/commit:c3f126316369cd610563c75b1b1725e0679adfb3/server-linux-x64/stable

4)下载后把“vscode-server-linux-x64.tar.gz”解压到ubuntu主机中如下文件夹

/home/ubuntu/.vscode-server/bin/c3f126316369cd610563c75b1b1725e0679adfb3

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值