title: How can we Tunnel Tensorboard in Google colab without Ngrok connection limitation?
body: <p>The two common approaches to access Tensorboard Google colab is following </p>
  
  <h2>Tensorboard magic inline method</h2>
  
  <p>Using Jupyter (etc) magic commands to display tensorboard inline in Notebook</p>
  
  <pre><code>%load_ext tensorboard
  %tensorboard --logdir {logs_base_dir}
  </code></pre>
  
  <p>This is the most common method and it has some major drawbacks</p>
  
  <ul>
  <li>Limited amount of screen space</li>
  <li>Does not always start</li>
  <li>Tend to show a message like <code>Process already running use '!kill pid 9999'</code> ( running the suggested !kill command does not work )</li>
  </ul>
  
  <h2>Tensorboard tunnel with Ngrok</h2>
  
  <p>Other method is using Ngrok and creates a tunnel that allows access to tensorboard in a separate tab </p>
  
  <pre><code>!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
  !unzip ngrok-stable-linux-amd64.zip
  
  os.makedirs(logs_base_dir, exist_ok=True)
  get_ipython().system_raw(
      'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &amp;'
      .format(logs_base_dir))
  
  get_ipython().system_raw('./ngrok http 6006 &amp;')
  ! curl -s http://localhost:4040/api/tunnels | python3 -c \
      "import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])"
  </code></pre>
  
  <p>This method is awesome exept Ngroks 20 connections per minut limitation.  As tensorboard are doing background refresh it will soon reach that limit and requre one to reload the page, wait a few minutes and then load the data, and keep repeating that. </p>
  
  <h3>What is the option?</h3>
  
  <p>Do we have another software similar to Ngrock that does not have limitations and would work with colab? I also see a solution where a tunnel directly towards the machine's IP is open up, that would solve limitations. </p>
  
  <p>In an local environment, the simple &amp; reliable way is to run tensorboard as a foreground process in a terminal simply by doing something like </p>
  
  <pre><code>tensorboard --logdir './log' --host localhost
  </code></pre>
  
  <p>How we make the tensorboard user experience pleasant on colab?   </p>
  
  <ul>
  <li>Google colab machines are running Ubuntu 18</li>
  <li>Basically any terminal command is possible </li>
  </ul>
  
  <p>Notebook with both methods included can be found <a href="https://colab.research.google.com/drive/1Zyn9Q_Gf3KnVIhdl9t2ond5IjJNaTriL#scrollTo=GaNU7cYAHxJ5" rel="nofollow noreferrer">here</a></p>