Sunday, May 27, 2012

Installing CentOS 6 - part 3 - Chrome installation


To install chrome in CentOS 6 it is easier to just add Google's chrome repositories to yum and install from there.

1. I first installed a yum extender, a yum frontend to make things easier from XFCE.

yum install yumex

2. Then added the following google repository. Create the file /etc/yum.repos.d/google-chrome.repo with the following contents:

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1

3. Import the public key:

rpm --import https://dl-ssl.google.com/linux/linux_signing_key.pub

4. Install google chrome from yumex or yum directly

yum install google-chrome-stable

Next post will be about how to install and configure remote desktop with vnc.

Thursday, May 24, 2012

Installing CentOS 6 - part2

Continuing from previous post...

6. Enable XFCE as the default desktop environment can't be done without you to first installing the X Window System and gdm

yum groupinstall "X Window System"
yum install gdm

7. Set XFCE as default desktop environment by creating the file /etc/sysconfig/desktop


DESKTOP="XFCE"
DISPLAYMANAGER="GDM"


and editing /etc/X11/xinit/XClients so it accepts the option "XFCE"


GSESSION="$(which gnome-session 2>/dev/null)"
STARTKDE="$(which startkde 2>/dev/null)"
STARTXFCE="$(which startxfce4 2>/dev/null)"


# check to see if the user has a preferred desktop
PREFERRED=
if [ -f /etc/sysconfig/desktop ]; then
    . /etc/sysconfig/desktop
    if [ "$DESKTOP" = "GNOME" ]; then
PREFERRED="$GSESSION"
    elif [ "$DESKTOP" = "KDE" ]; then
PREFERRED="$STARTKDE"
    elif [ "$DESKTOP" = "XFCE" ]; then
PREFERRED="$STARTXFCE"
    fi
fi


if [ -n "$PREFERRED" ]; then
    exec "$PREFERRED"
fi


# now if we can reach here, either no desktop file was present,
# or the desktop requested is not installed.


if [ -n "$GSESSION" ]; then
    # by default, we run GNOME.
    exec "$GSESSION"
elif [ -n "$STARTKDE" ]; then
    # if GNOME isn't installed, try KDE.
    exec "$STARTKDE"
elif [ -n "$STARTXFCE" ]; then
    # if GNOME and KDE aren't installed, try XFCE
    exec "$STARTXFCE"
fi


# We should also support /etc/X11/xinit/Xclients.d scripts
XCLIENTS_D=/etc/X11/xinit/Xclients.d
if [ -d "$XCLIENTS_D" -a "$#" -eq 1 -a -x "$XCLIENTS_D/Xclients.$1.sh" ]; then
    exec -l $SHELL -c "$SSH_AGENT $XCLIENTS_D/Xclients.$1.sh"
fi


# Failsafe.


# these files are left sitting around by TheNextLevel.
rm -f $HOME/Xrootenv.0


# Argh! Nothing good is installed. Fall back to twm
{
    # gosh, neither fvwm95 nor fvwm2 is available; 
    # fall back to failsafe settings
    [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'


    if [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 &
    elif [ -x /usr/bin/xclock ] ; then
/usr/bin/xclock -geometry 100x100-5+5 &
    fi
    if [ -x /usr/bin/xterm ] ; then
        /usr/bin/xterm -geometry 80x50-50+150 &
    fi
    if [ -x /usr/bin/firefox -a -f /usr/share/doc/HTML/index.html ]; then
/usr/bin/firefox /usr/share/doc/HTML/index.html &
    fi
    if [ -x /usr/bin/twm ] ; then
exec /usr/bin/twm
    fi
}

8. Finally change the runlevel from 3 to 5 in /etc/inittab

# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# 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:5:initdefault:

I wrote this post from google chrome installed on CentOS 6, I will explain how I installed it in the next post.

Wednesday, May 23, 2012

Installing CentOS 6 - part1

I managed to get a server from e-waste and I'm trying to setup a virtual-box kind of server so I can run some virtual machines.

Its spec is very tight with just 2GB of RAM to spare so I have chosen to use XFCE as the desktop environment.
I going to keep track of what I do in this post and the following ones.

1. Downloaded latest version CentOS 6.2 from a UK mirror:

http://www.centos.org/modules/tinycontent/index.php?id=34

I chose the minimal install ISO so I can go step by step and just have the bare minimum software needed for virtualbox to run smooth.

I burned the ISO and run through the installed just selecting the option to wipe out the whole disk, I'm not interested in disk partitioning this time around.

2. Configured network:

a) Edited the network script for eth0 so it uses dhcp

vi /etc/sysconfig/netowrk-scripts/ifcfg-eth0

Added the following lines so eth0 is enabled at boot and it uses dhcp client to get IP address:

ONBOOT="yes"
BOOTPROTO="dhcp"

b) Restarted the network service

/etc/init.d/network restart

3. Installed some additional packages

yum groupinstall base

4. Installed XFCE thanks to the epel extra yum repositories
 http://www.cyberciti.biz/faq/fedora-sl-centos-redhat6-enable-epel-repo/

a) Got the yum repository updated thanks to this RPM package:
epel-release-6-6.noarch.rpm

That was the last version of the package I found available in the following web site so I had to modify a bit the instructions.
http://mirror01.th.ifl.net/epel/6/i386/repoview/epel-release.html

wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-6.noarch.rpm
rpm -ivh epel-release-6-6.noarch.rpm

b) Installed the group package xfce

yum groupinstall xfce

I'll setup X and set XFCE as default desktop environment tomorrow...