1 SUSE11 VNC服务配置
SUSE安装时已经默认安装了vncserver
首先要启用SUSE远程控制,打开YaST,网络服务,远程管理(remote administration),选择“允许远程管理”,在下面的选项进行防火墙设置,选择“打开防火墙端口”,点击完成。 如果没有关闭防火墙的话,也可以通过增加端口的方式: 编辑防火墙增加5901端口 vi /etc/sysconfig/SuSEfirewall2
我这里22是SSH,1521是Oracle的,5901是VNC
输入 /sbin/rcSuSEfirewall2 restart 重启防火墙
一、启动vnc服务
#vncserver start
You will require a password to access your desktops.
Password:<输入远程桌面密码> Verify: <确认远程桌面密码>
Would you like to enter a view-only password(y/n)?n TightVNC Server version 1.3.9
Usage: vncserver [
-name
-geometry
See vncserver and Xvnc manual pages for more information. 启动后将在/root下生成.vnc的目录。
二、启动一个远程桌面
linux-qanf:~ # cd /root/.vnc linux-qanf:~/.vnc # vncserver :1
A VNC server is already running as :1 --上面是表明已经有一个服务在运行了 --下面是没有实例在运行
linux-qanf:~/.vnc # vncserver :2
New 'X' desktop is linux-qanf:2
Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/linux-qanf:2.log
4表示桌面好,VNC服务使用的端口号与桌面好相关,VNC使用TCP从5900开始,对应关系如下:
:1对应的端口号为5901 :2对应的端口号为5902 ……
:4对应的端口号为5904
基于JAVA的VNC客户程序WEB服务TCP端口从5800开始,对应关系如下 :1对应的端口号为5801 ……
:4对应的端口号为5804 三、中断一个远程桌面
linux-qanf:~/.vnc # vncserver -kill :1
Killing Xvnc process ID 15728 四、使用远程图形界面
修改/root/.vnc/xstartup,最后一行增加(GNOME、KDE选择一种) 把twm&注释改为#twm& 然后再最下面增加2行 startgnome&
DISPLAY=:1 gnome-session &
#启动gnome图形界面窗口,重要:如果不注释twm&的话,会显示效果不好。
startkde& #使用KDE界面 然后重新启动桌面 #vncserver–kill :4 #vncserver :4 问题:
zygx-web:~/.vnc # vncserver
Warning: zygx-web:1 is taken because of /tmp/.X11-unix/X1 Remove this file if there is no X server zygx-web:1 解决办法:进入该目录,把该文件删除即可。 zygx-web:/tmp/.X11-unix # rm -f X1
使用vi编辑器编辑长文件时,常常是头昏眼花,也找不到需要更改的内容。 这时,使用查找功能尤为重要。 方法如下:
1、命令模式下输入“/字符串”,例如“/Section 3”。 2、如果查找下一个,按“n”即可。