文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Fedora 12中配置安装VNC Server软件

Fedora 12中配置安装VNC Server软件

时间:2010-10-11  来源:mydear

本文详细介绍了如何在Fedora 12中配置VNC Server,包括配置自动启动以及启动参数。

安装VNC Server软件

Linux上面的VNC Server软件有很多,因为本人喜欢Tiger VNC的客户端,所以这里也采用Tiger VNC Server。运行如下命令进行安装sudo yum install tigervnc-server

配置VNC Server

假定我们的目标是以用户user1来启动VNC Server,显示端口是1(也就是5901),分辨率1152x864

配置用户user1的VNC密码和参数

以用户user1登录,运行vncpasswd 即可设置密码然后,编辑/home/user1/.vnc/xstartup(如果不存在的话,可以手动创建一个,并给予可执行权限),内容如下:

  1. view plaincopy to clipboardprint?
  2. #!/bin/sh
  3. vncconfig -iconic &
  4. unset SESSION_MANAGER
  5. unset DBUS_SESSION_BUS_ADDRESS
  6. OS=`uname -s`
  7. if [ $OS = 'Linux' ]; then
  8. case "$WINDOWMANAGER" in
  9. *gnome*)
  10. if [ -e /etc/SuSE-release ]; then
  11. PATH=$PATH:/opt/gnome/bin
  12. export PATH
  13. fi ;;
  14. esac
  15. fi
  16. if [ -x /etc/X11/xinit/xinitrc ]; then
  17. exec /etc/X11/xinit/xinitrc
  18. fi
  19. if [ -f /etc/X11/xinit/xinitrc ]; then
  20. exec sh /etc/X11/xinit/xinitrc
  21. fi
  22. [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
  23. xsetroot -solid grey
  24. xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
  25. #twm &
  26. #!/bin/sh
  27. vncconfig -iconic &
  28. unset SESSION_MANAGER
  29. unset DBUS_SESSION_BUS_ADDRESS
  30. OS=`uname -s`
  31. if [ $OS = 'Linux' ]; then
  32. case "$WINDOWMANAGER" in
  33. *gnome*)
  34. if [ -e /etc/SuSE-release ]; then
  35. PATH=$PATH:/opt/gnome/bin
  36. export PATH
  37. fi ;;
  38. esac
  39. fi
  40. if [ -x /etc/X11/xinit/xinitrc ]; then
  41. exec /etc/X11/xinit/xinitrc
  42. fi
  43. if [ -f /etc/X11/xinit/xinitrc ]; then
  44. exec sh /etc/X11/xinit/xinitrc
  45. fi
  46. [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
  47. xsetroot -solid grey
  48. xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
  49. #twm &

配置防火墙以及SELinux

运行system-config-firewall启动防火墙配置界面,在Other Ports里面添加端口5901,协议选择tcp.如果启用了SELinux的话,需要运行sudo chcon -t unconfined_exec_t /usr/bin/vncserver 改变vncserver的Security Context,否则在使用VCN连接的时候会碰到很多问题,比如点击桌面的图标没有反应,程序不能被启动等等。

配置VNC Server自动启动

编辑/etc/sysconfig/vncservers,内容如下:
view plaincopy to clipboardprint?
VNCSERVERS="1:user1"
VNCSERVERARGS[1]="-geometry 1152x864"
VNCSERVERS="1:user1"
VNCSERVERARGS[1]="-geometry 1152x864"
然后运行sudo chkconfig --level 345 vncserver on ,让VNC Server随系统自动启动最后,运行sudo /etc/init.d/vncserver start 来启动VNC Server

测试连接

使用VNC客户端连接<fedora12_ip>:1 ,使用上面设置的密码。Linux上可以使用TigerVNC的客户端;Windows上推荐使用UltraVNC (http://www.uvnc.com/ )


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载