Upgrading to CentOS4, over a remote vnc connection

by Karanbir Singh Email

If you are running CentOS3 or even for that matter any other Linux distro and want to upgrade your machine to CentOS4 - and the machine is sitting on the other side of the globe - the easiest and most effective way to do so is using the remote vnc install method with the 'upgradeany' directive to the anaconda-installer.

Here is a extremely short mini guide to remote installation over vnc ( for the x86/i386/ia32 Architecture, make adjustments for any other arch ):

You need the PXE boot images from
http://mirror.centos.org/centos/4/os/i386/images/pxeboot/ - and drop them into the /boot directory. Then setup grub.conf to boot this vmlinuz file as kernel and initrd.img as the initrd.

on the kernel line you need the following additional info :

vnc vncconnect=192.168.0.23 headless ip=dhcp ksdevice=eth0 method=http://mirror.centos.org/centos/4/os/i386/ lang=en_GB keymap=uk

( replace 192.168.0.23 with the IP address of your client machine )

so the kernel line becomes ( in one line ):

kernel /boot/vmlinuz vnc vncconnect=192.168.0.23 headless ip=dhcp ksdevice=eth0 method=http://mirror.centos.org/centos/4/os/i386/ lang=en_GB keymap=uk

On the client machine, you need to run 'vncviewer --listen' which will setup vncviewer and have it ready to accept an incoming connection on port 5500. If you are behind a NAT, router, firewall etc - make sure that your machine has inward access on port 5500.

Reboot the main server with the new settings in grub.conf as default. It should boot and connect to your listening vncviewer and allow you to manually run through a remote install.

couple of extra points here :
1. since you are moving from C3 to C4, you would want the 'upgradeany' line in there with the kernel param's as well. This is also known to work for Mandrake and SuSe, but you are going to be much better of reinstalling for those distro's.

2. Make sure there is a recovery plan, in the event the system does not boot to plan.

3. Test locally, test again, and then test once again. Few things are as much fun as as a server sitting in a DataCenter that didn't come back up ( has not happened with me as yet, 15+ machines worked - but you never know. Sod's law. )

4. the line is setup for a dhcp IP get, if you need to drop a specific network setup replace the ip=dhcp with something like this :
ip=192.168.1.105 netmask=255.255.255.0 gateway=192.168.1.2 dns=192.168.1.2 hostname=agni.build.karan.org ( note that the NameServer is refered to as dns=x.x.x.x and not nameserver=x.x.x.x )

Obviously, replace the IP's etc with things that mean something to you, in your specific situation.

5. The setup's here are all for i386, change that to reflect whatever arch you are install on.

Thats about it. To recap, get the pxe images, drop them into /boot, setup /boot/grub/grub.conf as required to boot these images, setup the kernel line in the grub.conf to reflect choices, setup the client machine with vncviewer --listen, reboot main server.

Let me know how you get along. Test please.

--
Karanbir Singh { http://www.karan.org/ }

21 comments

Comment from: Claudio Neves [Visitor]
I would like to thank you for this simple guide, it's not very clear in other documentation what's the exact syntax when a static network configuration is needed!

To help other people that might get in trouble when trying this, here are some tips:

1. If your client machine is behind a firewall, instead of using vncconnect=x.x.x.x , one can use vncpassword=SOMEPASSWORD . This way the client don't need to be in listen mode and can connect to server_ip:1 through vnc client;
2. If you have multiple NICs, the NIC device maybe different from your current installation. In my case, I was using eth0 in my old installation, and in the new installation, the same NIC was recognized as eth1, not eth0.

Thanks again for your help,
Claudio Neves
23/Jul/2005 @ 05:27
Comment from: jason k [Visitor] · http://www.yorokonde.com
ack it vnc died in the middle of install, so now i dont know is happening :/
30/Aug/2005 @ 19:31
Comment from: Karanbir Singh [Member] Email · http://www.karan.org/
when writing lines for kernel and initrd in the grub.conf file - check to see if the previous entries have a /boot/ preceeding them, a couple of guys used the /boot/ when they did not need them and ended up with non-booting systems.

Best way to check - if you have a dedicated partition for /boot then you dont need the /boot/ portion in the kernel and initrd lines. The easy way to check : just look at the previous entries, if they have the /boot/ portion, then use it. if not, just skip it and your kernel line should look like :

kernel vmlinuz vnc vncconnect=192.168.0.23 headless ip=dhcp ksdevice=eth0 method=http://mirror.centos.org/centos/4/os/i386/ lang=en_GB keymap=uk
04/Dec/2005 @ 01:56
Comment from: Karanbir Singh [Member] Email · http://www.karan.org/
Important Note: This process will _not_ work for you if the hardware on your machine needs specific Drivers to function - specifically the Hard Drive and Network interface.

07/Dec/2005 @ 20:38
Comment from: Johnny Hughes [Visitor] · http://www.HughesJR.com
Karanbir,

I just want to thank you for publishing this ... I use it time and time again when doing vnc installs. I can find it easier than my notes :)
19/Dec/2005 @ 13:20
Comment from: Will [Visitor]
Wonderful, or was until the VNC cut out, did anyone ever find a way to get back in?
21/Jan/2006 @ 00:35
Comment from: Karanbir Singh [Member] Email · http://www.karan.org/
you should be able to just vnc back to the installing server - if the server is still running, it will connect you right back in
21/Jan/2006 @ 00:44
Comment from: Kent [Visitor]
I'm unable to start ftp vnc install remotely. it give me "Graphical installation not available... Starting text mode." and goto TEXT mode install. However if I boot up the cdrom and type in the same kernel parameters it works!

Here's my pxelinux.cfg/default file:
prompt 1
default vnc-install
timeout 10

