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?
Related
'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 ./)
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.
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
Currently, I have:
a desktop with low system specs, Windows 7 Pro (without Admin Rights), without docker.
a Virtual Machine with Centos7, and docker installed.
On my desktop, I can either use:
my local installation of VSCode, and Remote - SSH to develop remotely on my VM. It works well, but I can't combine this with Remote - Containers.
X11Forwarding to develop directly with VSCode installed on this VM. I can use Remote - Containers, but X11 is very slow.
Is there a way, with local VSCode, to develop in a remote container, without local installation of docker (obviously with docker installed on the host)?
Is there a way, with local VSCode, to develop in a remote container,
without local installation of docker (obviously with docker installed
on the host)?
No. In the 'advanced containers' docs it says
You can use the Docker CLI locally with a remote Docker host by
setting local environment variables like DOCKER_HOST,
DOCKER_CERT_PATH, DOCKER_TLS_VERIFY. Since VS Code uses the Docker CLI
under the hood, you can use these same environment variables to
connect the Remote - Containers extension to the same remote host.
I added the bolding. Note that it is referring to the client not the remote there. This is from Developing inside a container on a remote Docker host.
Though not officially supported, it seems that it is possible to install Docker CLI without the daemon...
Is it possible to install only the docker cli and not the daemon
Maybe you can do this without admin?
That would, though, certainly be swimming against the grain. Probably your best bet is to stick with the 'remote - SSH' setup you've got going.
I just achieved this using the solution linked by #Tom (but with admin rights, I didn't test it without them)
I downloaded the docker-cli from the docker-cli-builder github repo and created the docker context successfully.
After selecting it in VSCode, it has started using the context allowing me to see the containers on the remote machine.
We have build a small tool called LiveSync which could solve your problem. You simply run
python3 -m pip install livesync
livesync <virtual-machine>
from inside your vscode workspace. It will start watching for changes and push them immediately to the remote. Hence you can code locally (even run your tests) and have all changes synced with your target system.
On my windows laptop, I use putty to ssh on the remote server where I have git checkout a C project. I would like to use eclipse(CDT) for program development on my laptop but compilation and program execution is only possible on the remote server. Can I map the repository checked out on remote server into eclipse on my laptop so that I can avoid working with two copies of the checked out project.
This seems not possible unless you are using an Eclipse installed on the remote machine... and use it on your Windows laptop.
See "Remote Eclipse over X11".
Since you are on Windows, you would use an X11 emulator like vcxsrv.
That would avoid the sshfs setup.
The other approach would be to replicate your remote machine environment in a VM (VirtualBox) or a Docker image/container in order to be able to compile locally (and then push the modified sources to your remote machine with Git)