Install extensions for remote - ssh when remote machine is behind a proxy - visual-studio-code

I've installed the Remote - SSH extension to develop while working from home, code that is sitting on a remote work computer. Previously I'd been using VSCode installed on the remote Linux machine and just used NX or some remote desktop software to connect and develop. I note that just to point out that a local version of VSCode is also installed on the machine. Now while home, I first connect my laptop to VPN and then using the Remote - SSH extension I am able to develop code sitting on the remote machine. For this SSH connection, I've installed a few extensions on the remote machine that seem to work fine, but I am having trouble installing or getting others to work. Namely the rust-analyzer extension won't install and the rust extension doesn't work. I assume it is because of the "Known limitations" listed on this page https://code.visualstudio.com/docs/remote/ssh#_managing-extensions where it advices to extensions may not work unless the appropriate environment variables are set. Previously I'd been setting http_proxy and https_proxy but now I also set HTTP_PROXY and HTTPS_PROXY because of this advice. However, setting these variables does not solve the problem. I also set these variables in .wgetrc following advice I found somewhere. If this is a proxy issue, how do I set the correct variable? Also, is there an alternative way to install extensions so that they work via the Remote - SSH extension?

Settings -> "Remote" tab -> search "proxy"
set "Http: Proxy", and then reconnect remote

Related

Visual Studio Code remote access to a WSL2:ubuntu on my desktop from my macbook

've looked around and can't seem to find the answer to this - probably because the feature is pretty new.
I tried the remote WSL:ubuntu connection on my windows desktop machine to connect to my WSL2 Ubuntu running on the same machine. This is pretty much perfect as it allows access to my Nvidia GPU under linux
Is there anyway I can do the same trick from my macbook? I can connect to the windows side of the desktop using the new remote tunnel feature but I'm drawing a blank on how to do for the WSL buried in that machine. It looks like it's just using the same remote connection feature so I'm thinking it should be possible but WSL2 network is not exposed the same way you can with a VM or other machine.
The desktop has way more everything than my macbook including a nvidia GPU I want to use for some machine learning.
I can do it from the desktop itself - but it's nice to be able to use that machine from my macbook at certain times of day.
I have recently started using VSCode so I'm on the learning curve with it - it may well be that it's not possible using the new remote tunnels - or requires some messing with adding a new hyper-v bridged adapter to the WSL installation. I'm hoping against hope there's an easy solve that I've somehow missed.
I tried setting up the remote tunnel as per https://code.visualstudio.com/blogs/2022/12/07/remote-even-better but it seems to setup a server to access windows not the WSL2 service.
Thanks for any help!
I had a similar problem and found this github issue. While the developers are looking into including this feature, you currently will need to install the VSCode CLI directly in WSL. You can find the downloads here
Notes
I would recommend the x64 CLI download in the Linux section. It will download a tar.gz file which will have a file named code in it when extracted.
The tunnel will launch from wherever you place that code file, so I put mine in the ~/ (home) directory.
You can then open a tunnel using the command ./code tunnel from that location. You can replace the . with the path to the code file to open the tunnel while in a different directory, i.e. ~/code.
You can still launch a tunnel from Windows with code tunnel. (note that this command does not have ./)

VSCode fails to install extensions remote ssh server when using Remote ssh extension

I'm working in a Windows machine behind a corporate firewall and acessing a linux server also behind a corporate firewall. With the excellent Remote-SSH extension, VSCode is failing to install my extensions in the remote linux machine.
How to fix it?
As far as I understand, my local machine downloads the extension code and copies it to the remote machine. But there is just a few extensions that try to download some data directly from the internet.
The main reason of this failure is that my local machine can't directly access the internet. Usually restarting my local proxy solves the problem.
My local machine is a Windows machine. I have a local cntlm proxy running. Remote SSH works flawlessly, downloading extensions using this proxy.
My remote machine is a linux machine. In my .bashrc I set my http_proxy variables to another proxy. In my terminal, these variables are correctly set, but I don't think that VSCode sees them.
Solution: Go to preferences, open the Remote settings tab and configure:
Http: Proxy Support as override
Http: Proxy as my remote http proxy. When I set an https proxy url here, it failed.
proxyStrictSSL is set as false
Maybe VSCode Remote Extensions will asks for your password a lot of times. Better to configure your ssh keys.

