Issue
I was hoping to get x11 forwarding to work on Google Colab. I am using a Windows 10 machine and the Google Colab OS information can be found at the bottom of the post. Here's what I did to test it out:
- Installed Xming and ran it.
Made a new IPython notebook in Google Colab and installed x11 apps successfully using
!sudo apt-get install x11-apps
Set my display to be my IP address using
!export DISPLAY=<my-ip-address>
Run
!xeyes
. I get an error message sayingError: Can't open display:
I'm not sure if this is a problem of using the correct DISPLAY setting, running x11 forwarding through Google Colab or both!Can anyone help me out? Thank you!
The relevant parts of the output of when I run !cat /etc/os-release
on my Google Colab notebook.
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
VERSION_ID="18.04"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Solution
tl;dr
- Open 6000/tcp port on your router and firewall
- Install VcXsrv
- Run "XLaunch" with "Disable access control"
- Run "!apt-get install x11-apps && export DISPLAY=YOUR_IP_ADDRESS:0.0 && eyes" on Colab
Check
- Google Colab does not keep environment variables across code cells. So you should set DISPLAY variable each them.
- Xming may disallow remote connection as a default setting. At least, VcXsrv do that. Try to disable access control. This is an insecure option.
- 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
Answered By - Melvin A. Tirado
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.