textmate / rmate

Edit files from an ssh session in TextMate
http://blog.macromates.com/2011/mate-and-rmate/
513 stars 81 forks source link

rmate fails from a Vagrant VM #40

Closed brandondrew closed 9 years ago

brandondrew commented 9 years ago

I couldn't get the directions here working, and figured I must have misunderstood something, so I tried the directions here: http://hiltmon.com/blog/2013/11/09/textmate-2-basics/

That didn't work either, so it appears that the problem is with rmate.

After attempting to rmate .bash_profile from ~ on the VM, I just get a new prompt, and after a little while of waiting I get:

$ /usr/local/bin/rmate:174:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
    from /usr/local/bin/rmate:174:in `new'
    from /usr/local/bin/rmate:174:in `connect_and_handle_cmds'
    from /usr/local/bin/rmate:228:in `block in <main>'
    from /usr/local/bin/rmate:227:in `fork'
    from /usr/local/bin/rmate:227:in `<main>'

Here is my .ssh/config for the Vagrant VM. All normal vagrant commands work, so I'm quite sure everything is good in that regard, but using the rmate command from inside the Vagrant VM fails.

Host ads
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/brandon/Code/ad-related-reports/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

  RemoteForward 52698 127.0.0.1:52698

TextMate does have permission to allow incoming connections in the Firewall settings. I even tried turning off the firewall, but that made no difference.

sorbits commented 9 years ago

For an out-of-the-box config, set TextMate to allow access from remote clients (Preferences → Terminal) and use --host=auto with rmate (from vagrant), and it should work.

If you do not want to allow connections from remote clients then you must setup a tunnel between your machine and vagrant. I don’t know off-hand how this is done.

If you do not want to specify --host=auto each time then setup this as the default (see the README).

If you think there is a bug with rmate then please see https://github.com/textmate/textmate/wiki/Writing-Bug-Reports

On 22 Jun 2015, at 19:10, Brandon Zylstra wrote:

I couldn't get the directions here working, and figured I must have misunderstood something, so I tried the directions here: http://hiltmon.com/blog/2013/11/09/textmate-2-basics/

That didn't work either, so it appears that the problem is with rmate.

After attempting to rmate .bash_profile from ~ on the VM, I just get a new prompt, and after a little while of waiting I get:

$ /usr/local/bin/rmate:174:in `initialize': Connection timed out - 
connect(2) (Errno::ETIMEDOUT)
  from /usr/local/bin/rmate:174:in `new'
  from /usr/local/bin/rmate:174:in `connect_and_handle_cmds'
  from /usr/local/bin/rmate:228:in `block in <main>'
  from /usr/local/bin/rmate:227:in `fork'
  from /usr/local/bin/rmate:227:in `<main>'

Here is my .ssh/config for the Vagrant VM. All normal vagrant commands work, so I'm quite sure everything is good in that regard, but using the rmate command from inside the Vagrant VM fails.

Host ads
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile 
/Users/brandon/Code/ad-related-reports/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL

RemoteForward 52698 127.0.0.1:52698

TextMate does have permission to allow incoming connections in the Firewall settings. I even tried turning off the firewall, but that made no difference.


Reply to this email directly or view it on GitHub: https://github.com/textmate/rmate/issues/40

brandondrew commented 9 years ago

"Accept rmate connections" was turned on.

This was my ~/rmate.rc file:

host: auto                   # Prefer host from SSH_CONNECTION over localhost
port: 52698
unixsocket: ~/.rmate.socket  # Use this socket file if it exists

Sorry: forgot to mention those two things.

As for the tunnel, that was configured in the ~/.ssh/config file line below:

RemoteForward 52698 127.0.0.1:52698
sorbits commented 9 years ago

"Accept rmate connections" was turned on.

And “access for” is set to remote clients?

AJ-Acevedo commented 9 years ago

Try running rmate as root. or as the user you installed the gem as.

brandondrew commented 9 years ago

I'm fairly confident I tried that, but I'll try again just to make sure... thanks!

On Tue, Jun 30, 2015 at 8:33 PM, AJ notifications@github.com wrote:

Try running rmate as root.

— Reply to this email directly or view it on GitHub https://github.com/textmate/rmate/issues/40#issuecomment-117378656.

Brandon Zylstra brandon.zylstra@gmail.com

sorbits commented 9 years ago

I don’t think root should make a difference, but as mentioned above, you must set TextMate to allow access for remote clients, if you do not setup a tunnel (which I do not know how you would do with a virtual machine).

If you use the latest version of rmate, the error shown when it fails to connect should give a better idea of what failed.

On 2 Jul 2015, at 5:49, Brandon Zylstra wrote:

I'm fairly confident I tried that, but I'll try again just to make sure... thanks!

On Tue, Jun 30, 2015 at 8:33 PM, AJ notifications@github.com wrote:

Try running rmate as root.

— Reply to this email directly or view it on GitHub https://github.com/textmate/rmate/issues/40#issuecomment-117378656.

Brandon Zylstra brandon.zylstra@gmail.com


Reply to this email directly or view it on GitHub: https://github.com/textmate/rmate/issues/40#issuecomment-117897401