# Programmatic remote kernel creation via SSH

**URL:** <https://community.wolfram.com/t/programmatic-remote-kernel-creation-via-ssh/12910>\
**Category:** Ideas\
**Tags:** mathematica, wolfram-add-ons, external-interfaces, high-performance-computing, packages-and-paclets, raspberry-pi\
**Created:** [July 31, 2018, 1:06am UTC](https://community.wolfram.com/t/programmatic-remote-kernel-creation-via-ssh/12910 "2018-07-31T01:06:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike5](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@mike5](https://community.wolfram.com/u/mike5)\
**Post date:** [July 31, 2018, 1:06am UTC](https://community.wolfram.com/t/programmatic-remote-kernel-creation-via-ssh/12910/1 "2018-07-31T01:06:04Z")

</div>

([Cross-post from Reddit](https://www.reddit.com/r/Mathematica/comments/938q9n/programmatic_remote_kernels_over_ssh_like_on/ "Cross post from Reddit"))

So I recently picked up a Raspberry Pi, and after playing with it and realizing that it has a full-fledged Mathematica in it, I started thinking about the possible use cases for a handful of these and some good sensors. The problem I ran into was that kernel configuration was flakey, problematic, error prone, and if you had more than a couple it rapidly became unfeasible.

My approach was to spend some time and put together a package that simplified programmatic connection to remote machines, launching the remote process, and linking it with the front-end. Specifically, I didn’t want to have the RPi kernel my notebook kernel, but rather as an available parallel kernel, so that I could still run the heavy lifting locally, and use the remote kernels for data collection/remote sensing/etc…

The result is [SSHKernel](https://github.com/Riebart/MathematicaSSHKernels), a small package that aims to do just this! I couldn’t find anything like this kicking around, and the RemoteKernel internal stuff wasn’t quite working for me, so I rolled it myself, but I’m just as happy if someone can point me in the direction of an existing solution.

# MathematicaSSHKernels docs

Support for remote kernels built programmatically over SSH and dynamic remote port forwarding.

## Installation

Stick the `SSHKernel.m` file into `$UserBaseDirectory<>"\\Applications"`.

## Example Usage

```
In[1]:= Needs["SSHKernel`"]

In[2]:= (* "raspberrypi" is the hostname configured in my ~/.ssh/config *)
        rk = SSHKernel["raspberrypi"]; // AbsoluteTiming
Out[2]= {11.535, Null}

In[3]:= ParallelEvaluate[$Version, rk]
Out[3]= "11.2.0 for Linux ARM (32-bit) (January 15, 2018)"

In[4]:= $Version
Out[4]= "11.3.0 for Microsoft Windows (64-bit) (March 7, 2018)"

```

![example.gif](https://global.discourse-cdn.com/wolfram/original/3X/7/3/73935b6d1590a0b651819cf82f9439aa55933f75.gif)
