【转】 ubuntu vnc vnc4server详解
来源:http://www.linuxdiyf.com/bbs/redirect.php?tid=76256&goto=lastpost
http://blog.163.com/beautiful_flame/blog/static/70702574200872354637942/ http://www.linuxeden.com/html/softuse/20080409/54952.html
最近一直在用putty+pagent远程登录ubuntu,用
命令行来操作和配置
Ubuntu
系统。
不过老是觉得缺少了什么,觉得图形界面也不错,特别是 安装了ubuntu-joES以后,想法更是强烈。 以前的时候,可以在putty+xming来 运行图形界面的 程序,但是 字体比较小。 看了一下,可以用VNC来远程操纵ubuntu界面。 我试用了两种VNC 服务器 软件:vnc4server和vncserver,客户端使用ultravnc,当然也可以使用tightvnc等其他的VNC客户端 软件。 VNC4Server篇 服务器: vnc4server- 免费软件,可以从源里面找到。 sudo apt-get install vnc4server 客户端: UltraVNC for Windows 也是一个免费软件。UltraVNC包含Server和Client,不过我只安装了Client. 特别值得一提的是,这个软件的插件里面有一个DSMplugin,可以实现加密传输,非常的好。 UltraVNC 下载: http://ultravnc.sourceforge.net/ DSMPlugin下载(这里用不上了): http://msrc4plugin.home.comcast.net/~msrc4plugin/index.html 配置: 1、生成一个passwd 文件 vnc4passwd 在$HOME/.vnc目录下面生成一个passwd文件。 $HOME/.vnc是一个vnc4server的关键目录。 2、开启vnc4server 输入:vnc4server 会得到:desktop的名称,这个名称在客户端连接的时候用到。如果是desktop:1,在客户端连接的时候就填写:ip:5901,依此类推,如果是Desktop 2,在客户端的时候填写:ip:5902.... 首次运行会提示生成了.vnc/xstartup文件,这个文件里面包含着登录启动X时的一下配置。 特别注意: 现在从UltraVNC登录,可能得到一个比较简单的窗口,因为VNC4Server缺省启动的WM是twm,如果希望启动gnome,需要改动.vnc/xstartup ,我的配置如下: #!/bin/sh # 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 xset root -solid grey vncconfig -iconic & xterm -geometry 1024x768+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-session & 这样登录的时候,会自动启动gnome 如果实在不是非常明白原理,或者出现问题,可以查看/usr/bin/vnc4server文件,这是一个Perl文件,你将非常明白其中的运作原理。 VNCServer篇: 如果使用vncserver,那么缺省的配置文件在$HOME/.vncrc里面,vncserver系统全局的配置文件在/etc/vnc.conf里面,从/usr/bin/vncserver(也是一个Perl文件)可以看到它的运作原理。 另外,还需要改动/etc/vnc.conf,因为vncserver默认使用的是xfree系统,需要修改一下配置文件,大体如下: $XFConfigPath = "/etc/X11/xorg.conf"; 当然在这里还可以看到其他变量,如vncStartup,如果想启动默认的X系统,可以配置如下: $vncStartup = "/etc/X11/Xsession"; 如果在$HOME/.vncrc里面进行如下配置: #配置X系统为xorg $XFconfigPath = "/etc/X11/xorg.conf"; # 启动默认Xsession $vncStartup = "/etc/X11/Xsession"; #分辨率 $geometry ="800x600"; 登录以后,会自动到默认桌面,如Gnome等,如果Ubuntu本机登录一样。 另外还看到用xinited和vncserver来实现后台服务,不过我觉得风险还是比较大,因为它缺省使用root来运行,需要谨慎。 Linux的VNC充分理由了Xorg的C/S体系,非常好用啊! |
vncserver按D键自动隐藏问题
ubuntu10.10 64bit version,使用vncserver,在windows上用vncviewer可以连接显示正常。但使用时发现按"d"键则当前console自动隐藏,再次按d则恢复原状。
分析:ubuntu有快捷键设置,其中有对D键的设置。只需改变该快捷键不使用D键即可。
解决办法:
for some weird reason, ubuntu is using the keyboard key "d" by itself as a shortcut key, so whenever you use it it just minimizes everything. to fix this, go to the top and click (system -> preferences -> keyboard shortcuts) and look for one using "d". i think it was the very bottom one. just click the shortcut and use backspace to clear the shortcuts' function.