connect to an remote kernel

2,990 views
Skip to first unread message

Serge Scevenels

unread,
Oct 20, 2014, 2:44:42 PM10/20/14
to spyd...@googlegroups.com
Hi,

I would like to know how can i connect Spyder to an ipython kernel active on a vagrant VMs. 

I'd like to know what kind of config I should introduce as connection info, ssh key, etc...

Maybe it is not yet supported. If it is the case, please let me know :)

Thks,
Serge

Adrian Klaver

unread,
Oct 20, 2014, 9:22:32 PM10/20/14
to spyd...@googlegroups.com
Have not gone all the way through the below, but it would seem to cover
what you are asking:

https://github.com/ipython/ipython/wiki/Cookbook:-Connecting-to-a-remote-kernel-via-ssh

>
> Thks,
> Serge
>



--
Adrian Klaver
adrian...@aklaver.com

Carlos Córdoba

unread,
Oct 20, 2014, 10:21:50 PM10/20/14
to spyd...@googlegroups.com
Hi Serge,

Since Spyder 2.3.1 this is very easy, using ssh. You need to go to the menu

    Consoles > Connect to an existing kernel

and introduce the information about your remote kernel (i.e. ip address, remote user name, etc).

One important thing to consider is that you need to ssh first to your remote machine using a regular terminal (i.e. outside Spyder), to avoid a lock while waiting for the connection confirmation.

If you have any further doubts, please feel free to post them here :-)


Cheers,
Carlos

El 20/10/14 a las #4, Serge Scevenels escribió:
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Serge Scevenels

unread,
Oct 24, 2014, 2:17:25 PM10/24/14
to spyd...@googlegroups.com
Hi Carlos,

thanks for the reply. 

I managed to connect to the remote kernel !! I did it this way, and then I'll ask you if it can be simpler :)

1. on the VM, I start a kernel with port set using the following command line:
ipython kernel --profile=spyder --ip 0.0.0.0 --control=11111 --shell=22222 --iopub=55555 --hb=33333 --stdin=44444 --ipython-dir=/home/vagrant/.ipython -f /vagrant/.ipython-kernel.json

2. i configured on the VM the corresponding forwarded port

3. in Spyder, I select connect to an existing kernel and I provide :
  a. the json file located on the shared folder
  b. I provide the <user>@<ip guest>:<port> to connect to the machine via SSH
  c. I provide the password

This is working great. I have been able to automatise step 1 and 2 easily, so that I don't need to repeat these steps everytime I turn on my VM. However, evertime I start spyder on the host machine, I'll need to re-do step 3. Is there a way to automatize it at spyder start ?

Thks,
Serge 

Serge Scevenels

unread,
Oct 31, 2014, 6:37:09 AM10/31/14
to spyd...@googlegroups.com
Hi all,

can somebody help me with this latest problem I am having :)

Can it be resolved by using a custom PYTHONSTARTUP script ? If it is the case, can i have some hint :)

Thks

Adrian Klaver

unread,
Oct 31, 2014, 12:37:14 PM10/31/14
to spyd...@googlegroups.com
On 10/31/2014 03:37 AM, Serge Scevenels wrote:
> Hi all,
>
> can somebody help me with this latest problem I am having :)
>
> Can it be resolved by using a custom PYTHONSTARTUP script ? If it is the
> case, can i have some hint :)

You can simplify some of 3) b&c by using ssh config and public key
connections:

http://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/

Here is a SO answer that may help with a startup file:

http://stackoverflow.com/questions/9977446/connecting-to-a-remote-ipython-instance
>> <http://groups.google.com/group/spyderlib>.
>> For more options, visit https://groups.google.com/d/optout
>> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to spyderlib+...@googlegroups.com
> <mailto:spyderlib+...@googlegroups.com>.
> To post to this group, send email to spyd...@googlegroups.com
> <mailto:spyd...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/spyderlib.
> For more options, visit https://groups.google.com/d/optout.


--
Adrian Klaver
adrian...@aklaver.com

Adrian Klaver

unread,
Oct 31, 2014, 2:13:48 PM10/31/14
to spyd...@googlegroups.com
On 10/31/2014 03:37 AM, Serge Scevenels wrote:
> Hi all,
>
> can somebody help me with this latest problem I am having :)
>
> Can it be resolved by using a custom PYTHONSTARTUP script ? If it is the
> case, can i have some hint :)

Just found this:

http://ipython.org/ipython-doc/dev/config/options/qtconsole.html?highlight=sshserver

IPythonQtConsoleApp.sshkey : Unicode

Default: ‘’

Path to the ssh key to use for logging in to the ssh server.
IPythonQtConsoleApp.sshserver : Unicode

Default: ‘’

The SSH server to use to connect to the kernel.

A way of configuring your profile to work with SSH.

>
> Thks
>

--
Adrian Klaver
adrian...@aklaver.com

Octave Oppetit

unread,
Oct 13, 2016, 7:22:50 PM10/13/16
to spyder, adrian...@aklaver.com
Hi,

I'm trying to connect my Windows Spyder IDE to an Ubuntu ipython kernel - I read that from Windows this feature is error-prone. Should it definitely be possible?

Thanks

Octave
Reply all
Reply to author
Forward
0 new messages