linux 下 vncserver 配置
(1)启动 VNC 服务.通过 puTTY 以 SSH 方式登录服务器,假设用户名为 yangj
telnet linux16
Trying 192.168.0.36...
Connected to linux16 (192.168.0.36).
Escape character is '^]'.
Red Hat Enterprise Linux AS release 3 (Taroon Update 8)
Kernel 2.4.21-47.ELsmp on an i686
login: yangj
Password:
Last login: Sun May 30 17:48:13 from linux16
[yangj@linux16 yangj]$ su
[yangj@linux16 .root]# service vncserver start
Starting VNC server: no displays configured [ OK ]
(2)运行 vncserver 命令,如果第一次配置 VNC Server,会要求提供登录 VNC 使用的密码.以后
也可以使用 vncpasswd 来修改密码.
[yangj@linux16 .vnc]$ vncserver
You will require a password to access your desktops.
Password:q1w2e3
Verify:q1w2e3
xauth: creating new authority file /root/.vnc/.Xauthority
New 'xok.la.localdomain:1 (yangj)' desktop is xok.la.localdomain:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/xok.la.localdomain:1.log
(3)此时就可以在 Windows 使用 VNC viewer 登录了
输入服务器地址:192.168.0.36:1
然后提示输入密码,输入你刚才设定的密码就好了,如 q1w2e3
注意:IP 地址后面的:1 的意思是 linux 上面 VNC 设定的 Display No.每运行一个 vncserver 就
会多创建一个 Display,Display No 也就会加一.
虽然此时可以登录,但是登录后看到的界面是 X term 的界面,还不是正常的 X Window 界面,
我们要修改配置,使之使用 X Window
(4)修改配置文件/root/.vnc/xstartup,将 twm &改为:
gnome-session & #以 GNOME 作为 VNC 的窗口管理器
或
startkde & #kde desktop
注释掉
#twm & #注掉系统默认的窗口管理器
[yangj@linux16 .vnc]$ cat xstartup
评论1