I want to evaluate an expression on a server where it has a kernel. I totally searched on the internet but still I am not able to connect to the remote kernel. I am looking for a clear and a direct answer. For this reason, I first clarify some points.

Suppose my username and password on the server are respectively "admin" and "123". The server address is "server.com" and the kernel is in the directory "/main/folder/" and the name of the kernel is "math". I am using ubuntu 16.04 and Mathematica 11.1.1.

My question in brief is:

How can I configure Mathematica remote kernel on ubuntu 16.04?


1 Answer 1


Duplicating the answer from here to make it easier to find.

This solution is tested for M11.2 for macOS client and Linux server.

  1. Create a password-less ssh login. Generated a public and private ssh key on the local machine (mac) and then copy the public key to the remote machine.

  2. Download packages from here.

  3. Copy the file init.m to the directory ~/.Mathematica/Kernel/ directory on the remote machine.

  4. Copy the file tunnel.sh to the directory ~/Library/Mathematica/FrontEnd/ on the local machine.

  5. In Mathematica, go Evaluation => Kernel Configuration Options => Add.

    • Select "Advanced Options"
    • Arguments for MLOpen:
      -LinkMode Listen -LinkProtocol TCPIP -LinkOptions MLDontInteract -LinkHost
    • Arguments for Launch command:
      "/Users/Account/Library/Mathematica/FrontEnd/tunnel.sh" [email protected]:port "wolfram" "`linkname`"
    • where Account must be your user name on the macOS.
    • where user by login in remote machine;
    • where remote.machine by ip address of remote machine;
    • where port by ssh port of remote machine.
    • Also make sure that wolfram command is available on the remote machine.
  6. Be patient, since establishing connections can take time. You can find a log file at ~/Library/Mathematica/FrontEnd/
  • $\begingroup$ For anyone else unable to extract the zip file containing tunnel.sh, you can find it here. Note though I couldn't get it working, though direct ssh in the Launch command worked $\endgroup$
    – Anti Earth
    Commented Jun 22, 2019 at 14:02
  • $\begingroup$ Those unable to resolve the wolfram command on the server - you can view the kernel location by evaluating $CommandLine in a server notebook. Mine was called WolframKernel $\endgroup$
    – Anti Earth
    Commented Jun 22, 2019 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.