VS Code remote server extension shows "attempting to reconnect"

I use Visual Studio Code and RemoteSSH extension to connect to a remote server located across the ocean via the corporate VPN, The connection gets established when I connect via my mobile hotspot, but it keeps showing "Attempting to reconnect" asking for password repeatedly when I use my broadband.
I have compared the internet speed of both the service providers and below are the results.
1)Airtel hotspot(remote ssh works)
2)Hathway broadband(remote ssh does'nt work)
From the above images it is evident that my broadband speed(upload and download) is much better than my internet hotspot speed, In spite of this I am unable to use remote ssh to code using my broadband network, Is there something that needs to be tweaked, or are the internet speed tests in a way inaccurate?
I had similar experience and there are many threads on the subject, none of which resolved it for me.
I am working on a Windows laptop and connecting to remote Centos linux.
I also connect to company network via their VPN.
I resolved it in the following manner, maybe not all steps are required, but this is what I did -but firstly, I setup ssh keys so as not to have to keep using a password, well worth the effort.
Updated the fileWatcher in code to ignore .git folder and venv folder, this improves performance
Updated WSL to WSL2
Install a linux shell on Windows - I was already using an Ubuntu one, installed prior to vscode, but hints online suggested installing it after vscode, so I installed the Kali shell.
Installed openssh-server (to get ssh-keygen) on kali
Launched code from the kali shell, let it do its setup
Even though all extensions were installed on both machine, vscode didn't recognize that and I had to use the option in the extension section to "install exentsions on remote server"
After that, every thing was fine.
Hope that helps anyone else searching this problem.
In Airtel hotspot, your public IP address remains the same.
In case of Hathway broadband, public IP changes very frequently. So, if your VPN is redirecting you over IP, there may be possibility of delay because of authentication verification.

Use Settings Sync or Syncing vscode extensions with remote SSH environment

I am using VSCode 1.38.1 and I connect to a remote docker environment running sshd with SSH using the Remote - SSH 0.46.1 extension.
Everything works smoothly and I can install/uninstall extensions in the remote docker container with the VSCode.
However, I cannot find a way to use the Settings Sync 3.4.3 (latest) extension to sync my extensions/settings in the remote docker container.
It seems that it can be installed only locally and not on the Remote SSH environment. Is there any way to use it with the remote environment?
Also, could you please suggest me an alternative settings syncing extension? I have also tried Syncing 3.0.9 extension which can be installed remotely but when I download the extensions/settings from the gist file it loops forever.
.
By creating a symbolic link from .vscode-server to .vscode in the remote environment everything works smoothly. Also, only the Syncing extensions 3.0.1 version works correctly with syncing.
I try the same way, it looks still not working.
I am connecting the remote linux server(not container), the remote server specific setting is not synced to gist after "Upload/Update Settings", it looks only local PC setting uploaded to gist.
did you try to configure remote specific setting (which is not same as local PC) and sync it?

Build and debug a project on a remote server via SSH with Eclipse

Unfortunately, I do not find a solution for my problem in this similiar question.
I have a server with special hardware and a special (GNU-compatible) toolchain. I can only access this server via SSH.
Now I try to set up a development system with Eclipse. Is it possible to set-up a configuration to be able to build and debug via SSH as if the program would run on my local computer? And if yes, could you tell me a little bit about it? ;-)
Provided your server is a Linux machine running a X server, you may want to look around SSH -X.
Install Eclipse on your server
Install an X11 environment on your client (e.g. for Windows: XMing)
Connect to SSH with the -X option (e.g. for Windows, there is a checkbox on Putty)
Launch Eclipse from the ssh connection.