Tk初始化失败:没有显示名称和$ display环境变量

时间:2022-06-20 23:51:09

I am trying to invoke the tool on Centos server from the Ubantu terminal.I am getting the following error.

我正在尝试从Ubantu终端调用Centos服务器上的工具。我得到了以下错误。

Tk initialization failed: no display name and no $DISPLAY environment variable.

Tk初始化失败:没有显示名称和$ display环境变量。

Please Help me with this.Thanks in advance.

请帮我一下。提前谢谢。

2 个解决方案

#1


2  

Connect to your CentOS machine with ssh -Y which (per man ssh)

使用ssh -Y连接到CentOS计算机(每个人ssh)

Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

支持可信X11转发。受信任的X11转发不受X11安全扩展控制。

That will allow your Tk process to connect to X11 on your Ubuntu machine.

这将允许您的Tk进程在Ubuntu机器上连接到X11。

#2


0  

I work on Ubuntu. I had the same problem while using gitk on remote machines. So I tried following

我在Ubuntu上工作。我在远程机器上使用gitk时遇到了同样的问题。所以我尝试后

ssh @ip and ran gitk& got the "no display name and no $DISPLAY environment variable." error

ssh @ip并运行gitk&获取“无显示名,无$ display环境变量”错误

ssh -X @ip and ran gitk& it worked! ssh -Y @ip and ran gitk& it worked!

ssh -X @ip,运行gitk&it !ssh -Y @ip,运行gitkit !

Thanks for the solution. @Elliott Frisch

谢谢你的解决方案。@Elliott弗里希

#1


2  

Connect to your CentOS machine with ssh -Y which (per man ssh)

使用ssh -Y连接到CentOS计算机(每个人ssh)

Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

支持可信X11转发。受信任的X11转发不受X11安全扩展控制。

That will allow your Tk process to connect to X11 on your Ubuntu machine.

这将允许您的Tk进程在Ubuntu机器上连接到X11。

#2


0  

I work on Ubuntu. I had the same problem while using gitk on remote machines. So I tried following

我在Ubuntu上工作。我在远程机器上使用gitk时遇到了同样的问题。所以我尝试后

ssh @ip and ran gitk& got the "no display name and no $DISPLAY environment variable." error

ssh @ip并运行gitk&获取“无显示名,无$ display环境变量”错误

ssh -X @ip and ran gitk& it worked! ssh -Y @ip and ran gitk& it worked!

ssh -X @ip,运行gitk&it !ssh -Y @ip,运行gitkit !

Thanks for the solution. @Elliott Frisch

谢谢你的解决方案。@Elliott弗里希