新手教程,VPS中安装轻量级桌面Fluxbox和VNC

作者:CQman 发布时间:November 17, 2010浏览:4678 分类:主机域名

买了个buyvm.net的VPS,一直没怎么用,最近要下载东西速度很慢,所以想到是不是应该利用起这个VPS了,毕竟VPS的网速比我这2M的ADSL要快的多啊。

第一步:重转系统,我选用的是CentOS 5(已装此系统可跳过此步)
第二步:yum install yum-priorities     #安装yum-priorities

第三步:vi /etc/yum.repos.d/CentOS-Base.repo  #把红色部分加到每个段落的最后


[base]

name=CentOS-$releasever - Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

priority=1


#released updates

[updates]

name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

priority=1


#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever - Addons

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons

#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

priority=1



#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

priority=1


#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

priority=2


#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

priority=2



第四步:wget http://packages.sw.be/rpmforge-r ... 1-1.el5.rf.i386.rpm    #下载RpmForge,32位系统选这个



wget http://packages.sw.be/rpmforge-r ... 1.el5.rf.x86_64.rpm  #64位系统选这个



第五步:rpm  -import http://apt.sw.be/RPM-GPG-KEY.dag.txt    #导入Key

第六步:rpm -K rpmforge-release-0.5.1-1.el5.rf.i386.rpm #验证包的有效性,32位系统选这个



rpm -K rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm #64位系统选这个



第七步:rpm -i rpmforge-release-0.5.1-1.el5.rf.i386.rpm #安装RpmForge,32位系统选这个



rpm -i rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm #64位系统选这个



第八步:vi /etc/yum.repos.d/rpmforge.repo  #最后面加上 priority=11(红色部分)



### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=11



第九步:yum -y install vnc vnc-server firefox x11-xorg  #安装VNC

第十步:vncserver   #首次欲行VNC,设置下密码

第十一步:pkill -9 vnc   #终止VNC进程



rm -rf /tmp/.X1*   #清除下临时文件

vi /root/.vnc/xstartup  #把最后的那行 “twm &”修改成 “exec /usr/bin/fluxbox”,保存退出



第十二步:vncserver   #启动VNC服务


最后就是如何登陆远程桌面了,要用到RealVNC viewer这个软件,安装后启动程序  

服务器地址那填写:你的主机名:1,然后确定,输入安装VNC时设置的密码,就能看到桌面了。

 

注意:当试图在其他PC机器上用VNC客户端来连接Linux系统的VNC Server时可能会出现以下信息:unable to connect to host: Connection refused(10061) 中文为:无法连接到主机,连接被拒绝(10061)

如果你的VNC配置没有问题并且通过service vncserver status查看确定已经启动的话,那原因就是你没有在VNC客户端输入IP地址的时候没有加上桌面号。没加的话就会出现上面的错误。正确的写法为
IP:1
这样就会连接上并让你输入密码了!从此就可以开始VNC之旅了。

赞助商链接

标签: vps, linux, 桌面, vnc

分享家:Addthis中文版 分享家:Addfeed

您可能会感兴趣的文章:

添加新评论 »