Network Install

From openSUSE

Contents

Performing a Network-only Install

Sometimes it is necessary to upgrade a machine that is only reachable over the network. In SUSE Linux you have several possibilities to remotely run the installation program. These are:

  • ssh
  • VNC
  • serial console

I just want to outline here how to install with ssh. VNC is similar, and for serial console things are even easier. This tip is intended as a hint on how to get things done, not as an in-depth reference.

Manual Preparation

Get the needed installation files

What you need for a network install is to boot the installation kernel as well as the installation initrd on the remote computer. At the same time, you need to know about the IP-address that the computer will have. Lets suppose that you have a fixed IP-address. If you use dhcp, omit the network definitions and use the IP-address you get from your dhcp server.

First, copy the kernel image and installation initrd to your /boot directory:

cd /tmp
wget -O vmlinuz.install ftp://<path to openSUSE>/boot/loader/linux
wget -O initrd.install ftp://<path to openSUSE>/boot/loader/initrd
cp vmlinuz.install /boot/vmlinuz.install
cp initrd.install /boot/initrd.install

Example for SUSE Linux 10.0 w/mirrors.kernel.org

cd /tmp
wget http://mirrors.kernel.org/opensuse/distribution/SL-10.0-OSS/inst-source/boot/loader/linux
wget http://mirrors.kernel.org/opensuse/distribution/SL-10.0-OSS/inst-source/boot/loader/initrd
cp linux /boot/vmlinuz.install
cp initrd /boot/initrd.install

Example for SUSE Linux 10.1 w/mirrors.kernel.org

cd /tmp
wget http://mirrors.kernel.org/opensuse/distribution/SL-10.1/inst-source/boot/i386/loader/linux
wget http://mirrors.kernel.org/opensuse/distribution/SL-10.1/inst-source/boot/i386/loader/initrd
cp linux /boot/vmlinuz.install
cp initrd /boot/initrd.install

Example for openSUSE 10.2 w/mirrors.kernel.org

cd /tmp
wget http://mirrors.kernel.org/opensuse/distribution/10.2/repo/oss/boot/i386/loader/linux
wget http://mirrors.kernel.org/opensuse/distribution/10.2/repo/oss/boot/i386/loader/initrd
cp linux /boot/vmlinuz.install
cp initrd /boot/initrd.install

Example for latest development code w/mirrors.kernel.org & i386

cd /tmp
wget http://mirrors.kernel.org/opensuse/distribution/SL-OSS-factory/inst-source/boot/i386/loader/linux
wget http://mirrors.kernel.org/opensuse/distribution/SL-OSS-factory/inst-source/boot/i386/loader/initrd
cp linux /boot/vmlinuz.install
cp initrd /boot/initrd.install

Configure GRUB

Next, prepare your grub configuration to boot these images. If the ip adress of your computer is 192.168.10.10, the gateway to the internet is 192.168.10.1 and your root (/) partition is /dev/hda1, add a section like the following to /boot/grub/menu.lst :

title Boot -- SUSE LINUX 10.1
   root (hd0,0)
   kernel /boot/vmlinuz.install noapic usessh=1 sshpassword="12345678" install=ftp://<path to openSUSE> hostip=192.168.10.10 netmask=255.255.255.0 gateway=192.168.10.1 nameserver=192.168.10.1
   initrd /boot/initrd.install
NOTE 
the password must be at least 8 characters long.

Note that you must enter the IP-address in the path to SUSE Linux instead of the name if you do not provide a nameserver. Then make this 1st entry the default by changing menu.lst at the line

default 0

to reflect the section number of your entry.

NOTE 
if you want to boot to another section temporarily, do not change the default. Instead use the command grubonce 0, where 0 is the number of your new section.

After doing this, do a reboot.

Example for latest development code w/one of the mirrors.kernel.org sites

title Boot -- SUSE LINUX DEVEL INSTALL
   root (hd0,4)
   kernel /boot/vmlinuz.install usessh=1 sshpassword="12345678" install=http://204.152.191.7/opensuse/distribution/SL-OSS-factory/inst-source hostip=192.139.88.209 netmask=255.255.255.0 gateway=192.139.88.254 nameserver=192.139.88.1
   initrd /boot/initrd.install

Example for SUSE Linux 10.0 from mirrors.kernel.org

title Boot -- SUSE LINUX 10.0
   root (hd0,0)
   kernel /boot/vmlinuz.install noapic usessh=1 sshpassword="12345645" install=http://mirrors.kernel.org/opensuse/distribution/SL-10.0-OSS/inst-source hostip=192.168.81.242 netmask=255.255.255.0 gateway=192.168.81.254 nameserver=192.168.81.1
   initrd /boot/initrd.install

Example for SUSE Linux 10.1 from mirrors.kernel.org

title Boot -- SUSE LINUX 10.1
   root (hd0,0)
   kernel /boot/vmlinuz.install noapic usessh=1 sshpassword="12345645" install=http://mirrors.kernel.org/opensuse/distribution/SL-10.1/inst-source hostip=192.168.81.242 netmask=255.255.255.0 gateway=192.168.81.254 nameserver=192.168.81.1
   initrd /boot/initrd.install

Example for openSUSE 10.2 from mirrors.kernel.org

title Boot -- openSUSE 10.2
   root (hd0,0)
   kernel /boot/vmlinuz.install noapic usessh=1 sshpassword="12345645" install=http://mirrors.kernel.org/opensuse/distribution/10.2/repo/oss/ hostip=192.168.81.242 netmask=255.255.255.0 gateway=192.168.81.254 nameserver=192.168.81.1
   initrd /boot/initrd.install

Preparation with a Script

Downloading kernel and initrd as well as modifying the grub config can mostly be automated with the setupgrubfornfsinstall script.

Start the Installation

The computer will start again after rebooting, but this time booting your installation image instead of the installed system. To reach the installation image, do a ssh to this system:

ssh -X root@192.168.10.10

and enter the password that was given in sshpassword (in the example above, this is "12345645", as 1-8 would be to obvious to phishers;) ). All you have to do now is start yast (or yast2 for graphical installation), and proceed as in a normal installation.

NOTE 
During installation if you're disconnected before you have a chance to entering the root password, then reconnect after a few minutes and enter the given installation password that was set in the grub menu.lst file. After that you have to run /usr/lib/YaST2/startup/YaST2.ssh to continue the installation.

More Information

The options that may be used at the kernel command line are summarized in either /usr/share/doc/packages/autoyast2/html/appendix.linuxrc.html or /usr/share/doc/packages/linuxrc/linuxrc.html. Instead of using a colon (:) to separate the name and values (as used in a /info file), use an equal sign (=) when adding those options in the GRUB menu to the kernel command line. linuxrc always tries to find out as much information as possible about the computer, so if you don't provide network connection information, it will try to use dhcp to setup its network.