vnc安装

vnc是一款远程图形桌面连接工具,在机房的味道真不好受,除了安装操作系统没办法,安装完操作系统就赶紧跑出来吧。

vnc安装:

1.确认VNC是否安装

[root@rac1 Server]# rpm -q vnc-server
vnc-server-4.1.2-14.el5_6.6

2.启动VNC服务

使用vncserver命令启动VNC服务,命令格式为“vncserver :桌面号”,其中“桌面号”用“数字”的方式表示,每个用户连个需要占用1个桌面
启动编号为1的桌面示例如下:

[root@rac1 Server]# vncserver :1

You will require a password to access your desktops.

Password:
Verify:

New 'rac1:1 (root)' desktop is rac1:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/rac1:1.log

3.VNC服务使用的端口号与桌面号的关系

VNC服务使用的端口号与桌面号相关,VNC使用TCP端口从5900开始,对应关系如下
桌面号为“1”  ---- 端口号为5901
桌面号为“2”  ---- 端口号为5902
桌面号为“3”  ---- 端口号为5903

4.测试VNC服务

启动VNC Viewer软件

Server输入“144.194.192.183:1” 缺发现只有一个Shell

5.配置VNC图形桌面环境为KDE或GNOME桌面环境

[root@rac1 .vnc]# vi 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
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session  &
~
~
~
~
~
~
~
~
~
~
~
"xstartup" 12L, 345C written
重新启动即可
[root@rac1 .vnc]# vncserver -kill :1
Killing Xvnc process ID 13571
[root@rac1 .vnc]# vncserver :1

New 'rac1:1 (root)' desktop is rac1:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/rac1:1.log
 
原文地址:https://www.cnblogs.com/huanhuanang/p/4161048.html