Upgrading to CentOS4, over a remote vnc connection
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/ }
22 comments
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
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
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 :)
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.
(I use SuSE 9.0 with LILO as boot loader)
Have you ever done that?
Thanks!
I change the boot loader to GRUB before do following this process here.
Very simple :)
method=http://mirror.centos.org/centos/4/os/i386/
being passed to the kernel, but it still prompts on the console. Any ideas?
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
Any Ideas?
P.S. The basic installer does support Intel/Pro 10/100 NIC right?
Thanks for your help,
Ryan
yes, the e100 does work fine afaik.
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.
Thanks!
You are a *. Saved me several hours of travel to fix the server. Superb instrcutions.
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
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
Yes, it works! You safed me hours with this...
I will include you in my prayers!
regards, Bruno
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).
15/Jun/2005 10:35:24 am,