Chinaunix首页 | 论坛 | 博客
  • 博客访问: 244029
  • 博文数量: 8
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 240
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-13 08:39
个人简介

笨鸟要先飞

文章分类

全部博文(8)

文章存档

2015年(5)

2014年(3)

我的朋友

分类: LINUX

2014-12-12 17:30:45

1.安装并启动tigervnc-server
# rpm -ivh tigervnc-1.1.0-16.el6.x86_64.rpm
warning: tigervnc-1.1.0-16.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]
   1:tigervnc               ########################################### [100%]

# rpm -ivh tigervnc-server-1.1.0-5.el6.x86_64.rpm
warning: tigervnc-server-1.1.0-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        xorg-x11-fonts-misc is needed by tigervnc-server-1.1.0-5.el6.x86_64

# rpm -ivh tigervnc-server-1.1.0-5.el6.x86_64.rpm
warning: tigervnc-server-1.1.0-5.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:tigervnc-server        ########################################### [100%]

# vncserver

You will require a password to access your desktops.

Password:
Verify:

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

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

2.修改配置文件
# vim /root/.vnc/xstartup

点击(此处)折叠或打开

  1. #!/bin/sh

  2. [ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
  3. export LANG
  4. export SYSFONT
  5. vncconfig -iconic &
  6. unset SESSION_MANAGER
  7. unset DBUS_SESSION_BUS_ADDRESS
  8. OS=`uname -s`
  9. if [ $OS = 'Linux' ]; then
  10. case "$WINDOWMANAGER" in
  11. *gnome*)
  12. if [ -e /etc/SuSE-release ]; then
  13. PATH=$PATH:/opt/gnome/bin
  14. export PATH
  15. fi
  16. ;;
  17. esac
  18. fi
  19. if [ -x /etc/X11/xinit/xinitrc ]; then
  20. exec /etc/X11/xinit/xinitrc
  21. fi
  22. if [ -f /etc/X11/xinit/xinitrc ]; then
  23. exec sh /etc/X11/xinit/xinitrc
  24. fi
  25. [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
  26. xsetroot -solid grey
  27. xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
  28. #twm &
  29. gnome-session &

# vim /etc/sysconfig/vncservers

点击(此处)折叠或打开

  1. # The VNCSERVERS variable is a list of display:user pairs.
  2. #
  3. # Uncomment the lines below to start a VNC server on display :2
  4. # as my 'myusername' (adjust this to your own). You will also
  5. # need to set a VNC password; run 'man vncpasswd' to see how
  6. # to do that.
  7. #
  8. # DO NOT RUN THIS SERVICE if your local area network is
  9. # untrusted! For a secure way of using VNC, see this URL:
  10. #

  11. # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

  12. # Use "-localhost" to prevent remote VNC clients connecting except when
  13. # doing so through a secure tunnel. See the "-via" option in the
  14. # `man vncviewer' manual page.

  15. VNCSERVERS="1:root"
  16. # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
重启vncserver服务
# service vncserver restart





阅读(4778) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~