Wednesday, May 24

Installing CentOS linux on a remote machine

Most people know how easy it is to install Solaris on remote sparc server and some people have probably tried using a kickstart file for Redhat'ish Linux installs.
I've used kickstart files for quite some time with quite frequent hickups. The annoying bit about kickstarts is that if anything goes wrong, the anaconda installer either blocks with a message on the screen or simply crash and reboot the machine. Such situations can be quit tricky to troubleshoot over a 2Mbit WAN connection (2Mbit is better but I've tried it over 512kb DSL lines without to much hassle). Lately I've been more and more turned away from kickstarts for WAN installs and instead just PXE boot the remote machine and pull upp a remote VNC screen on my workstation. This is especially usefull when the machine lacks a decent remote management card. Like the Dell SC1425's where the IPMI card pretty much suck.
Yep, ananconda has native VNC support.

It's quite simple to use, just remember to pass all pre-stage 2 installer questions to the installer from the PXE command line, things like install method and language support.

I've simply copied the vmlinuz and initrd files from the PXE dir in the CentOS distro to /tftpboot on my deployment server.
Here's an example entry from my pxelinux.cfg for that box, remember to put all the append stuff on one line.
label c4remote
kernel vmlinuz-c4-i386
append initrd=initrd-c4-i386.img lang=en_US.UTF-8 keymap=uk \
vnc vncconnect=haliws.uk.company.com ip=dhcp \
method=nfs:deploysrv:/dist/centos-4-i386
All you need now is to get the box to actually boot of the network. I usually use two methods do this.
  • First method, use the remote card to reboot the machine with pxe as the default boot device. ipmitool is usefull to do this or if you have a nicer box, like a midrange HP with a decent iLO inteface just ssh in and reboot it that way.

  • The second method is more tricky, you actually need someone on the remote site with a console to the server who can actually press F12 (or whatever kicks off the PXE boot on the server). The human error factor here is masssive. :)

  • On the machine where you want the VNC screen you simply start a vnc listener with the command vncviewer -listen

    Simple as that, now when anaconda enter stage 2 of the install it will instead of starting X on the server start a vnc session connected to the listening viewer.
    This method works on RHEL, Fedora as well as on CentOS.

    1 comment:

    Anonymous said...

    Can you make a step by step on your method installing CentOS with PXE? I'm trying to learn installing OS by means of PXE.