Dec 312011

原文(source): How to Remote Install CentOS 6 via VNC - House of Linux

For many reasons sometimes it is necessary to reinstall a linux on a server that is hosted in a remote location such as a Data center. You might want to install a  new version of the Distribution, change the distribution, or you might need to re-partition you hard drive to be able to use LVM for example.

You have three options here:

1 - Go physically to the Datacenter

2 - Pay a datacenter guy to reinstall that for you… :(

3 - Install it Remotely using VNC

I chose the 3rd one since it seems to be the most convenient one. :-)

What do we need?

Network configuration of out server: IP Address, Gateway and DNS

If you have all those 3 informations you are good to go!
1 - Download bootstrap files (Kernel and ramdisk image).

cd /boot
mkdir centos6
cd centos6

Add an entry to the Grub Loader

# vi /boot/grub/menu.lst

## Add the following lines to the end of the file and count how many lines starts with tittle:

title CentOS 6 VNC Installation
        root (hdXXX,0)
        kernel /XXX/centos6/vmlinuz vnc vncpassword=XXX headless ip=XXX netmask= gateway=XXX dns= ksdevice=ethXXX method= lang=en_US keymap=us
        initrd /XXX/centos6/initrd.img

for CentOS 7

title CentOS 7 VNC Installation
        root (hdXXX,0)
        kernel /XXX/centos7/vmlinuz initrd=initrd.img inst.vnc inst.vncpassword=XXX ksdevice=XXX ip=XXX gateway=XXX netmask= nameserver= inst.repo=
        initrd /XXX/centos7/initrd.img

In my case with I had total 3 entries because I am updating a CentOS 5.6 to CentOS 6 and I had a couple update.

If we have 3 title entries there, the 3rd one should be our CentOS 6 installation but Grub starts counting the first one as 0, so our Centos 6 installation is actually 2 for grub.


Here is my menu.lst file:

# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/root
#          initrd /initrd-version.img
title CentOS (2.6.18-238.19.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-238.19.1.el5 ro root=/dev/VolGroup00/root
initrd /initrd-2.6.18-238.19.1.el5.img
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/root
initrd /initrd-2.6.18-194.el5.img
title CentOS 6 VNC Installation
root (hd0,0)
kernel /centos6/vmlinuz vnc vncpassword=houseoflinux headless ip= netmask= gateway= dns= ksdevice=eth0 method= lang=en_US keymap=us
initrd /centos6/initrd.img
Now we set our Grub to boot through our VNC installation only once so In case something goes wrong we can just call the hosting company and ask for a reboot and our server will boot through the default kernel.

# grub

grub> savedefault --default=2 --once
savedefault --default=2 --once
grub> quit

Now we are ready to reboot our machine and start the installation:

# reboot

wait… wait… depending on the hardware you have this might a while….
You can now use your preferred VNC client and start the installation process

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Reload Image