Linux下配置VNC server 显示图形化桌面
本文连接: http://blog.itpub.net/29475508/viewspace-1671101/
[root@bigdatalite ~]# cd /root/.vnc/
[root@bigdatalite .vnc]# ls
bigdatalite:2.log bigdatalite:2.pid localhost:1.log passwd xstartup
[root@bigdatalite .vnc]# ls -l
total 20
-rw-r--r-- 1 root root 1189 May 25 11:49 bigdatalite:2.log
-rw-r--r-- 1 root root 6 May 25 11:47 bigdatalite:2.pid
-rw-r--r-- 1 root root 663 Jun 12 2013 localhost:1.log
-rw------- 1 root root 8 May 25 11:47 passwd
-rwxr-xr-x 1 root root 334 May 25 11:47 xstartup
备份原始文件
[root@bigdatalite .vnc]# cp -p xstartup xstartup.bak
编辑文件,最后一行改为gnome-session &
[root@bigdatalite .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" &
#twm &
gnome-session &
杀死掉之前的vnc进程
[root@bigdatalite .vnc]# vncserver -kill :1
Can't find file /root/.vnc/bigdatalite:1.pid
You'll have to kill the Xvnc process manually
[root@bigdatalite .vnc]# vncserver -kill :2
Killing Xvnc process ID 13462
[root@bigdatalite .vnc]# vncserver -kill :3
Killing Xvnc process ID 13797
重启vnc服务
[root@bigdatalite .vnc]# vncserver
New 'bigdatalite:2 (root)' desktop is bigdatalite:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bigdatalite:2.log
[root@bigdatalite .vnc]#
客户端使用vncviewer进行登录
登录后是图形化操作界面
吕星昊
2015.5.25
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29475508/viewspace-1671101/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29475508/viewspace-1671101/