# Remote Kernel configuration works in v9 but not in v10

I have both v9 and v10 currently installed on my computer (Windows 7). For reasons that are not entirely clear, if I create a new remote kernel in one version, it is accessible to the other; however, there are differences. Note the following screen shot:

The picture above shows the kernel properties for the same kernel connection when viewed in v9 (left) or v10 (right). The results are the same regardless of whether I initially create the new kernel connection in v9 or v10. Note that the shell commands are different for the two versions:

### v9

"java" -jar "mathssh" pi@raspilab wolfram -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "linkname" -LinkHost ipaddress

### v10

"java" -jar "wolframssh" pi@raspilab wolfram -wstp -LinkMode Connect -LinkProtocol TCPIP -LinkName "linkname" -LinkHost ipaddress

The problem is: the remote kernel works properly in v9 but not v10. In v10, I get the error message "SSH's connection for kernel 'rpi_kernel' was unexpectedly terminated. Error code = 103."

I don't believe this is a known hosts problem. Removing the known_hosts file does not change the behavior in v10 (it still throws the 103 error) but causes v9 to request that the new host be added and the known_hosts file be created. No wolfram processes are currently active on the RPi and I have turned off my VPN to avoid a previous problem. If I use the advanced options to force the v10 Shell command to look like that for v9, I get the same 103 error code. If I do the reverse, and use the v10 command in v9, I get an Error code = 1 for which there seems to be no good solution.

• Based on the speed at which the 103 error is returned, I suspect that v10 is not even attempting to connect to the RPi kernel.
• Using the RPi's IP address instead of its hostname does not alter the results.

Does anyone have any insight into resolving this problem?

• Have you tried using a different ssh binary instead of wolframssh (probably needs to be specified with the full absolute path? – shrx Dec 20 '14 at 20:09
• @shrx a good suggestion and I will try that soon. I did try the complete v9 command but since I didn't put a full path in, there's no reason to think it would have worked properly. – bobthechemist Dec 21 '14 at 4:38
• @shrx no luck. I can substitute the full path of wolframssh in the v9 kernel configuration; but the same does not hold true for v10 (either the path of the v10 wolframssh or the v9 version of the jar file) – bobthechemist Dec 21 '14 at 15:19
• The wolframssh.jar file in 10.0.1 and 10.0.2 is broken. I can't tell from your last comment if you tried using the v9 version of wolframssh with a v10 kernel, but that method works with my windows 8 machine. Also, you could try doing simpler commands (e.g., pwd, ls) to help with debugging: Run["java -jar pathto/WolframSSH.jar pi@raspilab pwd"] – ChadK Dec 22 '14 at 15:14
• @chadk Thanks for the comment. I'll spend some more time trying the v9 wolframssh with v10 now that I know someone has gotten that to work. – bobthechemist Dec 22 '14 at 19:43

The WolframSSH.jar file in 10.0.1 and 10.0.2 is broken. In fact, WolframSSH.jar has not accepted alternate locations for the keyfile locations (and I don't know what the default directories are that it searches) since before version 8.

So there are 2 possible solutions. One is to use the v9 version of WolframSSH.jar. The other (and the one I recommend) is to install cygwin and use its ssh (which will have a path like c:\cygwin64\bin\ssh).

Mathematica 10 has new process functions that can be used to test connections to remote machines. To test an ssh connection, you could try this:

process = StartProcess[$SystemShell]; cmd = "\\cygwin64\\bin\\ssh me@machinename ls"; WriteLine[process, cmd] ReadLine[process] (* evaluate this multiple times to see line by line output *)  Import could also be used here (and for this case is much simpler): Import["!" <> cmd, "Text"]  The StartProcess function is more useful when linking to a kernel. Here is some code that I've used to launch a remote kernel and perform evaluations: Preliminaries (note that my math script is in my path, so I don't give full path in mathl function):  mathl[link_] := "math -mathlink -linkmode Connect -linkprotocol TCPIP -linkname "<>link <> " -subkernel -noinit &< /dev/null &"; machine = "mymachine"; link = LinkCreate[LinkProtocol -> "TCPIP"]; linkname = First@link; cmd = "\\cygwin64\\bin\\ssh " <>$UserName <> "@" <> machine <>
" \"" <> mathl[linkname] <> "\"";


Processes:

process = StartProcess[$SystemShell]; WriteLine[process, cmd];  That should have launched a remote kernel. You can check with ps, taskmanager, etc. Better yet, try to communicated with the remote kernel: LinkWrite[link, Unevaluated@{$MachineName, Now}];

LinkClose[link]