Amazon EC2 Ubuntu服务器-opencv :: imshow()导致“:无法连接到X服务器本地主机:10.0&"; [英] Amazon EC2 Ubuntu server - opencv::imshow() causes ": cannot connect to X server localhost:10.0"
问题描述
因此,我试图在运行Ubuntu Server 14.04 LTS的Amazon EC2实例上运行代码.
So I am trying to run my code on an Amazon EC2 instance running Ubuntu Server 14.04 LTS.
我意识到调用imshow()时,我的代码因以下错误而中断:
I realized that my code is breaking with the following error when imshow() is called:
: cannot connect to X server localhost:10.0
我是通过腻子进行连接的,并且选择了启用X11转发".
I an connecting through putty and I have selected "Enable X11 Forwarding".
我可以删除所有imshow调用,但实际上我需要使用它们.通过Putty连接到EC2实例时,是否可以启用此功能?
I can remove all imshow calls but I actually need to use them. Is there a way to enable this functionality while connecting to the EC2 instance through Putty ?
推荐答案
您还需要在台式机上(运行腻子的地方)运行X Windows服务器.有几种可用的设置,取决于您选择的设置.如果您想要一个非常简单的解决方案,请使用 MobaXterm ,它是ssh客户端和X11服务器的组合.有商业版和免费家庭版(有一些限制).
You also need to be running an X windows server on your desktop (where you're running putty). There are several available, and setup depends on which you choose. If you want a very easy solution, there's MobaXterm, which is an ssh client and X11 server combined. There's a commercial version and a free home edition (with some limitations).
这篇关于Amazon EC2 Ubuntu服务器-opencv :: imshow()导致“:无法连接到X服务器本地主机:10.0&";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!