VNC配置手记
其实配置VNC很简单。只要运行vncserver就好了.运行完毕后,它会在home目录生成.vnc目录。
vncpasswd 修改连接密码。
不过VNC默认启动的X-windows是twm,看上去有点丑,那么你可以把~/.vncr/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 |
Vnc默认是用twm做window,这个功能太差劲了,注释掉,加了一行:"gnome-session &",我是用gnome的;用KDE "startkde &"。
export LANG=zh_CN.GB18030这一行在每次会话的时候把语言改成中文,我的系统默认是en_US.UTF-8,进入Xwindow时就不会有语言上的问题了。
然后重新启动vncserver
#vncserver -kill:1
#vncserver
再使用vncviewer yourremotehost:id 看到熟悉的登陆界面了。
vi /etc/sysconfig/vncservers
| # The VNCSERVERS variable is a list of display:user pairs. # # Uncomment the line below to start a VNC server on display :1 # as my 'myusername' (adjust this to your own). You will also # need to set a VNC password; run 'man vncpasswd' to see how # to do that. # # DO NOT RUN THIS SERVICE if your local area network is # untrusted! For a secure way of using VNC, see # URL:http://www.uk.research.att.com/vnc/sshvnc.html. VNCSERVERS="1:root" |
VNCSERVERS="1:root"表示第一个vnc配置是以root身份运行的。
VNCSERVERARGS[1]="-geometry 1024x768"注意这里的[1]对应上面的1:root,设置分辨率。
如有多个vnc配置可以这样。
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERS="2:user"
VNCSERVERARGS[2]="-geometry 800x600"
| -欢迎为本文评级 |
相关日志 |
本文读者也关心以下内容:
|















































Leave a reply