I want to use VS Code, but I don't have the internet in my development environment ... VSCode Remote Development It's very convenient, but the work environment is impossible ... I don't want to melt it for a day to google how to use vim, gdb and git commands anymore ... Give to the person.
--Client (machine where you want to open VS Code) --Offline Windows --Actual offline is possible, such as in a proxy --OpenSSH mystery is not included (sometimes) --No administrator privileges (sometimes) ――Put VS Code here and use it! --Target (target development machine) ――It is troublesome to put VS Code directly in linux, and VNC and RDP are heavy. --Put vscode-server here! --Sshd, gcc and gdb are in here!
--Download the required plug-ins in advance --Manually get vscode-server corresponding to vscode version (commit) --Avoid the moss point wget in SSH Extention by changing it to cp
Download in advance what you need to deploy to an offline environment.
--Client - OpenSSH --For those who do not have OpenSSH. --Expand it in a suitable place. - Japanese Language Pack for Visual Studio Code --English for people who don't like it. --Other plugins you want --Target machine --sshd: Make sure to accept ssh connections. --gcc: Necessary for compiling C / C ++. --gdb: Debugger. Those who need it for development.
Select Install from VSIX ... from the right shoulder of the plug-in list to install each downloaded plug-in. Let's google the method.
Let's google this step. In short:
~/.ssh/config example
Host target
HostName target IP address
User target login user
IdentityFile client id_Path to rsa
From the menu, go to Help> About and check Commit :. You can also copy.
Version: 1.43.1
Commit: fe22a9645b44368865c0ba92e2fb881ff1afce94
Date: 2020-03-18T07:01:20.184Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362
Download vscode-server-linux-x64.tar.gz from the URL that contains the Commit.
https://update.code.visualstudio.com/commit:fe22a9645b44368865c0ba92e2fb881ff1afce94/server-linux-x64/stable
The code below contains wget, which causes Remote Development to fail to launch. First of all, instead of wget, transfer the thing you got yourself to the target machine. Let's send it from the client to the target / tmp etc. by scp. (Scp is in the OpenSSH folder.) You can check the operation here as well to see if the public key authentication is set up properly.
.\scp \path\to\vscode-server-linux-x64.tar.gz target:/tmp
Replace wget running on the target with the cp command and rewrite it as if wget was successful even in an offline environment. Edit ~ \ .vscode \ extensions \ ms-vscode-remote.remote-ssh-0.50.0 \ out \ extension.js on the client. I am changing the code that should be wget on the target to the code that is copied from / tmp.
extention.ja(original)
wget ${function(e){return e?"--tries=1":""}(!!m)} --connect-timeout=7 --dns-timeout=7 -nv -O vscode-server.tar.gz $DOWNLOAD_URL
extention.ja(After change)
cp /tmp/vscode-server-linux-x64.tar.gz vscode-server.tar.gz
That's all for the procedure. Let's check if we can connect to the target from VS Code. You can also put the plugin into the target from VS Code. You can also transfer the vsix file to the target and install it with Install from VSIX ...
--Check if the public key authentication of ssh.exe passes.
--Check sshd_config. - https://code.visualstudio.com/docs/remote/troubleshooting - AllowTcpForwarding yes - AllowStreamLocalForwarding yes --Check the target firewall (OUTPUT).
Refs -VSCODE remote development Connection in an environment where the remote host is not connected to the Internet -[VS Code] How to use the Remote Development function on a server without an Internet environment
Recommended Posts