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

一.windows 远程软件VNCViewer
这个不多说: 下载地址:
二.安装 vnc-server
apt-get install vnc-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package vnc-server is a virtual package provided by:
vnc4server 4.1.1+xorg4.3.0-37ubuntu4
tightvncserver 1.3.9-6.2ubuntu2
You should explicitly select one to install.
然后我们选择任意一个安装
apt-get install vnc4server
再次安装失败, 提示:
Not Found [IP: 112.124.140.210 80]
Failed to fetch http://cn./ubuntu/pool/main/libx/libx11/libx11-xcb1_1.4.99.1-0ubuntu2.2_amd64.deb
Not Found [IP: 112.124.140.210 80]
Failed to fetch http://cn./ubuntu/pool/main/libx/libxfixes/libxfixes3_5.0-4ubuntu4.2_amd64.deb
Not Found [IP: 112.124.140.210 80]
Failed to fetch http://cn./ubuntu/pool/main/libx/libxi/libxi6_1.7.1.901-1ubuntu1~precise1_amd64.deb
Not Found [IP: 112.124.140.210 80]
Failed to fetch http://cn./ubuntu/pool/main/libx/libxv/libxv1_1.0.6-2ubuntu0.1_amd64.deb
Not Found [IP: 112.124.140.210 80]
Failed to fetch http://cn./ubuntu/pool/main/x/x11-utils/x11-utils_7.6+4ubuntu0.1_amd64.deb
Not Found [IP: 112.124.140.210 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
提示让apt-get update , update后
apt-get install vnc4server
三.&修改VNC Password
Password: ******Verify:*****
四.启动VNC server
file /root/.Xauthority does not exist
New 'AYbZ:1 (root)' desktop is AYbZ:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/AYbZ:1.log
五.连接vnc
客户端连接vnc 使用端口为:1 每启动一次vncserver 相应的:端口就会变化一次
在这里,我们看到的是一个Linux命令行窗口
六.修改显示界面
我们打开/root/.vnc/xstartup
vim /root/.vnc/xstartup
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
我们需要将最后一行&x-window-manager &&改为我们自己的Ubuntu图形界面服务, Ubuntu有gnome、KDE、Unity等桌面环境。如果是gnome桌面,改成gnome-session &;如果是KDE桌面,改成startkde &;如果是Unity桌面,首先去 /usr/share/gnome-session/sessions/下看桌面session的名称,如果是ubuntu-2d,则将最后一行改为:export STARTUP="/usr/bin/gnome-session --session=ubuntu-2d"$STARTUP
------------------------
在这里,一大波问题来袭
修改最后一行为:gnome-session &&
vncserver -kill :1
vnc还显示命令行窗口
好,我们知道,有可能是没有安装桌面环境。方法安装:
第一步:安装x-windows的基础
apt-get install x-window-system-core
第二步:安装登录管理器
apt-get install gdm
第三步:安装桌面
apt-get install ubuntu-desktop
vncserver -kill :1
依旧显示命令行窗口
这次已经gnome桌面环境,依旧这样是为什么呢?记得在启动vncservier时生成个日志.log文件。
查看日志文件
cat root/.vnc/AYbZ\:1.log
显示如下错误:
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!
我们安装字体便是
install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
安装完成时候,重启vncserver,再次查看log日志文件
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!
在/usr/share/fonts/X11目录下有字体文件了,但/usr/X11R6/lib&目录还是不存在字体
我们可以让X11R6里面软链接到share/fonts字体目录中
/usr/X11R6/lib
# 没有X11R6/lib 目录
cd /usr/X11R6/lib/
ln -s /usr/share/fonts/X11 X11
再次重启vncserver
阅读(...) 评论()ubuntu安装vnc,远程链接时出现灰屏,配置文档不对吗? - 知乎6被浏览949分享邀请回答0添加评论分享收藏感谢收起0添加评论分享收藏感谢收起查看更多回答ubuntu安装vnc,远程链接时出现灰屏,配置文档不对吗
时间: 09:57:29
&&&& 阅读:35
&&&& 评论:
&&&& 收藏:0
标签:&&&&&&&&&&&&&&&&&&&&&&&&&&&摘自:/question/6473348.html&1.在Ubuntu上首先需要安装vnc4server# apt-get install vnc4server2.第一次执行vncserver的时候需要为客户端连接设置8位的密码3.打开服务后,根据客户端号连接。也可以指定客户端号$vncserver -geometry
// 其中-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_ADDRESSgnome-panel & gnmoe-settings-daemon & metacity & nautilus & gnome-terminal &重启VNCserver就ok了。令注: vncserver :1 开启服务 vncserver -kill :1 关闭这个连接号pasting&标签:&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&国之画&&&& &&&&chrome插件&&
版权所有 京ICP备号-2
迷上了代码!

我要回帖

更多关于 vncserver 灰屏 的文章

 

随机推荐