It is always easy to Install GUI during the Initial Linux Installation by selecting respective “KDE” , “GNOME”, “Desktop” packages. At times I wanted to see how we can do this post basic OS installation when you have not selected the above packages during your Initial installation. But, I always kept on delaying this experiment until yesterday when i sat down to try something else and  was badly in need of getting the Linux GUI up.

So, yesterday  I was working with my Redhat Guest Virtual Machine and for some reason I wanted to see the GUI. I initially ran commands like startx and xclock which didn’t work as they don’t seem to exist at all.

I was thinking of lot of permutations and combinations as why it didn’t work.

At first  I ran the command “who -r” to see the run-level where I was sitting, which basically said I was in Run-level 3. Tried switching to “init5” didn’t work.

Now I thought might be I should persist the run-level by making the changes to the /etc/initab. When i verified the current level it showed it as “3” as default

Before :

[root@redhat-test1 ~]# cat /etc/inittab

id:3:initdefault:

After changing run level:

[root@redhat-test1 ~]# cat /etc/inittab

id:5:initdefault:

I then changed it to run-level 5 by making changes as shown above and rebooted the system. The system was coming up but not the GUI. Redhat was showing “Blue”hanging progress bar instead of its usual red and white progress bar. The Login from Putty to shell though was working fine, its just that the GUI was not up. I knew then something was still not right.

I started thinking if the issue is due to possible missing RPMs related to the desktop/kde/gnome. So it was time for me to wakeup “Google Baba” the omni present:P and ask him as how others have solved this. I checked couple of URLs but there was no straightforward answer for this but atleast they gave me some good pointers. So instead of showing my experiments and how I got this up with reverse engineering, I would rather try to give direct and simple steps as how you can do this. Simple and Straightforward// I hope so 😛

  • First mount your local ISO Image/CD on your server
  • Try to use the ISO /CD as your YUM repository ( as you need several dependency packages for the GUI environment to get installed)
  • Once you successfully mount the ISO image or if you have your local repository already on the system install the below RPMS using “yum”

[root@redhat6 Server] yum -y groupinstall “Desktop”
[root@redhat6 Server] yum -y groupinstall “KDE Desktop”
[root@redhat6 Server] yum -y groupinstall “X Window System

“X Window System” – which installs all your xorg-x11 and xorg-x11-server rpms along with their their deps.

At the prompt now run the command “init 5” and the desktop will try to start up slowly

[root@redhat6 Server] init 5

If the GUI/Desktop has come up but if it is hanging or not displaying properly don’t mind giving once nice “init 6” reboot kick. Finally you can see the GUI.

Now for people  ( Including me ) who struggle to set the CDROM as the REPO for installing all the dependency RPMS please follow the below steps.

Create local dir and mount Cdrom 

Note in my case it is /dev/cdrom as I am using this from VMware, locate and mount respective cdrom device.

[root@redhat-test1 ~]# mkdir /mnt/Redat_CD

[root@redhat-test1 ~]# mount /dev/cdrom    /mnt/Redhat_CD/
mount: block device /dev/sr0 is write-protected, mounting read-only

Creating CD yum repository and adding it yum repo file. 

In this case I selected to append the new Redhat CD/DVD repo config “[REDHAT-CD-REPO]” to the existing ” rhel-source.repo” file present in /etc/yum.repos.d directory. However, this is  not mandatory. You can create your own <filename>.repo file and create an entry for “[REDHAT-CD-REPO]” in the new repo file.

[root@redhat-test1 yum.repos.d]# pwd
/etc/yum.repos.d

[root@redhat-test1 yum.repos.d]# more rhel-source.repo

[REDHAT-CD-REPO]

name=Redhat cd repo
baseurl=file:///mnt/Redhat_CD/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Note: For some reason Redhat doesn’t like space in the [  ] TAG when you enter name. So make sure you either add underscore or dash like the one I did.

Still not working … Give me a shout … ! I would def try to solve it .. 🙂

Advertisements