本文介绍了通过Google Colab进行x11转发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望x11转发能够在Google Colab上工作.我使用的是Windows 10计算机,可在文章底部找到Google Colab OS信息.这是我进行测试的方法:

  1. 安装

    检查

    1. Google Colab不会在代码单元之间保留环境变量.因此,您应该为每个变量设置DISPLAY变量.
    1. Xming可能不允许将远程连接作为默认设置.至少,VcXsrv可以做到这一点.尝试禁用访问控制.这是一个不安全的选择.
    1. 路由器和防火墙必须打开6000 + n/tcp端口.n是从0开始计数的显示编号(例如,主机名:0.0→n = 0)

    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:

    1. Installed Xming and ran it.
    2. Made a new IPython notebook in Google Colab and installed x11 apps successfully using

      !sudo apt-get install x11-apps
      

    3. Set my display to be my IP address using

      !export DISPLAY=<my-ip-address>
      

    4. Run !xeyes. I get an error message saying Error: 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
    
    解决方案

    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

    Check

    1. Google Colab does not keep environment variables across code cells. So you should set DISPLAY variable each them.
    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.
    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

    这篇关于通过Google Colab进行x11转发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:38