Reputation: 3538
I do my dev work on a Mac OSX machine with a Ubuntu Server Virtual Machine installed, which I manage mostly by SSHing into it from Terminal. I am trying to find a way to edit files on the server using Sublime Text on the Mac rather than nano or vim from Terminal. I have followed the instructions contained in this excellent guide, "Using Textmate 2s rmate with Sublime Text 2".
When I SSH into my server and run
rmate .profile
I get the error
connect_to localhost port 52698: failed.
This previous question refers to a similar error, but it appears to be related to having more than one SSH connection open, and I don't think that is the case for me. How could I test for that, though?
I was wondering if this could be somehow related to the fact that my dev server is a Virtual Machine with a slightly arcane internet set-up - using three different adapters that connect to the host machine's ethernet and WiFi connections. Would reverse tunnelling over SSH require different tweaking with this set-up?
Or, any other suggestions for resources or references to get this set up?
Upvotes: 5
Views: 5940
Reputation: 5134
I had to kill all existing SSH sessions with
pkill -o -u YOURUSERNAME sshd
after that, it worked again.
Upvotes: 1
Reputation: 149
If you want to avoid port-forwarding completely, you can try something I've been working on called 'xeno' (https://xeno.io). It's very similar to rmate/rsub, except that it does not use reverse port-forwarding to enable synchronization. Instead, it uses a mashup of Git and SSH to enable its transport and synchronization. This gives it a number of advantages over rmate/rsub - in particular you can edit entire folder hierarchies. It is also completely robust to connection drop-outs, so you can even work offline and have editing changes you've made locally automatically pushed to the remote once you are back online.
It's also free and open source :), and I'd really love some feedback.
Upvotes: 1
Reputation: 3538
In VirtualBox > Settings > Network > Adapter 2 (the NAT adapter) > Advanced, I added a Port Forwarding rule with hostmachine:52698 to the guestmachine:52698. This appears to have resolved it.
Upvotes: 2
Reputation: 8881
issue the following command to check if port is opened in VM :
telnet localhost 52698
If not opened then you need to open it.
Upvotes: 3