服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

dirtysea 发表于 2010-8-25 11:02:12

GNOME图形界面+vnc+VirtualBox详细安装

<FONT size=5><FONT color=red>一:安装GNOME图形界面</FONT></FONT><BR>1、安装基本的X系统组件<BR># yum groupinstall "X Window System"<BR>2、安装桌面关系程序组,GNOME或KDE或XFCE,自选其中一个<BR># yum groupinstall "GNOME Desktop Environment"或"KDE"或"XFCE-4.4"<BR><BR>卸载GNOME桌面环境<BR>yum groupremove “GNOME Desktop Environment”<BR>卸载KDE桌面环境 yum groupremove “KDE (K Desktop Environment"<BR><BR><FONT size=5><FONT color=red>二:配置vnc</FONT></FONT><BR><BR><BR><B>1.检查VNC客户端和服务器端是否已经安装</B><BR>执行如下命令:<BR>rpm -q vnc vnc-server<BR>假如返回类似如下信息,<BR>package vnc is not installed<BR>vnc-server-4.0-8.1<BR>则说明系统已经默认安装了vnc服务器端(一般来说,CentOS系统都默认安装了vnc server)。<BR><B>2. 在CentOS系统中将用户名加入到配置文件中</B><BR>使用如下命令编辑配置文件,添加帐户信息:<BR>vi /etc/sysconfig/vncservers<BR>做如下修改
<UL class=litype_1 type=1>#&nbsp; &nbsp;
<LI># Uncomment the line below to start a VNC server on display :1&nbsp;&nbsp;# as my 'myusername' (adjust this to your own). You will also
<LI># need to set a VNC password; run 'man vncpasswd' to see how&nbsp;&nbsp;# to do that.
<LI>#&nbsp;&nbsp;# DO NOT RUN THIS SERVICE if your local area network is
<LI># untrusted! For a secure way of using VNC, see&nbsp;&nbsp;# lt;URL:<A href="http://www.uk.research.att.com/vnc/sshvnc.htmlamp" target=_blank>http://www.uk.research.att.com/vnc/sshvnc.htmlamp</A>;gt;.
<LI># <FONT color=#ff0000>VNCSERVERS</FONT>=<FONT color=#0000ff>"1:myusername"</FONT><BR># <FONT color=#ff0000>VNCSERVERS</FONT>=<FONT color=#0000ff>"1:gavin 2:john"</FONT> # use the method for more user
<LI><FONT color=#ff0000>VNCSERVERS</FONT>=<FONT color=#0000ff>"2:root"</FONT><BR># VNCSERVERARGS="-geometry 800x600"
<LI>VNCSERVERARGS="-geometry 1024x768"</LI></UL><BR><BR><BR><BR><BR><B>3.设置 root用户的密码</B><BR>使用如下命令设置密码:vncpasswd<BR>当提示Verify时,再次输入密码**。<BR><B>4.启动VNC服务</B><BR>使用如下命令启动VNC SERVER<BR>sbin/service vncserver start<BR>当显示如下信息时,表示启动成功:<BR>Starting VNC server: 2:root  [ OK ]<BR><B>5.修改VNC SERVER的窗口治理器</B><BR>vnc server默认使用的窗口治理器是twn,这是一个非常简单的窗口治理器,我们可以改成常用的GNOME或者KDE。<BR>先使用如下命令进用户的目录:<BR>cd .vnc/<BR>vi xstartup<BR><BR>按照如下方式修改启动项:<BR><FONT color=#0000ff>#!/bin/sh</FONT><BR><FONT color=#0000ff># Uncomment the following two lines for normal desktop:<BR># unset SESSION_MANAGER<BR># exec /etc/X11/xinit/xinitrc</FONT><BR><FONT color=#0000ff>[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<BR>[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<BR>xsetroot -solid grey<BR>vncconfig -iconic &amp;<BR>xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;</FONT><FONT color=#0000ff><BR>#twm &amp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<FONT color=#444444>#注掉CentOS系统默认的窗口治理器</FONT><BR>#startkde &amp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; #启动KDE桌面<BR></FONT>gnome-session <FONT color=#808000>&amp; </FONT>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<FONT color=#0000ff>#启动gnome桌面</FONT><BR><FONT color=#0000ff></FONT><BR><BR><B>6.重启VNC SERVER</B><BR>/sbin/service vncserver restart<BR>当CentOS系统提示如下信息时,表示重启成功:<BR>Shutting down VNC server: 2:root [ OK ]<BR>Starting VNC server: 2:root [ OK ] <BR><BR>vnc端口5900<BR>iptables -I INPUT -p tcp --dport 5901 -j ACCEPT <BR>/etc/init.d/iptables save<BR><BR><B>7、从VNC view登录</B><BR>在windows上安装vnc view,然后输入xxx.xxx.xxx.xxx:2,连接登录,输入密码即可。备注:假如从vnc view登录时,提示connection refused(10061),则是因为linux防火墙的问题,登录centos系统,选择SystemPreferencesRemote Desktop,勾选sharing中的两项,Security两项不勾,点击关闭,然后再重新用vnc view登录即可。<BR><BR><BR><BR><FONT size=5><FONT color=red>三:安装VirtualBox</FONT></FONT><BR><BR>VirtualBox的安装包,地址如下<A href="http://www.virtualbox.org/wiki/Linux_Downloads" target=_blank>http://www.virtualbox.org/wiki/Linux_Downloads</A><BR><BR><BR>1. 安装Centos 5.4 最精简系统<BR>2.关闭selinux<BR>3.安装Virtualbox<BR>a.安装依赖软件包<BR>yum install mesa-libGL-devel mesa-libGLU-devel libICE-devel libSM-devel libXmu-devel libXt-devel SDL-devel<BR>b.安装内核源代码<BR>yum install gcc make<BR>yum install kernel-devel<BR>export KERN_DIR=/usr/src/kernels/2.6.18-194.3.1.el5-i686/<BR>c.Virtualbox安装配置<BR>wget <A href="http://dlc.sun.com.edgesuite.net/virtualbox/3.2.8/VirtualBox-3.2.8-64453-Linux_amd64.run" target=_blank>http://dlc.sun.com.edgesuite.net/virtualbox/3.2.8/VirtualBox-3.2.8-64453-Linux_amd64.run</A><BR>#chmod +x VirtualBox-3.2.8-64453-Linux_amd64.run<BR>#./VirtualBox-3.2.8-64453-Linux_amd64.run<BR>#gpasswd -a USERNAME vboxusers<BR># /etc/init.d/vboxdrv setup<BR><BR>这一步注意,我安装时遇到问题!需要先以root身份执行:<BR>/etc/init.d/vboxdrv setup<BR>但是执行出错,<U><B><FONT color=#656d77>日志</FONT></B></U>中说找不到内核源代码!后来我执行过如下几组<U><B><FONT color=#656d77>命令</FONT></B></U>:<BR><B>yum groupinstall "Development Tools"<BR>yum groupinstall "Development Libraries"<BR>yum install unifdef rpm-build</B><BR><B>export KERN_DIR=/usr/src/kernels/2.6.18-92.1.18.e15-i686/<BR>然后再执行/etc/init.d/vboxdrv setup成功!后面就继续了!</B><BR>3.先要把用户加入vboxusers用户组才可以使用,不管是根用户还是普通用户.<BR>#usermod -G vboxusers -a xxx<BR>xxx为你的用户名.<BR>4.命令为./VirtualBox<BR>ok,把你的WINXP iso<U><B><FONT color=#656d77>文件</FONT></B></U>放到虚拟机光驱里面,启动就安装XP了.<BR><BR>注意:安装好xp后,先安装客户机(就是XP)的"虚拟专用电脑辅助工具包"( VirtualBox Guest Additions),启动XP后点"设备(D)"--"安装虚拟专用电脑辅助工具包(I)...",然后才可以正确设置virtualbox共享文件夹和滑鼠支持.<BR><BR>5. 共享文件夹<U><B><FONT color=#656d77>设置</FONT></B></U>.<BR>centos中:virtualbox1.4.0中带有图形设置共享的工具了.比较方便.按步操作就可以了.<BR>另外命令形式,用xxx用户执行<BR>$VBoxManage sharedfolder add "WinXP" -name "pp" -hostpath "\home\pp\"<BR><BR>-name 后面是你设置文件夹的名字;-hostpath 后面是centos中你想要挂载的文件夹路径.<BR>XP中:开始-运行- cmd,在命令行输入 net use x: \\vboxsvr\sharename<BR>sharename为上一步-name后面那个.在这里就是pp.<BR>net use X: \\vboxsvr\sharename的解释是将<U><B><FONT color=#656d77>网络</FONT></B></U>共享\\vboxsvr\sharename映射为本机的X:盘符依照这个解释X:应该是用户希望网络映射到的盘符,而不是物理主机共享文件夹名称

dirtysea 发表于 2010-10-20 18:59:08

<P>virtualbox 乱码 </P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>原来这个是语言没有选对的原因,将virtualbox的语言设置为英语就可以了,个人感觉是VBox在RHEL下有点失调 <IMG class=wp-smiley alt=:mrgreen: src="http://www.shocr.com/wp-includes/images/smilies/icon_mrgreen.gif" loaded="true" original="http://www.shocr.com/wp-includes/images/smilies/icon_mrgreen.gif"> .</P>
<P>至于怎么设置为英语,当初我是用以前的记忆,来猜测设置语言的位置.这里为了方便大家,特截图一张.</P>
<P>先 Ctrl + G ,调出全局配置,然后选择English就OK了.</P>
<P><IMG class="alignnone size-full wp-image-622" title=Screenshot-VirtualBox alt="" src="http://www.shocr.com/Res/2009/11/Screenshot-VirtualBox.png" width=492 height=452 loaded="true" original="http://www.shocr.com/Res/2009/11/Screenshot-VirtualBox.png"></P>
页: [1]
查看完整版本: GNOME图形界面+vnc+VirtualBox详细安装