网上安装VNC桌面的教程很多,但是都较为片面,有的安装完后也连不上VNC等等。终于找到一个可用的CENTOS6.7安装VNC的脚本,并且做成了一键包的形式,还是非常给力的,记录一下。

yum install nano -y; yum update -y; yum upgrade -y; yum install tigervnc-server -y; yum groupinstall "Desktop" -y; yum install firefox -y; rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm; rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux; yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl -y; echo 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf; ' >> /etc/rc.local; echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers; echo 'VNCSERVERARGS[1]="-geometry 1000x700"' >> /etc/sysconfig/vncservers; vncpasswd; chkconfig vncserver on --level 345; reboot;

注:只适用于64x版本的centos.。firefox和flash插件也一起安装了。测试版本是6.7,所有的6.x版本都应该可以用,7.0的centos改动较大,估计不行。

参考资料:http://item.congci.com/item/debian-ubuntu-centos-yijian-anzhuang-vnc-yuanchengzhuomian