4
$\begingroup$

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?

$\endgroup$
2
$\begingroup$

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 127.0.0.1
    • Arguments for Launch command:
      "/Users/Account/Library/Mathematica/FrontEnd/tunnel.sh" user@remote.machine: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/
$\endgroup$
  • $\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 Jun 22 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 Jun 22 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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