Differences between revisions 1 and 15 (spanning 14 versions)
Revision 1 as of 2006-12-12 09:52:51
Size: 2648
Comment:
Revision 15 as of 2012-01-22 15:56:10
Size: 5102
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
  NOTE: this article is currently under heavy development and not yet finished!
Line 5: Line 3:
== Reasons ==
In some conditions it is not possible to install Debian from a CD (as described in ["DebianInstall"] or ["DebianNetworkInstall"]), because the hardware that is needed for installation is not supported by the kernels supplied with the installation CDs. Example: the harddisks, CD-/DVD-Rom device/interface or network cards are not supported.
== Preface ==
Line 8: Line 5:
== Highly experimental and not official supported ==
The state of the method described here is 'WFM' (Works For Me). It is not an official supported way to install Debian.
Installation using network booting must not be confused with [[DebianNetworkInstall]]. In network install, you start with a CD to install a minimal Linux system before you proceed to download further packages over the network. Here, you need no CD at all. You instruct you BIOS boot menu to boot directly from the network.
Line 11: Line 7:
== Howto == To do so, you need a network boot server. As there are no fiducial boot servers out in the wild, you need to setup your own. This is considerably more complicated than installing Debian from CD. Normally, network booting is only used if there is really no way to boot from CD.
Line 13: Line 9:
=== Preconditions ===
For this kind of installation CD1 from the Debian distribution (http://www.debian.org/CD/) is needed - chose the testing one. Download it, burn it.
Also a second computer is needed - should already run Debian.
In the Web, several articles can be found that describe in more or less detail how to setup a network boot server. They all have the same weakness: You are required to execute a long list of instructions without getting any feedback before the very end of the procedure when you try to boot. If it works, fine. If not, debugging will become very very difficult. Therefore in the following we break down the procedure into steps that can be debugged separately.
Line 17: Line 11:
=== Install DHCP ===
On the already installed computer, set up a DHCP server. (Missing: configuration)
== Preconditions ==
Line 20: Line 13:
=== Install TFTP ===
On the already installed computer, set up a tftp server. (Missing: configuration)
The computer you want to install to will be called the Client.
Line 23: Line 15:
=== Configure BIOS ===
On the new to install computer, enter BIOS setup and chose network boot (PXE boot) - sometimes before it is possible to chose network booting only if also some boot rom is enabled.
The computer you install from will be called the Server. We assume that the Server is running Debian.
Line 26: Line 17:
=== Compile Kernel ===
Grab a kernel from ftp://ftp.kernel.org, unpack and configure it for the new computer, compile it. (Note: Do not use modules.) Be sure to add all the device drivers needed for installation. Especially the CD-/DVD-Rom and harddisk interface driver are needed.
To be specific, we assume that the Client and the Server are part of a LAN with the following IP addresses:
  * 192.168.0.1 router
  * 192.168.0.2 the Server
  * 192.168.0.x the Client
You will find out the value of x later.
Line 29: Line 23:
After compiling copy the kernel image to the tftp server directory. (Missing: exact location). Name it {{{pxeboot}}}. The following instructions have been tested with Debian 6.0 (squeeze) in January 2012.
Line 31: Line 25:
=== Install pxelinux.0 ===
Do a {{{ apt-get install syslinux }}}, {{{ cp `dpkg -L syslinux | fgrep pxelinux.0` <tftp location>}}}. (Missing: exact location)
== Change boot menu ==
Line 34: Line 27:
=== Install initrd.gz ===
Mount the CD, copy over the initrd.gz (Missing: exact location) to the tftp directory (Missing: exact location)
Setup the BIOS boot menu of the Client to boot from the network.
Line 37: Line 29:
=== Boot ===
Put the CD in the new computer. Boot the new computer via network. It should get the IP address from the DHCP server and also the pxelinux.0 file from the tftp server. The bootloader prints some lines concering some non existing files which can be ignored and than displays a boot prompt. On the command line enter: {{{pxeboot initrd=initrd.gz}}}.
Reboot. This should produce an output that contains the Client's MAC address.
Then, it will fail with
{{{
  PXE-E53: no boot filename received.
}}}
Line 40: Line 35:
=== Install Debian ===
At this point, all the drivers that are needed to install Debian on the new system are available and the normal installtion procedure can be used to install the whole Debian system to the new computer.
== Set up DHCP server ==

On the Server, we need to set up a DHCP server.

Current best practice seems to be to use the package ''isc-dhcp-server'', which provides a daemon ''dhcpd''.

It's configuration file is ''/etc/dhcp/dhcpd.conf''. Modify this file so that it contains about the following; adapt IP and MAC addresses to your local needs:

{{{
default-lease-time 600;
max-lease-time 7200;

allow booting;
allow bootp;

# in this example, we serve DHCP requests from 192.168.0.(3 to 253)
# and we have a router at 192.168.0.1
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.3 192.168.0.253;
  option broadcast-address 192.168.0.255;
  option routers 192.168.0.1; # our router
  option domain-name-servers 192.168.0.1; # our router, again
}

group {
  next-server 192.168.0.2; # our Server
  host tftpclient {
    hardware ethernet 00:12:34:56:AB:CD; # replace by the MAC of your Client
    filename "pxelinux.0"; # (this we will provide later)
  }
}
}}}

