Can't connect to X11 window server using 'localhost:0' as the value of the DISPL

问题描述:

      使用xshell在ubuntu上面运行./jmeter, 报错Can't connect to X11 window server using 'localhost:0' as the value of the DISPLAY variable.

 


解决方案:export DISPLAY=IP:0.0或者export DISPLAY=localhost:0.0

 

注意:最好重新打开一个xshell窗口
 

问题补充:

      还有一种情况有些童鞋是在vagrant下面直接调用OK,但是使用su 在root用户下面调用还是报上面的错误的话,如果上述步骤操作之后还是无效的话,这时候请退出,然后使用su - root 登录,执行的话不要使用su登录哦!两者差别还是挺大的哦!

 

补充知识点:

      除了上述的su - root 之外还可以直接使用ssh root@IP进入,如果使用ssh进入不了的话,那么需要在做如下修改步骤:

 

      step1:进入/etc/ssh目录下

             root@ubuntu-14:~# cd /etc/ssh/

      step2:修改sshd_config文件

             root@ubuntu-14:/etc/ssh# vi sshd_config 

      把下面2行修改:

             PermitRootLogin without-password  ------->> PermitRootLogin yes

             #PasswordAuthentication yes          ------->> PasswordAuthentication yes   

       step3:重启ssh

             root@ubuntu-14:/etc/ssh# service ssh restart

修改成功之后就可以使用ssh root@IP了.

 

      说的有点多,希望能帮助到有需要的童鞋!

 

 

 

猜你喜欢

转载自20120923lina.iteye.com/blog/2213962