zoukankan      html  css  js  c++  java
  • vncviewer: unable to open display " " 终极解决方法

    问题:最近学习kvm的时候,使用vncviewer连接虚拟机总是显示:vncviewer: unable to open display "",看了N多文章,浪费了N多时间,今天终于解决了。

    解决方法:

    1、首先保证你的主机可以工作在图形模式,如果有人和我一样,安装的是minimal版本,则需要安装图形软件。

      yum groupinstall "X Window System"

      yum groupinstall "Desktop" -y 

    2、将模式切换到图形模式

      init 5或修改/etc/inittab,将默认级别修改为5,并重启主机。

    3、编辑sshd的配置文件,将下面几项参数开启并设置正确,不然会提示Error: Can't open display: 

      X11Forwarding yes
      X11DisplayOffset 10
      X11UseLocalhost yes

    4、X11 forwarding依赖“xorg-x11-xauth”软件包,所以必须先安装“xorg-x11-xauth”软件包,同时安装x11字体。

      yum install xorg-x11-xauth xorg-x11-fonts-*

    5、开启SecureCRT的X11 Forwarding功能,全局选项——默认会话——Port Forwarding——Remote/X11——X11 forwarding启用设置后保存配置重启SecureCRT。

    6、安装X Server 软件Xming软件,如果不安装会提示如下错误。Using X11 forwarding requires that you have an X11 server running on your computer.

      下载网址:https://sourceforge.net/projects/xming/

     7、如果还是不行,可以使用printenv命令看看是否生生$DISPLAY变量,如果没有生成,手动导入变量。

      ~]# export DISPLAY=:0.0

    PS,如果按照上述方法仍不行的,请留言!

    参考文章:https://cloud.tencent.com/developer/news/384649

  • 相关阅读:
    四校联考【20171001】
    C语言基础知识
    页表和TLB
    python
    Cache组织方式
    On the Spectre and Meltdown Processor Security Vulnerabilities
    latex-组织文本
    深入理解计算机系统
    深入理解计算机系统-计算机系统漫游
    逻辑地址到物理地址的转换
  • 原文地址:https://www.cnblogs.com/sq5288/p/11727661.html
Copyright © 2011-2022 走看看