title: Starting jupyter lab on remote computer throwing errors
body: <p>I have anaconda version 4.9.2 and Jupyter lab version 2.2.9 installed on my Ubuntu 20.10 personal server. Until about two months ago, I was able to remotely start jupyter lab on my remote server (accessed through MobaXterm). I used this command:
  <code>jupyter lab --no-browser --port=40000 --ip=$HOSTNAME</code></p>
  <p>I then used to forward this port to a local port 8080 in MobaXterm, and open the local port on my working laptop.</p>
  <p>After resetting the whole setup due to a move, I found that I am not able to forward the local port anymore. I get this error message:</p>
  <pre><code>    Traceback (most recent call last):
    File &quot;/home/kvemuri/anaconda3/bin/jupyter-lab&quot;, line 10, in &lt;module&gt;
      sys.exit(main())
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py&quot;, line 254, in launch_instance
      return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py&quot;, line 844, in launch_instance
      app.initialize(argv)
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py&quot;, line 87, in inner
      return method(app, *args, **kwargs)
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py&quot;, line 2085, in initialize
      self.init_webapp()
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py&quot;, line 1757, in init_webapp
      success = self._bind_http_server()
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py&quot;, line 1764, in _bind_http_server
      return self._bind_http_server_unix() if self.sock else self._bind_http_server_tcp()
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py&quot;, line 1790, in _bind_http_server_tcp
      self.http_server.listen(port, self.ip)
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/tornado/tcpserver.py&quot;, line 151, in listen
      sockets = bind_sockets(port, address=address)
    File &quot;/home/kvemuri/anaconda3/lib/python3.7/site-packages/tornado/netutil.py&quot;, line 161, in bind_sockets
      sock.bind(sockaddr)
  OSError: [Errno 22] Invalid argument
  </code></pre>
  <p>I am not too well-versed with the inner workings of port forwarding, I blindly followed the instructions on this page: <a href="https://wiki.fysik.dtu.dk/gpaw/summerschools/summerschool18/accesswin.html" rel="nofollow noreferrer">https://wiki.fysik.dtu.dk/gpaw/summerschools/summerschool18/accesswin.html</a></p>
  <p>The solution in <a href="https://stackoverflow.com/a/30268744/3258696">this question</a> provided some clue, but I am not sure how to go about 'binding the socket to a local network interface on same network', if that is even what I need to do. Any thoughts?</p>