title: Start IPython remotely using SSH+screen, then detach and log out
body: <p>I have a computer on my LAN that I would like to run an IPython Notebook server on. The computer is headless, so I can only access this computer using SSH. I tried to start IPython Notebook through screen, then detach, but the kernel restarts with X server errors. </p>
  
  <p>Specifically, I did the following:</p>
  
  <ul>
  <li>SSH into remote box:  <code>ssh -X 1.1.1.1</code></li>
  <li>Start or re-attach to last screen: <code>screen -RD</code></li>
  <li>Start Notebook <code>ipython notebook</code> </li>
  <li>Detach and logout: <code>ctrl-a-d</code>,  <code>exit</code></li>
  </ul>
  
  <p>The remote Notebook server works fine, until I log out, and then try and create a matplotlib plot. At which time I get</p>
  
  <pre class="lang-none prettyprint-override"><code>Kernel Restarting
  The kernel appears to have died. It will restart automatically.
  </code></pre>
  
  <p>from the client's web-browser, and</p>
  
  <pre class="lang-none prettyprint-override"><code>-c: cannot connect to X server localhost:10.0
  2013-08-01 10:28:48.072 [NotebookApp] KernelRestarter: restarting kernel (1/5)
  WARNING:root:kernel 6e0f5395-6ba7-44c8-912f-1e736dd66517 restarted
  </code></pre>
  
  <p>on the server. </p>
  
  <p>It appears as though the Notebook can't plot as soon as I log out due to lack of X-resources. Does anyone have a solution to this?</p>