After each modification of the above, restart the DHCP server with
{{{
  /etc/init.d/isc-dhcp-server restart
}}}
Check that it is actually running:
{{{
  ps axu | grep dhcp
}}}


Reboot the Client. On success, it will output the IP addresses of the Server ("DHCP"), of the router ("Gateway") and of itself (192.168.0.x). Then it will hang with a TFTP request, and finally write the error message:
{{{
  PXE-E32: TFTP open timeout
}}}

== Setup a TFTP server ==

Next, we need to set up a TFTP server on the Server.

Again, there are several packages that provide TFTP (trivial FTP, unsafe, to be used in LAN's only). It seems best practice is using the package ''tftpd-hpa''. On installation, a few question are asked. The response to these questions goes into a configuration file, ''/etc/default/tftpd-hpa''. There should be no need to modify the following default contents:

{{{
  TFTP_USERNAME="tftp"
  TFTP_DIRECTORY="/srv/tftp"
  TFTP_ADDRESS="0.0.0.0:69"
  TFTP_OPTIONS="--secure"
}}}

Ignore older Web sites that instruct you to insert something like 'RUN_DAEMON="yes"'.

After each modification of the above configuration file, restart the TFTP server with
{{{
  /etc/init.d/tftpd-hda
}}}

Initially, this will fail with a message like
{{{
  Restarting HPA's tftpd: in.tftpd/srv/tftp missing, aborting.
}}}

Therefore, as root, create the directory ''/srv/tftp''. Restart the TFTP daemon. Check that it is actually running:
{{{
  ps axu | grep tftp
}}}

Reboot the Client. It will still produce the same error message as above,
{{{
  PXE-E32: TFTP open timeout
}}}
which is quite annoying since it makes debugging unnecessarily difficult (who is going to submit a bug report?).

== Provide the boot image ==

Download ''netboot/netboot.tar.gz'' from a Debian mirror, and unpack it to ''/srv/tftp'', which should now contain
{{{
  debian-installer/
  pxelinux.0@
  pxelinux.cfg@
  version.info
}}}
It may be necessary to ''chmod -R a+w *'' to make all files in this directory readable for the TFTP daemon.

Restart the TFTP daemon, then reboot the Client. You should get to a Debian install screen.

Installing Debian using network booting

Preface

Installation using network booting must not be confused with DebianNetworkInstall. In network install, you start with a CD to install a minimal Linux system before you proceed to download further packages over the network. Here, you need no CD at all. You instruct you BIOS boot menu to boot directly from the network.

To do so, you need a network boot server. As there are no fiducial boot servers out in the wild, you need to setup your own. This is considerably more complicated than installing Debian from CD. Normally, network booting is only used if there is really no way to boot from CD.

In the Web, several articles can be found that describe in more or less detail how to setup a network boot server. They all have the same weakness: You are required to execute a long list of instructions without getting any feedback before the very end of the procedure when you try to boot. If it works, fine. If not, debugging will become very very difficult. Therefore in the following we break down the procedure into steps that can be debugged separately.

Preconditions

The computer you want to install to will be called the Client.

The computer you install from will be called the Server. We assume that the Server is running Debian.

To be specific, we assume that the Client and the Server are part of a LAN with the following IP addresses:

  • 192.168.0.1 router
  • 192.168.0.2 the Server
  • 192.168.0.x the Client

You will find out the value of x later.

The following instructions have been tested with Debian 6.0 (squeeze) in January 2012.

Change boot menu

Setup the BIOS boot menu of the Client to boot from the network.

Reboot. This should produce an output that contains the Client's MAC address. Then, it will fail with

  PXE-E53: no boot filename received.

Set up DHCP server

On the Server, we need to set up a DHCP server.

Current best practice seems to be to use the package isc-dhcp-server, which provides a daemon dhcpd.

It's configuration file is /etc/dhcp/dhcpd.conf. Modify this file so that it contains about the following; adapt IP and MAC addresses to your local needs:

default-lease-time 600;
max-lease-time 7200;

allow booting;
allow bootp;

# in this example, we serve DHCP requests from 192.168.0.(3 to 253)
# and we have a router at 192.168.0.1
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.3 192.168.0.253;
  option broadcast-address 192.168.0.255;
  option routers 192.168.0.1;             # our router
  option domain-name-servers 192.168.0.1; # our router, again
}

