<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Markus, Hamish,<div><br></div><div>thank you so much!</div><div>starting my SSH session with:</div><div><br></div><div> ssh -Y -C -C -l username my.server.host </div><div><br></div><div>works perfect when i start grass from the SSH shell.</div><div>but my “real-use case" is a bit different</div><div><br></div><div>I’m used to run grass from inside an IPython notebook</div><div>to have grass loaded in the notebook session, i make a simple bash script : ‘ ipython_GRASS.sh ‘</div><div>that looks like :</div><div><br></div><div><br></div><div><pre style="padding: 0px; font-size: 14.399999618530273px; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; margin-top: 0px; margin-bottom: 0px; line-height: 17.603300094604492px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: rgb(255, 255, 255); border: 0px; vertical-align: baseline; position: static; z-index: auto;">PREFIX=/home/$USER/Envs/env1
export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/grass-7.0.svn/lib:$PREFIX/lib/R/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=$PREFIX/grass-7.0.svn/etc/python:$PYTHONPATH
export GISBASE=$PREFIX/grass-7.0.svn/
export PATH=$PREFIX/bin/:$GISBASE/bin:$GISBASE/scripts:$PATH
export GIS_LOCK=$$
mkdir -p /home/$USER/Envs/grass7data
mkdir -p /home/$USER/Envs/.grass7
export GISRC=/home/$USER/Envs/.grass7/rc
export GISDBASE=/home/$USER/Envs/grass7data
export GRASS_TRANSPARENT=TRUE
export GRASS_TRUECOLOR=TRUE
export GRASS_PNG_COMPRESSION=9
export GRASS_PNG_AUTO_WRITE=TRUE
ipython notebook —ip=xxx.xxx.xxx</pre><div><br></div></div><div><br></div><div><br></div><div>in this way i can start the notebook server from the SSH shell with :</div><div><br></div><div> nohup sh ipython_GRASS.sh &</div><div><br></div><div>and all works fine.</div><div><br></div><div>of course if i quit the SSH shell i will loose all the “ X support ” from my local machine.</div><div><br></div><div>Do you have any hints on how to export the X support inside the ipython_GRASS.sh in order to tell grass to use the server X ?</div><div><br></div><div><br></div><div>I’m asking because i’m using the script in a crontab file that is loaded at each reboot :</div><div><div><br></div><div>@reboot nohup sh ipython_GRASS.sh &</div><div><br></div><div>so to have the notebook server always up and running without the needs to login into ssh all the time</div><div>It works .. but except for the bad server connection.</div></div><div><br></div><div>Thanks for any hints!</div><div><br></div><div>Massimo.</div><div><br></div><div><br></div><div><br><div><div>On Feb 7, 2014, at 10:11 PM, Hamish <<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">epi wrote:<br><br><blockquote type="cite"><blockquote type="cite"> i'm tring to generate a 3d image with m.nviz.image,<br>the following command works fine form a 'standard'<br>GRASS session in text mode on my laptop but if try<br>to run the same command on a sever while i'm connected<br>via SSH i got the error : Bad server connection<br></blockquote></blockquote><br>MarkusN:<br><blockquote type="cite">Many grass power users work like this, so that's well<br>tested in general.<br></blockquote><br>I was doing it with m.nviz.image last weekend actually.<br><br>Note wrt running remotely on a server, m.nviz.image is special.<br><br><br><blockquote type="cite"><blockquote type="cite"> Have you any clue on how to fix this ?<br> is there any environment var that needs to be exported<br>in order to have m.nviz.image running during an SSH session ?<br><br> GRASS 7.0.svn (nc_spm_08_grass7):~ > m.nviz.image \<br> elevation_map=elevation \<br> output=elevation_3d \<br> perspective=15 \<br> height=2000 \<br> color_map=elevation \<br> resolution_fine=1 \<br> resolution_coarse=1 \<br> format=tif<br><br><br> ERROR: Bad server connection<br></blockquote><br><br>Did you redirect the Display stream?<br><br>ssh -Y yourserver<br><br>Perhaps that solving the issue.<br></blockquote><br>Depending on if it's a local gigabit network or if you are calling in from home, I'd strongly suggest to use 'ssh -C' as well, since m.nviz.image will want to do about half of its processing on the *local* X server, not the remote computer, and that's a lot of network traffic!<br><br>Last weekend's task was running m.nviz.image many times in a loop for an animation, and trying to do it remotely from my netbook via a GNU Screen session. But the network connection out at the farm wasn't that good and the several years old netbook's graphics hardware is pretty poor compared to the graphics card in the remote workstation. It took ~10 times as long running it remotely, but it did get there.<br><br>m.nviz.image didn't work (entirely from the command line) when the DISPLAY enviro var wasn't set correctly in GNU Screen though, I had to reestablish the session to fix that first.<br><br><br>good luck,<br>Hamish<br><br></blockquote></div><br></div></body></html>