label vnc-install
kernel vmlinuz
append vnc vncconnect=192.168.106.1 initrd=initrd.img headless ip=dhcp ksdevice=eth0 method=ftp://ftp.hostrino.com/pub/centos/4.2/os/i386/ lang=en_US keymap=us

#append ks=nfs:192.168.106.1:/tftpboot/ks.cfg initrd=initrd.img ramdisk_size=8192 ksdevice=eth0 ip=dhcp
#method=ftp://mirror.simlink.com.hk/centos/4.2/os/i386/

ks.cfg:
vnc --connect 192.168.106.1
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
url --url ftp://mirror.simlink.com.hk/centos/4.2/os/i386/

Any help is highly appreciated.

thx.
Kent.
25/Jan/2006 @ 11:19
Comment from: Truong Anh Tuan [Visitor] · http://www.iwayvietnam.com
What do I have to do when I use lilo instead of grub?
(I use SuSE 9.0 with LILO as boot loader)

Have you ever done that?

Thanks!
13/Mar/2006 @ 03:40
Comment from: Truong Anh Tuan [Visitor] · http://www.iwayvietam.com
My problem has been solved.
I change the boot loader to GRUB before do following this process here.

Very simple :)
13/Mar/2006 @ 16:00
Comment from: Greg D [Visitor] Email
I have successfully used this method in the past on CentOS 3.x, but am having problems with CentOS 4.x. It seems everything goes fine during the boot process, but the system hangs waiting for an upgrade method such as CDROM, NFS, or website. I have the following line:
method=http://mirror.centos.org/centos/4/os/i386/
being passed to the kernel, but it still prompts on the console. Any ideas?
24/Oct/2006 @ 01:02
Comment from: Truong Anh Tuan [Visitor] Email · http://www1.iwayvietnam.com
My server is running Fedora Core 6. I would like to reinstall CentOS 4.

I tried this method. I checked all steps, parameters carefully.
However, I had a problem: VNC did not connect after rebooting.

I did a small test with my local test server and I recognized that the reason is X not start, just text mode. I increased RAM on my local test server from 160MB to 384MB and everything is OK.

My live server is Celeron 1.7, 512MB RAM, 80GB HDD. I think it is enough to startX.

Have you got any solution for me? (e.g. change some settings, etc.)
Or is there good alternative method to do reinstalling?

Thanks and kind regards,
Tuan
23/May/2007 @ 09:32
Comment from: Ryan R. [Visitor] Email
I am trying to set up CentOS 5 onto 10 headless servers, and it keeps stopping at the method=http://mirror.centos.org/centos/5/os/i386 The /images/stage2.img file is there, and that's what it keeps asking for. I've tried to download the stage2.img file to a local NFS server, and use method=nfs:x.x.x.x:/centos/stage2.img, but no luck.
Any Ideas?

P.S. The basic installer does support Intel/Pro 10/100 NIC right?

Thanks for your help,
Ryan
26/Sep/2007 @ 07:18
Comment from: Karanbir Singh [Member] Email · http://www.karan.org/
how is your IP stuff setup ? why not paste the complete kernel line you are using here, and we can take a look. My first guess would be that your network settings are not getting setup right.

yes, the e100 does work fine afaik.
27/Sep/2007 @ 05:28
Comment from: Kai [Visitor] Email
Make sure that your append command line (all that *behind* the append command) is no longer than 255 characters. Anything after that gets truncated. So, if you happen to have your method URL at the end and it fails because it cannot retrieve stage2.img then this is likely the cause: it got truncated somewhere in the middle of the URL.
According to http://syslinux.zytor.com/archives/2005-February/004816.html all newer kernels should be able to accept longer append lines if configured/compiled to do that. As they do use boot protocol 2.02+ which apparently allows this length. But either the pxeboot code or the syslinux kernel or both on the RH/CentOS installations is not prepared to handle that.
14/Oct/2007 @ 22:55
Comment from: David Stockton [Visitor] Email
Just done a CentOS 4.4 Server CD to CentOS 5 remote vnc installation using this method and it worked like a charm.

Thanks!
21/Feb/2008 @ 12:13
Comment from: General Failure [Visitor] Email
Just finished a fresh install of CentOS5 over the internet using your method and worked absolutely brilliantly!!

You are a *. Saved me several hours of travel to fix the server. Superb instrcutions.
02/Apr/2008 @ 17:08
Comment from: Bruno Klaus [Visitor] Email
What a great idea! It works perfectly for me (upgrade of C4.4 to C5.1)
One question: is it possible to make this completely unattendet?

If we stage the machine inhouse, we use pxe and kickstart.cfg files, s the install process is fully automated. It would be very nice, if this is also remote possible.

Have I to put the ks.cfg file also in /boot?

Thanks for this excellent guide!

regards, Bruno
30/Apr/2008 @ 12:57
Comment from: Karanbir Singh [Member] Email · http://www.karan.org/
Bruno, when you setup your remote install process - you can specify a kickstart over a http url in the comment line, so just add something like this :

ks=http://somewhere.com/ks.cfg

and it will run with that kickstart. Ofcourse, you need to make sure that the ks.cfg works perfectly with no user intervention required :D
30/Apr/2008 @ 14:54
Comment from: Bruno Klaus [Visitor] Email
Thanks for your quick replay.
Yes, it works! You safed me hours with this...

I will include you in my prayers!

regards, Bruno
30/Apr/2008 @ 15:27
Comment from: Charles [Visitor] Email
Greetings,
The kernel argument limitation is in lilo. You can get around it by upgrading to grub before doing the installation.

Another useful nugget of information: to avoid problems with device re-ordering, you can specify a MAC address in the ksdevice argument (at least as of the RHEL4 pxeboot image, not tested with earlier versions).
27/Aug/2008 @ 21:17

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)