How to install CentOS 5.5 via serial console

I would like to use an old Intel-Based small appliance to have a small-form-factor Linux server.

The hardware is based on Intel Celeron 600MHz processor, 512Mb DDR2 RAM, 40Gb IDE Disk, 4 Ethernet Ports and serial console. There is no VGA, no keyboard and no mouse support.

After some days spent in Internet Browsing and lots of articles reading I have decide to use CentOS 5.5 x86 as Linux distribution.

Now we can start with this step-by-step guide…..first of all: what we need to complete the task!!

  • CentOS 5.5 x86 ISO image. You can download it on http://www.centos.org
  • Linux Box to work with ISO
  • Serial to console cable. You could use also serial-to-serial NULL modem cable: depends on your hardware device.
    My desktop pc doesn’t have any COM serial port installed, so I have bought a Hama RS232 to USB cable. This device has been recognized by Linux as PL2303 and works out of the box. Great!
    If you want to use Putty under linux (or minicom) please be sure to set Flow Control parameter on OFF before use this cable.
  • External USB DVD reader

Download and modify CentOS Install Disk
In order to have setup output redirected to serial consol we need to modify the bootable installation CentOS disk. I have found an interesting How To on CentOS website. You can found it here. The guide is related to VNC connections but we will change something in order to work as serial console bootable disk.

Please note: brackets indicates parameter. You must type the command without brackets!

  • Create a temporary dir where you will work on files and save the ISO file.
  • Mount the ISO files on /mnt/iso
    # mkdir /tmp/installdir
    # mount -o loop <iso_file_name.iso> /mnt/iso
    # cp -a /mnt/iso/* /tmp/installdir
    # cp /mnt/.* /tmp/installdir
  • Modify isolinux.cfg in order to have serial console output during installation
    # cd /tmp/installdir
    # vi isolinux/isolinux.cfg
    The original file will look like this:

    default linux
    prompt 1
    timeout 600
    display boot.msg
    F1 boot.msg
    F2 options.msg
    F3 general.msg
    F4 param.msg
    F5 rescue.msg
    F7 snake.msg
    label linux
    kernel vmlinuz
    append initrd=initrd.img ramdisk_size=8192
    label text
    kernel vmlinuz
    append initrd=initrd.img text ramdisk_size=8192
    label expert
    kernel vmlinuz
    append expert initrd=initrd.img ramdisk_size=8192
    label ks
    kernel vmlinuz
    append ks initrd=initrd.img ramdisk_size=8192
    label lowres
    kernel vmlinuz
    append initrd=initrd.img lowres ramdisk_size=8192
    label local
    localboot 1
    label memtest86
    kernel memtest
    append –

    We need to make some changes to have this:

    default linux
    prompt 1
    timeout 50
    label linux
    kernel vmlinuz
    append initrd=initrd.img ramdisk_size=8192 console=tty0 console=ttyS0,115200n8
    label text
    kernel vmlinuz
    append initrd=initrd.img text ramdisk_size=8192 console=tty0 console=ttyS0,115200n8
    label expert
    kernel vmlinuz
    append expert initrd=initrd.img ramdisk_size=8192
    label ks
    kernel vmlinuz
    append ks initrd=initrd.img ramdisk_size=8192
    label lowres
    kernel vmlinuz
    append initrd=initrd.img lowres ramdisk_size=8192
    label local
    localboot 1
    label memtest86
    kernel memtest
    append –

    The line “console=tty0 console=ttyS0,115200n8″ added at the end of the lines is need to specify that the console serial port will be COM1 (tty0) with 115200 baud rate (you can choose to set 9600), 8 bit, no parity, 1 stop bit.

  • Change isolinux.cfg permissions
    # chmod u+w isolinux/*
  • Finally we can pack the new ISO file
    # mkisofs -o /tmp/SerialCentOS.iso -b isolinux/isolinux.bin -c isolinux/isolinux.cfg -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T . (note “.” at the end!!!)

Burn the ISO image

For image burning I’m using Brasero under Ubuntu, but you can use your favorite burner.

Install software on appliance

Connect serial cable o console port and set your terminal client to 9600,8,N,1
Plug your USB external DVD reader on your appliance, insert the modifed ISO image and switch on the appliance…you will see BIOS information on screen and you can continue to install your LinuxBox as usual :)

Comments

  1. dimi says

    Hi m8

    I have some questions because for me it didnt work:

    1) on the line append initrd=initrd.img ramdisk_size=8192 console=tty0 console=ttyS0,115200n8. Is the “8192” (Â) a typo error?

    2) When i run the command “# cp /mnt/.* /tmp/installdir” i get ommiting directory error. When i execute it with parameter -r it works with no problem but it takes ages auntil it finishes. What is the meaning of this command to copy all the files after

    thanks

Leave a Reply

Your email address will not be published. Required fields are marked *