rafaelmaiolla / remote-vscode

A package that implements the Textmate's 'rmate' feature for Visual Studio Code.
MIT License
259 stars 33 forks source link

Rmate doesnt open file in VS code #68

Closed bajaj689 closed 5 years ago

bajaj689 commented 5 years ago

Hi All, I am reposting a question raised earlier by another person as it is closed but there is no answer for it and I am facing the same issue as the other person. So here is the issue: Setting up the ssh connection in VScode works, but while trying to open a configuration file nothing happens, the command is executed and then I am back on the console again. There is no error message.

My installation steps:

  1. Installed the remote-vscode extension
  2. Used the settings 127.0.0.1 with port 52698 for the extension
  3. Installed rmate on the remote server sudo wget -O /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate sudo chmod a+x /usr/local/bin/rmate
  4. F1 -> Start Server on VScode
  5. Terminal: ssh -R 52698:localhost:52698 root@My-Host-IP
  6. Trying to open a file: rmate -p 52698 /tmp/tempy.conf Or just rmate /tmp/tempy.conf
  7. I also tried it with these settings for my ~/.ssh/config Host * ForwardAgent yes RemoteForward 52698 127.0.0.1:52698

I checked it again for wrong ports, typos etc. but I can't seem to find the problem. I appreciate any help in this regard.

hxrocha commented 5 years ago

I have the same problem!

felocru commented 5 years ago

The exact same thing happened to me. Following the same steps. But after killing the process manually fuser -v -n tcp 52698 and then

kill [signal or option] PID (s)

manually disabled the" remote.onstartup ": false from the settings.json. Because when modifying it from the vscode GUI it just did not change. When closing vscode and returning it open, I manually started the rmate server. I connected and the file was successfully opened. Apparently the process that executed vscode had a problem.

sortinousn commented 5 years ago

as felocru suggested. Port 52698 may already be in use from a previous ssh session using rmate.

In this case on your remote host....

first run:
sudo netstat -plant | grep 52698

then: sudo kill -9 [PID]

Once done reconnect to rmate.

pfeerick commented 5 years ago

For

  1. Terminal: ssh -R 52698:localhost:52698 root@My-Host-IP

Try using 127.0.0.1 instead of localhost ... this is what worked for me on Windows 10. For some reason, localhost just didn't work! :-O

bajaj689 commented 5 years ago

I replaced localhost with 127.0.0.1 in the ssh command and it worked. Thanks for your inputs @pfeerick @sortinousn @felocru .