X11 Forwarding Through Google Colab

x11 forwarding through Google Colab

tl;dr

  1. Open 6000/tcp port on your router and firewall
  2. Install VcXsrv
  3. Run "XLaunch" with "Disable access control"
  4. Run "!apt-get install x11-apps && export DISPLAY=YOUR_IP_ADDRESS:0.0 && eyes" on Colab

Sample Image

Check

  1. Google Colab does not keep environment variables across code cells. So you should set DISPLAY variable each them.

Google Colab does not keep environment variables across code cells


  1. Xming may disallow remote connection as a default setting. At least, VcXsrv do that. Try to disable access control. This is an insecure option.

Sample Image


  1. Router and firewall must open 6000+n/tcp port. The n is display number counting from 0. (e.g. HOSTNAME:0.0 → n=0)
    Open Port Check Tool - Test Port Forwarding on Your Router
    Sample Image

forwarding x11 by SSH.NET c# library

I found the solution:

 SSHInstance = new SshClient(HostOrIP, Port, Username, Password);
SSHInstance.Connect();
streamSSH = SSHInstance.CreateShellStream(ShellID, 1, 0, 0, 0, 2000000);

ForwardedPortRemote forwardedPortRemote = new ForwardedPortRemote(6000 +X11ServerDisplay, HostOrIP, 6000 + X11LocalDisplay);
SSHInstance.AddForwardedPort(forwardedPortRemote);
forwardedPortRemote.Start();


Related Topics



Leave a reply



Submit