Thursday, 7 June 2012

Centos 6 Minimal installation with Fluxbox

This is a tutorial on installing a Minimal Centos 6 system using Fluxbox, Thunar and Rxvt to create a lightweight, fast and very stable desktop. Access the Desktop programs using the F1 - F12 keys for Thunar File Manager, and Rxvt Terminal etc, with other keys assigned wherever necessary to other programs you have installed. You can also use Mod1 & Mod4 (Alt & Microsoft Logo)
Centos 6 Minimal with Fluxbox, Thunar and Rxvt Terminal
It's fast and easy to use with quick easy use of the command line while still retaining a graphical interface as a focal point. Compiling programs from source is mostly drama free. Centos 6 is an enterprise level clone of RHEL with great support from the Centos team and is a revelation in free Linux distros, with a rock solid and ultra stable kernel.

      It opens the door to people who wish to have more control over what goes on their system without having to endure the endless time consuming idiosyncrasies which plague many of the other lightweight distributions. It is an excellent choice for people who wish to keep up with its corporate brother Red Hat and want full control over what is installed on the OS, even if you have limited experience at tweaking and tuning.
      The tutorial is split into 3 sections and it is fairly quick and straightforward if you just follow each part separately and then check out the optional bits further down the page. Certification students should use the 64 bit variant because of the virtualization requirements of the exam.

      I have included a short guide on updating/fixing the kernel which will help if you wish to compile your own programs from source. You may wish to skip down to this at the beginning of Part 3 then return to finish the setting up. It is a very simple procedure which , once done, will ensure you have no problems compiling programs from source or with performing rpm rebuilds.


 Installation

You will need
  • The netinstall iso
1.Basic Install

Download the iso from the link below 

http://wiki.centos.org/Download 

get the netinstall.iso for your chosen architecture.

Burn it to a disk

Make sure you have an ethernet connection as although there is some wireless support, it is not guaranteed. Boot the disk taking the default option of install or upgrade existing system.

First make a few selections in text mode.

KB and language
Select default network unless you are an advanced user.

Enter the download image url below

http://mirror.centos.org/centos/6/os/i386/ 

http://mirror.centos.org/centos/6/os/x86_64/

and wait for the progress bar to complete

At the splash screen which appears you will go through the following.

Select your storage device (set target device if > 1)
Choose Fresh Installation
Set Domain (options here to set static ip etc)
Set Time
Set root password
select space on the disk (options here for advanced users)
Write changes to disk
Select the Minimal Install radio button.
Options to add more repos.
reboot

2.Fluxbox Desktop
Login with root and password.

Set up epel repo for the packages

# rpm –-import http://mirrors.coreix.net/fedora-epel/RPM-GPG-KEY-EPEL-6

# rpm -Uvh http://mirrors.coreix.net/fedora-epel/6/i386/epel-release-6-8.noarch.rpm

# rpm -Uvh http://mirrors.coreix.net/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

OR you can use wget if you install it first with

# yum -y install wget

Make sure epel repo is enabled

# cat /etc/yum.repos.d/epel.repo               

# vi /etc/yum.repos.d/epel.repo and set 'enabled' to '1' 

See Vim Editor for vi commands 

# yum -y update

Now install the Fluxbox Desktop with 2 commands

# yum -y groupinstall "X Window System"

# yum -y install fluxbox thunar thunar-volman rxvt wget alsa-utils pciutils usbutils xdg-utils fuse fuse-ntfs-3g ntfs-3g ntfsprogs parted udisks gvfs yum-utils bind-utils lsb wireless-tools gdm gtk2-devel zlib-devel glibc glib2 glib2-devel vim-enhanced vim-X11 rpm-build gettext-devel perl-XML-Parser xarchiver p7zip

(The above gives you a basic desktop with window manager, file manager, text editor and a terminal emulator, add any other packages that you require here)

Now set up the sudoers and inittab files. 

# visudo to open sudoers file in vi, add your user by scrolling down to the root entry and and adding underneath
anton ALL=(root) NOPASSWD: ALL

Replace anton with the user name you intend to use, this will allow the user you will create in the next step to use sudo without the password)

# vi /etc/inittab change 3 to 5. (change run level to X server)

reboot.

3. Set up the Desktop
 
Login (automatically as root) where you will be asked to create a user and set time and date, create the same user you entered into the sudoers file earlier, then login as the new user.

(At this point you may wish to set up the kernels to ensure smooth compiling, if so, scroll down to the kernels section below then return here, otherwise continue).

If the first run splash screen fails as has been known, then you can create and add new users manually.

Just hit Ctrl+Alt+F4 to change run level, login as root & follow the instructions in the link.

User added & Artwiz style selected
Then reboot to your gdm screen and login as the new user
 
Fluxbox key bindings

Hit Alt+F2 to run Thunar, check the 'show hidden files' box from the 'view' menu and browse to the .fluxbox directory which is normally hidden.

Open the 'keys' file with vi and add at the top 'F1 : ExecCommand thunar' + copy/paste it 10-12 times.

Change the other F1 entries to F2 - F12 and change the program it runs, for eg F2 : ExecCommand rxvt
F6 : ExecCommand emacs
F9 : ExecCommand google-chrome
F10 : ExecCommand firefox

Thats fine to start with, save the file, close off thunar and restart fluxbox to register the shortcuts (right click and select restart, change styles here also - try zinek_darkblue).

More fluxbox options available at /usr/share/fluxbox + info at

http://fluxbox.org/ 
 
Fluxbox is highly customisable and the F1 - F12 shortcut keys open your most used programs very quickly. (Alt+F2 to run others or you can create shortcut/symlinks in the Desktop folder by cd Desktop sudo ln -s /usr/bin/<prog_name>)

More Keyboard Shortcuts & Autostart


If you have set the fluxbox shortcuts as above, hit F2 to run rxvt terminal, set up your sound and install firefox and google-chrome.

$ alsactl init                         
$ alsamixer 

Set up sound and adjust levels with the above two commands.                             
I'd recommend installing Firefox even if you prefer other browsers simply because it has the required plugins directory which many other browsers depend on. To install the standard repo version.

$ sudo yum -y install firefox

Or you can use the latest version from Remi repo

Open firefox (F10) and browse to and download google-chrome rpm package from their site, install it with $sudo rpm -ivh<rpm_file_name>

(If you have problems with the latest google-chrome release try Chromium, which works well with the Flash and Java plugins)

If you need alternative browsers you can try QtWeb, Midori & Seamonkey, SwiftfoxFlock, Dillo and Elinks in addition to the above. 

Kernels

Set up the kernel files and install basic compile tools.
If using Nvidia graphics drivers this is essential.

Nvidia graphics users should then install Kmod Nvidia Drivers or original Nvidia drivers 

Ideally, make it part of the installation procedure above, although I have not done that to avoid confusion for non Nvidia users, who should just fix the kernel files.













5 comments:

  1. Great post. I have messed with lightweight distros and setups before. For some reason I get too tangled up trying to get features from more heavy-weight desktops. I have always wondered how big of a pain it is to do this in CentOS, but it doesn't look that bad. I am writing distro reviews and if you don't mind, check them out some time. I currently only have one, but am looking to expand. Great work!

    http://www.tuxmatters.com

    ReplyDelete
  2. What about wireless-tools ? What GUI program deals with that?

    ReplyDelete
    Replies
    1. Will look in to that, thanks for bringing it up.

      Delete
  3. Ctrl+Alt+F4 does not work with laptop HP Dv6 Envy

    ReplyDelete