HOWTO Install SUSE Linux Remotely without Physical Access

From Suntel Communications knowledgebase

Jump to: navigation, search

Contents

Gather information about the current server

Firstly, we need to gather all the necessary network configuration information from the currently running installation that we will use when we reinstall it with SUSE. In particular, we need the server's current IP, Netmask, Default Gateway and DNS Resolver. These can be gathered with the following commands:

IP Address and Netmask

ifconfig

Example output:

eth0      Link encap:Ethernet  HWaddr 00:13:72:0A:56:65
          inet addr:64.34.165.250  Bcast:64.34.165.255  Mask:255.255.255.192
          inet6 addr: fe80::213:72ff:fe0a:5665/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20564 errors:2409 dropped:138 overruns:0 frame:13
          TX packets:11392 errors:0 dropped:0 overruns:0 carrier:0
          collisions:2409 txqueuelen:1000
          RX bytes:22441050 (21.4 MiB)  TX bytes:929509 (907.7 KiB)
          Interrupt:177

Default Gateway

route -n

Example output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
64.34.165.192   0.0.0.0         255.255.255.192 U     0      0        0 eth0
0.0.0.0         64.34.165.193   0.0.0.0         UG    0      0        0 eth0

DNS Resolver

cat /etc/resolv.conf

Example output:

domain domain.com
nameserver 64.34.160.92
nameserver 64.34.160.76

Get Installation Kernel

i386

curl -o /boot/linux.install ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/boot/i386/loader/linux
curl -o /boot/initrd.install ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/boot/i386/loader/initrd

x86_64

curl -o /boot/linux.install ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/boot/x86_64/loader/linux
curl -o /boot/initrd.install ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/boot/x86_64/loader/initrd

WARNING: As of 2008-06-27 the x86_64 mirrors for openSUSE 11.0 all seem to have an invalid checksum which causes the install to pause during the initial bootup stage and display a warning to the screen. Until this is fixed you should use a copy of the DVD ISO mounted on loopback on an ftp server you control. (Its also a good idea to check everything with a local test install before doing a remote install!)

Setup Grub

If your existing /boot/grub/menu.lst does not already have it, add the following to the very top to make sure grub will default to the first entry:

default=0

To the bottom, you need to add a new entry pointing to your SUSE installation image. You can use either the SSH or VNC method (or add both if you feel like experimenting). You MUST set the hostip, netmask, gateway and nameserver values to match the network you are installing onto. (The best method is to use netstat -rn, ifconfig and cat /etc/resolv.conf to find out what the existing Linux install is already using).

Note: If you do not have a DNS server available on the network, then make sure to use the IP address instead of hostname for the SUSE mirror you pick!

Machine with Single Disk Partition

If you have /boot on your root partition you need to put the full paths:

title SSH Installation (openSUSE Factory)
       kernel (hd0,1)/boot/linux.install ramdisk_size=65536 install=ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/ hostip=64.34.169.25 netmask=255.255.255.192 gateway=64.34.169.1 usessh=1 sshpassword=somepassword
       initrd (hd0,1)/boot/initrd.install
title VNC Installation (openSUSE Factory)
       kernel (hd0,1)/boot/linux.install ramdisk_size=65536 install=ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/ hostip=64.34.169.25 netmask=255.255.255.192 gateway=64.34.169.1 vnc=1 vncpassword=somepassword
       initrd (hd0,1)/boot/initrd.install

Machine with Separate /boot Partition

If you have a /boot partition it means that all kernel and initrd paths are relative to /boot/

title SSH Installation (openSUSE Factory)
       root (hd0,0)
       kernel /linux.install ramdisk_size=65536 install=ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/ hostip=66.135.41.84 netmask=255.255.255.192 gateway=66.135.41.65 nameserver=64.34.160.92 usessh=1 sshpassword=somepassword
       initrd /initrd.install
title VNC Installation (openSUSE Factory)
       root (hd0,0)
       kernel /linux.install ramdisk_size=65536 install=ftp://mirrors.kernel.org/opensuse/distribution/openSUSE-stable/repo/oss/ hostip=66.135.41.84 netmask=255.255.255.192 gateway=66.135.41.65 nameserver=64.34.160.92 vnc=1 vncpassword=somepassword
       initrd /initrd.install

Select Installation Image for Boot

Standard Method

On a standard CentOS 5 box the currently running kernel will be 0 and your new "install" kernel will be number 1, however if you have upgraded your kernel with yum, or modified the grub config yourself by hand you may have more than one kernel already configured so your install kernel may be number 2 or 3:

Run this at the bash prompt:

grub

When the grub prompt loads do:

savedefault --default=NUMBER_OF_INSTALL_KERNEL --once

For Example

savedefault --default=1 --once

That is called failsafeing. If the SUSE Installation kernel doesn't boot properly for some reason, you just have to reboot the box and you will be back in the kernel you are running now.

Then type quit at the grub prompt to exit it.

SUSE Method

If you upgrading/reinstalling an existing SUSE box then you can select the next kernel to boot from the bash prompt simply by typing:

grubonce 1

Note: You can see a list of available boot targets by typing:

grubonce

Ping Test

We're on the home stretch. On your client desktop (or another machine) start an continuous ping running so you will know when your box comes back up

Linux

Open a console and type

ping yourboxip

Windows

Open a windows cmd window and type

ping -t yourboxip

Reboot (Once) to the Installation Image

Then:

shutdown -r now 

on your linux box, and once the box comes back up, you should be about to login with either VNC or SSH depending on which way you setup grub.

NOTE: Depending on the load on the SUSE mirror you pick, the speed of your network, and the speed of the machine you are installing on, it may take several minutes before you can ping the machine and ten or more minutes before you can log in with SSH or VNC. Don't Panic!

Start Installation

SSH Install

If you picked SSH as the installation type, you can to login with a standard text session by running (Use this unless you are connected to the server you are installing with a 100Mbit or faster network!!):

ssh root@66.135.41.84 -x

Of course, while not recommended unless you have a very fast and low latency network between you and the server you are installing, you can also login with a forwarded X (graphical) session by running:

ssh root@66.135.41.84 -X

Either way, after logging in, you then launch the installation program with:

yast

VNC Install

If you picked VNC as the installation type, all you have to do is login and you will have yast in front of you! You can login by running:

krdc 66.135.41.84:1

WARNING: It is a bad idea (tm) to pick a "minimal" installation if you are using VNC to install. If you do so the install will hang after the first reboot. If you want to do a "minimal" installation, use SSH.

Installation Continued

The machine will reboot after installing the contents of CD1...

SSH Installation

In order to complete the install you need to log in again, and run

/usr/lib/YaST2/startup/YaST2.ssh

VNC Installation

In order to complete the install you need to log in again with VNC and the install will continue.

External Links

Personal tools