Connect emacs simulator to clojure vagrant host

I am trying to use vagrant

, Clojure

and emacs

together. In particular, I cannot connect cider

to my machine vagrant

.

It works locally when I run cider-jack-in

inside my project. But I don't know what steps need to be taken in one project (synced via roaming shared folders) on a roaming machine.

Here's my attempt:

  • ssh vagrant

    then cd my-project-dir

    thenlein repl

  • in emacs,, cider-connect

    input vagrant@192.168.50.50

    , port22

I receive the following message:

SSH port forwarding error. check the nrepl tunnel buffer.

Inside this buffer:

OpenSSH_6.2p2, OSSLShim 0.9.8r Dec 8, 2011 Privileged ports can only be forwarded by root.

Nrepl tunnel process exited abnormally with code 255

Ho, am I running this as root? Is this really a problem? Should I be using a different port? Do I have to put something specific in my Clojure code to enable this? The directions given here are a little unclear to me.

Note : it is different from this question because it emacs

works on the host machine, not the machinevagrant

Edit :

Here are the detailed steps I took, thanks to @ Shlomi's answer:

  • Modify .ssh / config adding the following (edit the IP to your address Vagrantfile

    ):

    Rogue host HostName 192.168.50.50 Port 22 Custom rogue ForwardAgent yes

  • in the host, run my project with lein repl

    . Pay attention to the port in the message:nREPL server started on port 42018 on host 127.0.0.1 - nrepl://127.0.0.1:42018

  • in emacs,, the M-x cider-connect

    login firewall, your password and port noted by the previous command lein

    .

  • What is it:)

+3


source to share


1 answer


It seems that the port you are using is the ssh port instead of the nrepl port.

I usually use emacs for remote access via tramp:



  • Add an entry in .ssh / config for your remote host, say vagrant
  • In emacs,, cider-connect

    typevagrant

  • In the latest versions of cider, it will automatically find all active nrepl sessions on that host and show the project name and port, so choose the correct one and you can start working.
+2


source







All Articles