ubuntu安装vnc,远程链接时出现灰屏,配置文档不对吗

如题所述

1.在Ubuntu上首先需要安装vnc4server

# apt-get install vnc4server

2.第一次执行vncserver的时候需要为客户端连接设置8位的密码

3.打开服务后,根据客户端号连接。也可以指定客户端号

$vncserver -geometry 1366x768 :1

// 其中-geometry 指定客户端窗口的大小,:1 指的是客户端连接号

// 客户端在vnc viewer中输入 192.168.0.253:1 来连接服务器

4.出现灰色屏幕和×型鼠标是因为vncserver找不到指定的图形化软件

在该网站处,其中有位网友指出:

There are a number of things which can cause the grey screen problem.
Your best bet is to look at the log file in .vnc to see what the error
is. The log file name is hostName:display#.log, for example, on my
machine, whose name is “golden”, it was golden:1.log.

In my case the ./vnc/xstartup file did not have the right permissions,
so chmod +x ./vnc/xstartup fixed the problem. I could have fiddled with
the contents of xstartup until the cows came home and it wouldn’t have
helped.

我们通过查看~/.vnc/xxx:1.log可以查看出现问题的原因。

说明一下,此处的日志1.log表示客户端号为1的连接日志。

error opening security policy file /etc/X11/xserver/SecurityPolicy

Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!

Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!

Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!

Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!

Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!

Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!

Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!

在Ubuntu15.10 下没有看到相关的文件夹,可能是版本路径的改变问题,我们通过find指令找到fonts其实是在/usr/share/fonts/下。

此处需我们创建指定目录,然后用ln 软连接将后者的路径指过来,拼接成日志中的路径名。

配置完成后还会出现下面的几个错误,但是并不会报错了。

error opening security policy file /etc/X11/xserver/SecurityPolicy

Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!

Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!

Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!

5.需要更改~/.vnc/xstartup文件

在安装之前,我们先安装如下软件:

$sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

然后修改xstartup文件

#!/bin/sh

# Uncomment the following two lines for normal desktop:

export XKL_XMODMAP_DISABLE=1

unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

unset DBUS_SESSION_BUS_ADDRESS

gnome-panel &

gnmoe-settings-daemon &

metacity &

nautilus &

gnome-terminal &

重启VNCserver就ok了。

令注:

vncserver :1 开启服务

vncserver -kill :1 关闭这个连接号
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-04-12

1.在Ubuntu上首先需要安装vnc4server

# apt-get install vnc4server

2.第一次执行vncserver的时候需要为客户端连接设置8位的密码

3.打开服务后,根据客户端号连接。也可以指定客户端号

$vncserver -geometry 1366x768 :1

// 其中-geometry 指定客户端窗口的大小,:1 指的是客户端

// 客户端在vnc viewer中输入 192.168.0.253:1 来连接服务器

4.出现灰色屏幕和×型鼠标是因为vncserver找不到指定的图形化软件

具体如下:

1、简介

是基于发展而来的一种克隆系统,它诞生于1991 年的 [Linux桌面] 10 月5 日(这是第一次正式向外公布的时间)。以后借助于Internet网络,并通过全世界各地计算机爱好者的共同努力,已成为今天世界上使用最多的一种UNIX 类操作系统,并且使用人数还在迅猛增长。

2、基本信息

Linux[2]操作系统是UNIX操作系统的一种克隆系统,它诞生于1991 年的10 月5 日(这是第一次正式向外公布的时间)。以后借助于Internet网络,并通过全世界各地计算机爱好者的共同努力,已成为今天世界上使用最多的一种UNIX 类操作系统,并且使用人数还在迅猛增长。

3、分区规定

在 Linux 中,每一个硬件设备都映射到一个系统的文件,对于硬盘、光驱等,IDE 或 SCSI 设备也不例外。Linux 把各种 IDE 设备分配了一个由 hd 前缀组成的文件;而对于各种 SCSI 设备,则分配了一个由 sd 前缀组成的文件。

本回答被网友采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网