If you would like to do a fresh install of an operating system or upgrade a linux distribution, try the following. Basically we are going to install PXE images in grub and get the server to start a VNC connection to your PC on boot so that you can control it.
The following works with CentOS (and probably other Linux distributions)
Step 1: You need the PXE boot image for your OS. For Centos 5, you can get it from
http://mirror.centos.org/centos/5/os/i386/images/pxeboot/. Download this into the /boot folder on the system you wish to upgrade
Step 2: Modify Grub to use the initrd.img as initrd and vlinuz as your kernel image. If the existing grub entries have a /boot/ then your new entries should also point to the files with /boot/. If the current entries just start with /vmlinuz-xxx then set the new entries accordingly.
Step 3: The kernel line in grub should have the following additional entries
vnc vncconnect=xx.xx.xx.xx ip=xx.xx.xx.xx netmask=xx.xx.xx.xx gateway=xx.xx.xx.xx dns=xx.xx.xx.xx headless ksdevice=eth0 method=http://mirror.centos.org/centos/5/os/i386/ lang=en_GB keymap=uk
where vncconnect=xx.xx.xx.xx is the IP the server should connect to when it boots up. i.e. this is your machine. If you are behind NAT please make sure that you give the public IP address for your router/modem here and also ensure your router or modem is set to forward port 5500 through to the PC running VNC Viewer in Listen mode.
IP =xx.xx.xx.xx is the ip address that the server should assume once booted. If you have DHCP available on the server LAN, you can just put in DHCP and ignore the rest of the network parameters
netmask, gateway and dns should be correct or else the system won't have a chance if you are statically assigning IP addresses.
And that's it..reboot the server and wait for the VNC viewer on your PC to pop up. Make 100% sure that the firewall is open for 5500 and that VNC is running in VNC Viewer Listen mode.
Couple of extra things to note:
1. Have a backup plan. Grub does have the facility to fail over to the second option. May be worth setting that up.
2. Some OSs have a limit of 255 characters in the kernel line and anything after that is truncated!! So probably worth checking to ensure that the total length of the kernel line in grub is less than 255. I understand that this limit may not be applicable in newer versions of the OS...but you never know.
3. If you require special drivers to activate any parts of your server hardware, then don't bother with this process as it will not work.
4. Depending on your server's download speed it may take several hours to do the install..so be patient. After you initiate the boot, give it about 10 minutes for the VNC to connect up and then it'll walk you through the steps like selection applications, root password etc..but when it starts to download it may appear as if the install has hung..don't worry it's just downloading all the chunks. For me it takes about 50 minutes to start displaying the progress indicator for application installation from the point I finish selecting all the required applications. Its best to just select the base applications. You can always install the rest later.
5. And finally; NO Guarantees..it has always worked from me (about 15 servers all upgraded), but shit may hit the fan next time around. So USE AT OWN RISK!!
I used the tutorial from http://www.karan.org/blog/index.php/2005/06/15/upgrading_to_centos4_over_a_remote_vnc_c
so thanks to the chap who put it all together.
Monday, 7 April 2008
Remote Install Linux
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment