在虚拟机下安装Red Hat Enterprise Linux 6.1时,如果内存为512M或更小时,安装过程会提示内存太小,无法启用图形界面。这样,就只能是最小化安装。装好后,怎样安装桌面呢。
一、配置yum库
1.挂载镜像
[root@RedHat ~]# mkdir /media/rhel
[root@redhat ~]# mount -o loop /dev/sr0 /media/rhel
2.使镜像能开机自动挂载
在/etc/fstab的最下面添加下面一句
[root@redhat ~]# vi /etc/fstab
/dev/sr0linuxlinuxlinuxlinuxlinux /media/rhellinuxlinuxlinuxlinuxiso9660linuxlinux ro,looplinuxlinuxlinux0 0
3.新建一个本地repo文件
紫色的部分可以不要添加,只要黑体那部分就行了。
[root@redhat ~]# vi /etc/yum.repos.d/local.repo
[Server]
name=Server
baseurl=file:///media/rhel/Server
enabled=1
gpgcheck=0
[HighAvailability]
name=HighAvailability
baseurl=file:///media/rhel/HighAvailability
enabled=1
gpgcheck=0
[LoadBalancer]
name=LoadBalancer
baseurl=file:///media/rhel/LoadBalancer
enabled=1
gpgcheck=0
二、安装桌面
1.检查软件组
查看一下桌面在哪个软件组里
[root@redhat ~]# yum grouplist
Loaded plugins: refresh-packagekit
Setting up Group Process
HighAvailability/group_gzlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinux | 4.0 kBlinux 00:00 ...
LoadBalancer/group_gzlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinuxlinux| 2.1 kBlinux 00:00 ...
Installed Groups:
linuxAdditional Development
linuxBase
linuxConsole internet tools
linuxDesktop
linuxDesktop Debugging and Performance Tools
linuxDial-up Networking Support
linuxE-mail server
linuxFCoE Storage Client
linuxFTP server
linuxFonts
linuxGeneral Purpose Desktop
linuxGraphical Administration Tools
linuxHardware monitoring utilities
linuxInput Methods
linuxLegacy UNIX compatibility
linuxLegacy X Window System compatibility
linuxNFS file server
linuxNetwork Infrastructure Server
linuxNetwork file system client
linuxNetworking Tools
linuxPerformance Tools
linuxPerl Support
linuxRemote Desktop Clients
linuxSecurity Tools
linuxSmart card support
linuxStorage Availability Tools
linuxSystem administration tools
linuxX Window System
linuxiSCSI Storage Client
Installed Language Groups:
linuxArabic Support [ar]
linuxArmenian Support [hy]
linuxAssamese Support [as]
linuxBengali Support [bn]
linuxBhutanese Support [dz]
linuxChinese Support [zh]
linuxEthiopic Support [am]
linuxGeorgian Support [ka]
linuxGujarati Support [gu]
linuxHebrew Support [he]
linuxHindi Support [hi]
linuxInuktitut Support [iu]
linuxJapanese Support [ja]
linuxKannada Support [kn]
linuxKhmer Support [km]
linuxKonkani Support [kok]
linuxKorean Support [ko]
linuxKurdish Support [ku]
linuxLao Support [lo]
linuxMaithili Support [mai]
linuxMalayalam Support [ml]
linuxMarathi Support [mr]
linuxMyanmar (Burmese) Support [my]
linuxOriya Support [or]
linuxPunjabi Support [pa]
linuxSinhala Support [si]
linuxTajik Support [tg]
linuxTamil Support [ta]
linuxTelugu Support [te]
linuxThai Support [th]
linuxUrdu Support [ur]
linuxVenda Support [ve]
Available Groups:
linuxBackup Client
linuxBackup Server
linuxCIFS file server
linuxClient management tools
linuxCompatibility libraries
linuxDebugging Tools
linuxDesktop Platform
linuxDesktop Platform Development
linuxDevelopment tools
linuxDirectory Client
linuxDirectory Server
linuxEclipse
linuxEmacs
linuxEnterprise Identity Server Base
linuxGraphics Creation Tools
linuxHigh Availability
linuxHigh Availability Management
linuxInfiniband Support
linuxInternet Browser
linuxJava Platform
linuxKDE Desktop
linuxLarge Systems Performance
linuxLoad Balancer
linuxMainframe Access
linuxMessaging Client Support
linuxMySQL Database client
linuxMySQL Database server
linuxNetwork Storage Server
linuxPHP Support
linuxPostgreSQL Database client
linuxPostgreSQL Database server
linuxPrint Server
linuxPrinting client
linuxSNMP Support
linuxScientific support
linuxServer Platform
linuxServer Platform Development
linuxSomali Support
linuxSystem Management
linuxSystems Management Messaging Server support
linuxTeX support
linuxTechnical Writing
linuxTurboGears application framework
linuxVirtualization
linuxVirtualization Client
linuxVirtualization Platform
linuxVirtualization Tools
linuxWeb Server
linuxWeb Servlet Engine
linuxWeb-Based Enterprise Management
Available Language Groups:
linuxAfrikaans Support [af]
linuxAlbanian Support [sq]
linuxAmazigh Support [ber]
linuxAzerbaijani Support [az]
linuxBasque Support [eu]
linuxBelarusian Support [be]
linuxBrazilian Portuguese Support [pt_BR]
linuxBreton Support [br]
linuxBulgarian Support [bg]
linuxCatalan Support [ca]
linuxChhattisgarhi Support [hne]
linuxChichewa Support [ny]
linuxCoptic Support [cop]
linuxCroatian Support [hr]
linuxCzech Support [cs]
linuxDanish Support [da]
linuxDutch Support [nl]
linuxEnglish (UK) Support [en_GB]
linuxEsperanto Support [eo]
linuxEstonian Support [et]
linuxFaroese Support [fo]
linuxFijian Support [fj]
linuxFilipino Support [fil]
linuxFinnish Support [fi]
linuxFrench Support [fr]
linuxFrisian Support [fy]
linuxFriulian Support [fur]
linuxGaelic Support [gd]
linuxGalician Support [gl]
linuxGerman Support [de]
linuxGreek Support [el]
linuxHiligaynon Support [hil]
linuxHungarian Support [hu]
linuxIcelandic Support [is]
linuxIndonesian Support [id]
linuxInterlingua Support [ia]
linuxIrish Support [ga]
linuxItalian Support [it]
linuxKashmiri Support [ks]
linuxKashubian Support [csb]
linuxKazakh Support [kk]
linuxKinyarwanda Support [rw]
linuxLatin Support [la]
linuxLatvian Support [lv]
linuxLithuanian Support [lt]
linuxLow Saxon Support [nds]
linuxLuxembourgish Support [lb]
linuxMacedonian Support [mk]
linuxMalagasy Support [mg]
linuxMalay Support [ms]
linuxMaltese Support [mt]
linuxManx Support [gv]
linuxMaori Support [mi]
linuxMongolian Support [mn]
linuxNepali Support [ne]
linuxNorthern Sotho Support [nso]
linuxNorwegian Support [nb]
linuxOccitan Support [oc]
linuxPersian Support [fa]
linuxPolish Support [pl]
linuxPortuguese Support [pt]
linuxRomanian Support [ro]
linuxRussian Support [ru]
linuxSanskrit Support [sa]
linuxSardinian Support [sc]
linuxSerbian Support [sr]
linuxSindhi Support [sd]
linuxSlovak Support [sk]
linuxSlovenian Support [sl]
linuxSouthern Ndebele Support [nr]
linuxSouthern Sotho Support [st]
linuxSpanish Support [es]
linuxSwahili Support [sw]
linuxSwati Support [ss]
linuxSwedish Support [sv]
linuxTagalog Support [tl]
linuxTetum Support [tet]
linuxTibetan Support [bo]
linuxTsonga Support [ts]
linuxTswana Support [tn]
linuxTurkish Support [tr]
linuxTurkmen Support [tk]
linuxUkrainian Support [uk]
linuxUpper Sorbian Support [hsb]
linuxUzbek Support [uz]
linuxVietnamese Support [vi]
linuxWalloon Support [wa]
linuxWelsh Support [cy]
linuxXhosa Support [xh]
linuxZulu Support [zu]
Done
2.安装桌面
桌面在软件组desktop中,这和rhel5不太一样,rhel5里面好像为gnome
那么就开始安装桌面吧,但之前必须先安装Xwindow软件组
[root@RedHat ~]# yum groupinstall “X Window System”
[root@redhat ~]# yum groupinstall “Desktop”
3. 虽然到此就可以启动桌面了,但是linux建议不要让root用户直接登录图形界面
所以,我们最好再创建一个普通用户
[root@redhat ~]# useradd kevin
创建kevin的密码
[root@redhat ~]# passwd kevin
4.启动X:
首先切换到普通用户
[root@redhat ~]# su - kevin
[kevin@redhat ~] $ startx
5.更改启动模式
这时如果重启的话还是会直接进入命令界面,所以必须调整开机进入桌面还是命令界面
[root@redhat ~]#vim /etc/inittab
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:
将上面部分的 3改成5
3为命令行界面 5为X window图形界面
5.删除redhat订阅:
rhel6.1新增了一个redhat订阅,没有用,可以删除
[root@redhat ~]# yum remove subscription*
6.安装桌面右键终端:
[root@redhat ~]# yum install nautilus-open-terminal