redhat默认是安装vnc的
1.创建用户vnc连接密码,使用vnc的用户下面输入
vncserver
提示创建密码
2.编辑用户家目录下配置文件如下:
vim .vnc/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" &
#twm &
gnome-session &
3.编辑配置文件
vim /etc/sysconfig/vncserversVNCSERVERS="3:root 4:test"
[VNCSERVERARGS2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERARGS[3]="-geometry 1920x1080 -depth 16"
4.重启
service vncserver restart