# Impossible to connect to a remote kernel

**URL:** <https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986>\
**Category:** Questions\
**Tags:** mathematica, optimization\
**Created:** [August 15, 2014, 5:15pm UTC](https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986 "2014-08-15T17:15:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raffaelesantagati1](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@raffaelesantagati1](https://community.wolfram.com/u/raffaelesantagati1)\
**Post date:** [August 15, 2014, 5:15pm UTC](https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986/1 "2014-08-15T17:15:48Z")

</div>

Hello everybody!

I am trying to configure Mathematica to work through ssh, in order to use the 12 remote kernels I have on a remote Linux Machine running Mathematica 8.0.

I am trying to connect from a Mac OSX 10.9.4 machine with Mathematica 9.0.1.

I followed step by step the guide in the references (quite poor I have to admit) available here:

> **[Connect to a Remote Kernel—Wolfram Documentation](https://reference.wolfram.com/language/howto/ConnectToARemoteKernel.html)**
>
> The Wolfram System can run its calculations on other computers that have the Wolfram System installed. Passing computations to other, potentially more powerful, machines can increase the efficiency of your work.

and the good thing is that at least Mathematica front end is asking me for the password, but after inserting it, i always get the error:

“The kernel LinuxKernel failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.”

I tried to start the kernel through a Terminal session in ssh and it works just fine. But why I cannot start it from the FrontEnd?  
I tried playing a bit with the settings in Mathematica but I didn’t get far.

Does anybody have an idea on how to set up properly this thing? Or at least if it is possible to find a tutorial less useless (at least for me) than that one in the support page?

Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![ronai](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@ronai](https://community.wolfram.com/u/ronai)\
**Post date:** [December 7, 2014, 5:06am UTC](https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986/2 "2014-12-07T05:06:37Z")

</div>

Hi,

The same problem with Mac OS X 10.10 machine with Mathematica 10 as client and Linux Debian with Mathematica 10.

“The kernel LinuxKernel failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.”

When we have a solution?

Thank you  
R Lisboa

---

<div class="post-metadata">

**Author:** ![raffaelesantagati1](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@raffaelesantagati1](https://community.wolfram.com/u/raffaelesantagati1)\
**Post date:** [December 7, 2014, 12:04pm UTC](https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986/3 "2014-12-07T12:04:22Z")

</div>

Hi R lisboa,  
the kernel works just fine, the problem is making it work through the front end.  
In order to don’t have to manually copy all my others nb in the server.

It is quite disappointing that in wolfram website there is not clear help about this problem.

Cheers  
Raf

---

<div class="post-metadata">

**Author:** ![ronai](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@ronai](https://community.wolfram.com/u/ronai)\
**Post date:** [December 7, 2014, 4:42pm UTC](https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986/4 "2014-12-07T16:42:33Z")

</div>

Hi,

There is a solution following the documents at:

1. 

> **[Remote Kernel Strategies -- from Wolfram Library Archive](https://library.wolfram.com/infocenter/Conferences/7250/)**
>
> Mathematica permits the front end to connect to a Mathematica kernel running on a remote machine. This allows for running the front end and the kernel on different platforms, which is a common scenario for gridMathematica installations, where the...

and

1. 

[http://www.physics.rutgers.edu/~rvaughn/Mathematica\_Remote/Mathematica\_Remote\_HowTo.doc.092512](http://www.physics.rutgers.edu/~rvaughn/Mathematica_Remote/Mathematica_Remote_HowTo.doc.092512)

In reference [1] there are two files: \*.nb and \*.zip. In the last there are the files:  
init.m,  
tunnel.bat (window),  
tunnel.sh (linux and mac)

In reference [2] there is one file: \*.doc that is a how-to.

Works ! I did (linux as remote and mac OS X as local machines).

a) I generated a public and private ssh key on my local machine (mac) without password. I copied the public key to the remote machine.

b) I copied the file init.m to the directory /home/Account/.Mathematica/Kernel/ directory on the remote machine. Where Account is your account in remote machine.

c) I copied the file tunnel.sh to the directory /Users/Account/Library/Mathematica/FrontEnd/ on the local machine. Where Account is your account.

d) I set the remote kernel on the local machine:

Evaluation / Kernel Configuration Options / Add

Kernel name: RemoteKernel

Basic Options:

- check: Remote machine;
- Kernel program: the path of math in remote machine. (the mine is: Ex.: /home/opt/bin/math)
- Remote host: the address of remote machine (or ip): Ex.: remote.machine:port. where port is the ssh port to access the remote machine.

Advanced Options:

- Arguments to MLOpen:  
-LinkMode Listen -LinkProtocol TCPIP -LinkOptions MLDontInteract -LinkHost 127.0.0.1

-Launch command:  
“/Users/Account/Library/Mathematica/FrontEnd/tunnel.sh” user@remote.machine:port “/home/opt/bin/math” “`linkname`”

ATTENTION: `linkname` is between " " and " ` " that not appear above.

Replace above:

- Account by your directory in local machine;
- user by login in remote machine;
- remote.machine by ip address of remote machine;
- port by ssh port of remote machine.

- Open a new notebook. set the Default Kernel to remote machine. test the configuration from new notebook: $Version

Thank you

R Lisboa

---

<div class="post-metadata">

**Author:** ![wolfganglerche](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@wolfganglerche](https://community.wolfram.com/u/wolfganglerche)\
**Post date:** [March 10, 2018, 10:56am UTC](https://community.wolfram.com/t/impossible-to-connect-to-a-remote-kernel/2986/5 "2018-03-10T10:56:20Z")

</div>

I seem to have the same problem with Mma 7.0, and tried all what was recommended here, and more, to no avail.  
It used to work fine since years, but now after about 1 year of pause I noticed remote kernels “suddenly” don’t work any more.  
AFAIK I didn’t change the Mma setup in the mean time.

Here are the data:

-Problem happens for Mma 7.0 but for MMa 11.0 all is fine!

-Problem happens for any pair of two out of 3 machines.

-Machines run macOS High Sierra, 10.13.3

-passwortless ssh works between all machines

-I can run remote kernels via ssh

-I tried various setups using mathssh, tunnel.sh

-The following errors appear immediately, so it seems likely that the error is with the frontend and not with the connection:

-setup using mathssh yields: “The kernel xxxxx failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.”

-setup using tunnel.sh: yields panel with “Mathematica could not establish a connection to the kernel. Kernel: Local. Low-level MathLink error: Unknown internal error.”

-I suspect it may have to do with Java, there were some other problems in the past with Java and Mma.

Any help?

Thanks!
