Thursday, September 26, 2013

Adding RHEL6 installation DVD as yum repository

In building a RHEL6 VM (VMware Workstation), I wanted to define the install DVD ISO as a yum repository.


  • Mount the ISO through workstation as a DVD
  • Verify your path to the disk.  Easiest way... try right-clicking on the DVD desktop icon and select "Open in Terminal".  Use pwd to see the path.
  • Create the file /etc/yum.repos.d/dvd.repo
      [RHEL6-DVD-Server] 
      mediaid=xxxxxxxxxx.xxxxxx
      name=RHEL6 DVD Server
      baseurl=file:///media/RHEL_6.0\ x86_64\ Disc\ 1/Server
      enabled=1
      gpgcheck=1

  • Replace xxxxxxxxxx.xxxxxx with number in /path/to/DVD/.discinfo
      # cat /media/RHEL_6.0\ x86_64\ Disc\ 1/.discinfo
      1285193176.460470
      Red Hat Enterprise Linux 6.0
      x86_64
      1
  • rpm --import /path/to/DVD/RPM-GPG-KEY-redhat-release
      rpm --import /media/RHEL_6.0\ x86_64\ Disc\ 1/RPM-GPG-KEY-redhat-release

At this point, the yum repository should be visible and ready to use.  Try the following commands to confirm:
  • yum repolist
  • yum grouplist

Wednesday, September 25, 2013

Building a new RHEL6 VM using kickstart

There are main things I need here:

  1. A new VM -  Pretty easy, just use workstation and create a new VM without installing the OS.  
  2. The RHEL6 install disk - Mount the RHEL6 install disk ISO in the new VM.  
  3. The kickstart file - this is the tricky part.  Two things are critical here... a) the kickstart cfg file needs to be accessible to the new VM, and b) the kickstart cfg file needs to define where to get the install bit. 
To address the first issue (a), the simplest way to tackle this is to create a kickstart cfg file and make it available locally on the network via http.  I did this by bringing up a second VM and simply using a local httpd and copying the ks.cfg into the htdocs directory.

To address the second issue (b), the kickstart file needs to point the installer to the repo (or DVD) with the RHEL6 install bits.  As mentioned above in point 2, the disk was already made available through the virtual DVD (it could also be made available through the httpd that is being used for the ks.cfg file).  But just because the ISO is available doesn't mean that kickstart knows to use it.  So, if the following line is part of the ks.cfg file, kickstart will look to the local booted source as the DVD.

    #repo --name="Red Hat Enterprise Linux"  --baseurl=file:///mnt/source --cost=100

You are now ready to start the kickstart process.

  • Boot the new VM (off of the DVD ISO - use F2 to set the boot order)
  • On the screen where you are given a choice of where to boot from or where to install from, accept the first option "Install or upgrade an existing system" and hit TAB to edit the options
  • Add the following to the end of the existing line (vmlinuz initrd=initrd.img is already there):
    • vmlinuz initrd=initrd.img ks=http://<httpd-ip-addr>/ks.cfg
  • Hit enter to continue.
  • Accept whatever else the wizard offers you
    • Use All Space or Replace Existing Linux

Saturday, September 21, 2013

Avoid emacs split window at startup

If the variable inhibit-startup-screen is non-nil, Emacs does not display the startup screen.

Set the setting in your .emacs file. 

(setq inhibit-startup-screen t)