Remote Tunnel stuck at creating VSCode server - visual-studio-code

I cannot create a new Remote Tunnel on my remote machine.
It previously worked fine but after a reboot, it is now stuck at creating a new code server step.
code tunnel --log trace --cli-data-dir . --verbose
*
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[2023-01-08 16:58:40] debug No code server tunnel found, creating new one
The log in the working directory shows nothing. Please help!

Microsoft failed to mention a tiny detail about VSCode Tunnels which is bringing a myriad of weird problems to the users of this superb VSCode feature:
For VSCode Tunnels to run/connect properly on most Linux users, the Server VScode MUST run as root.
For VSCode Tunnels to run/connect properly on most Windows users, the Server VScode MUST Run As Administrator.
Works flawlessly after that.
Saved me a great ton of troubleshooting all my firewalls (local n remote), UDP port restrictions, OS Settings, "Hidden" VSCode Settings, etc... which I did quite extensively before stumbling upon this universal conclusion.

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 ./)

Change default extensions location for remote development in VS code

I have a visual studio code installed in a desktop. As I don't have any runtime environments installed in it, the source code repository is kept in the remote server where the runtime and other dependencies are available, so SSH connection is established from the VS code to update the source code.
I'm installing few extensions using VS code in the remote server where the source code and runtime are available. It gets installed in my home directory(/home/myname/.vscode-server)by default on the remote server.
As I have very limited disk space in my home directory, I want to change the extension location of vs code. Can you guide me here?. Your insights will be helpful. Thank you !!!
PS: Can't install VS code in the remote server due to limited access rights.
It has been well discussed on GitHub under https://github.com/microsoft/vscode-remote-release/issues/472 and remote.SSH.serverInstallPath is the current solution.

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.

Visual Studio Code remote target on Raspberry

it is advertised that Visual Studio Code is able to compile and debug on a remote machine.
I've installed VSCode on Ubuntu and I want to compile and debug on the remote Raspberry.
I've setup GDB server on the remote Raspberry but on the Microsoft site it is not detailed how to configure the VSCode IDE in order to connect the remote Raspberry.
There is someone that can give a solution on VSCode (Not on standard Visual Studio)?
Thanks
Massimo
Due to the fact that nobody answered my question probably means that nobody use Visual Studio Code with Raspberry.
Then I've investigate myself and I can suggest to use Netbeans that allows the remote development and debugging as well.
It takes less thn 10 minutes to install and configure Netbeans because it include some automatic discovery and configuration automation.
Also this time Microsoft failed !
Massimo

eclipse neon remote debug

I just installed the latest version of eclipse neon. I previously used eclipse mars. But due to other issues that should be updated in eclipse Neon I changed to this version.
I develop a program for a ARM Linux system on a Windows computer, so using a cross-gcc and doing remote debug using gdb/gdbserver from eclipse. I first made a connection using the remote systems perspective using ftp for file transfer and ssh for the shell. This worked fine and I was happy with this.
But in Neon it seems to be changed because the connection that I made in the Remote Systems explorer can't be selected anymore when you use C/C++ Remote Application Debug. When you look at the connection listbox I only see local connection and not the remote systems anymore. When I create a new connection from the debug configurations dialog I can only choose serial/telnet/ssh but when I choose ssh it doesn't work. I can make the connection and open a command shell, so ssh works. But when it wants to transfer the file to my target it is using sftp appearently (looking at the error log) but I don't have this on my target.
When I transfer the file manually to my target (using the remote systems perspective) the debugging works fine but of course I want to transfer the file automatically when I start a debug.
My question is if indeed this connection management is changed that you can't choose anymore the systems that you defined in the remote systems explorer?
Or do you need install a specific plugin?
The current configuration possibilities are very limited and also the debugging of the issues is limited.
Other solution is that I have scp installed on the target. Is there a way to change from sftp to scp?
Thanks.