group {
  next-server 192.168.0.2;                # our Server
  host tftpclient {
    hardware ethernet  00:12:34:56:AB:CD; # replace by the MAC of your Client
    filename "pxelinux.0"; # (this we will provide later)
  }
}

After each modification of the above, restart the DHCP server with

  /etc/init.d/isc-dhcp-server restart

Check that it is actually running:

  ps axu | grep dhcp

Reboot the Client. On success, it will output the IP addresses of the Server ("DHCP"), of the router ("Gateway") and of itself (192.168.0.x). Then it will hang with a TFTP request, and finally write the error message:

  PXE-E32: TFTP open timeout

Setup a TFTP server

Next, we need to set up a TFTP server on the Server.

Again, there are several packages that provide TFTP (trivial FTP, unsafe, to be used in LAN's only). It seems best practice is using the package tftpd-hpa. On installation, a few question are asked. The response to these questions goes into a configuration file, /etc/default/tftpd-hpa. There should be no need to modify the following default contents:

  TFTP_USERNAME="tftp"
  TFTP_DIRECTORY="/srv/tftp"
  TFTP_ADDRESS="0.0.0.0:69"
  TFTP_OPTIONS="--secure"

Ignore older Web sites that instruct you to insert something like 'RUN_DAEMON="yes"'.

After each modification of the above configuration file, restart the TFTP server with

  /etc/init.d/tftpd-hda

Initially, this will fail with a message like

  Restarting HPA's tftpd: in.tftpd/srv/tftp missing, aborting.

Therefore, as root, create the directory /srv/tftp. Restart the TFTP daemon. Check that it is actually running:

  ps axu | grep tftp

Reboot the Client. It will still produce the same error message as above,

  PXE-E32: TFTP open timeout

which is quite annoying since it makes debugging unnecessarily difficult (who is going to submit a bug report?).

Provide the boot image

Download netboot/netboot.tar.gz from a Debian mirror, and unpack it to /srv/tftp, which should now contain

  debian-installer/
  pxelinux.0@
  pxelinux.cfg@
  version.info

It may be necessary to chmod -R a+w * to make all files in this directory readable for the TFTP daemon.

Restart the TFTP daemon, then reboot the Client. You should get to a Debian install screen.