1:安装tigervnc-server 服务
yum install tigervnc-server
2:编辑/etc/sysconfig/vncservers
VNCSERVERS="1:Hvnc" (表示第一个VNC服务,用户是Hvnc)
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
3:创建一个Hvnc 用户
useradd Hvnc
4: 进入Hvnc 用户,初始化vnc密码和服务
su - Hvnc
[Hvnc@oradb1 ~]$ vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: (stdin):1: bad display name "oradb1:1" in "add" command
这个时候可能会报错如下:
[dix] Could not init font path element /usr/share/X11/fonts/misc, removing from list!
[dix] Could not init font path element /usr/share/X11/fonts/100dpi, removing from list!
[dix] Could not init font path element /usr/share/X11/fonts/Type1, removing from list!
[dix] Could not init font path element /usr/share/fonts/default/Type1, removing from list!
[dix] Could not init font path element built-ins, removing from list!
(EE)
Fatal server error:
(EE) could not open default font 'fixed'(EE)
但是仍然可以看到vnc服务已经启动了一个:
[Hvnc@oradb1 ~]$ vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 50440
[Hvnc@oradb1 ~]$
需要先关闭vnc服务
vncserver -kill :1
然后安装一个包:
yum install libXfont
安装完成后再启动vnc,成功的启动过程如下:
[Hvnc@oradb1 ~]$ vncserver
xauth: (stdin):1: bad display name "oradb1:1" in "add" command
New 'oradb1:1 (Hvnc)' desktop is oradb1:1
Creating default startup script /home/Hvnc/.vnc/xstartup
Starting applications specified in /home/Hvnc/.vnc/xstartup
Log file is /home/Hvnc/.vnc/oradb1:1.log
查看端口启动情况,5901 端口已经启动完成。
[Hvnc@oradb1 ~]$ netstat -na|grep 5901
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
[Hvnc@oradb1 ~]$
5:客户端VNC 登陆,IP地址带上端口号即可。
密码需要上面第4步初始化设置的密码。
6:进入操作系统远程桌面