x0vncserver Fatal server error: no screens found

本文解决使用SSH连接后,在尝试使用x0vncserver进行远程X窗口服务时,遇到无法打开指定显示的问题。通过设置DISPLAY环境变量指向目标服务器:0.0,成功启动x0vncserver服务。

I make a connection through SSH and  then I type:

# x0vncserver --PasswordFile=/home/hello/.vnc/passwd

x0vncserver: unable to open display ""

~ImageCleanup called


the reason is :

       x0vncserver is an X-Windows CLIENT program. Where is the X-Windows SERVER on which the display you want to poll is presented? Presumably defined by the DISPLAY environment variable. What output do you get from the ssh shell level if you enter
#$ echo $DISPLAY [return]

I suspect it will be empty, so your X client (x0vncserver) won't know what to try to connect to. [Which is what it is telling you - unable to open display "" ]

Either make the ssh connection set up a tunnel for the X-windows stuff [you'll need a manual for your ssh client to do that], or set the DISPLAY variable to point to the server. (Only you know where it is, but the command will be something like
$ export DISPLAY=":0.0")

or run x0vncserver -h to see if there is a command line option to set the display as you start the program.
I typed echo $DISPLAY on the main-console(or on your linux host ) and it echos :0.0
so i set DISPLAY environment 

export DISPLAY=":0.0"

then i retype the command 

# x0vncserver --PasswordFile=/home/xiaoyang/.vnc/passwd


Tue Sep 4 13:33:29 2012

 main:        XTest extension present - version 2.2

 main:        Listening on port 5900


SO, It's OK !! 

About x0vncserver see http://blog.youkuaiyun.com/gpstrive/article/details/24905023 

-- Logs begin at Sat 2025-03-29 12:42:44 CST, end at Mon 2025-06-23 16:18:57 CST. -- 6月 23 16:18:55 0001.novalocal vncserver[2445025]: (EE) 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Fatal server error: 6月 23 16:18:55 0001.novalocal vncserver[2445025]: (EE) Failed to activate virtual core keyboard: 2(EE) 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Xvnc TigerVNC 1.10.0 - built Jun 24 2020 09:07:09 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst) 6月 23 16:18:55 0001.novalocal vncserver[2445025]: See https://www.tigervnc.org for information on TigerVNC. 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Underlying X server release 12006000, The X.Org Foundation 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Mon Jun 23 16:18:52 2025 6月 23 16:18:55 0001.novalocal vncserver[2445025]: vncext: VNC extension running! 6月 23 16:18:55 0001.novalocal vncserver[2445025]: vncext: Listening for VNC connections on all interface(s), port 5901 6月 23 16:18:55 0001.novalocal vncserver[2445025]: vncext: created VNC server for screen 0 6月 23 16:18:55 0001.novalocal vncserver[2445025]: sh: /usr/bin/xkbcomp: 没有那个文件或目录 6月 23 16:18:55 0001.novalocal vncserver[2445025]: XKB: Failed to compile keymap 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config. 6月 23 16:18:55 0001.novalocal vncserver[2445025]: (EE) 6月 23 16:18:55 0001.novalocal vncserver[2445025]: Fatal server error: 6月 23 16:18:55 0001.novalocal vncserver[2445025]: (EE) Failed to activate virtual core keyboard: 2(EE) 6月 23 16:18:55 0001.novalocal systemd[1]: vncserver@:1.service: Control process exited, code=exited, status=255/EXCEPTION 6月 23 16:18:55 0001.novalocal systemd[1]: vncserver@:1.service: Failed with result 'exit-code'. 6月 23 16:18:55 0001.novalocal systemd[1]: Failed to start Remote desktop service (VNC).
06-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值