In the company where I work, we use diskless workstations. I thought I'd share with you how we do this. We actually use two different setups. One is based on BpBatch, something I found at the University of Geneva. The other is based on a distro called PXES.
Both require a DHCP server and for the client workstation to have the ability to boot off a network card. The network card throws out a DHCP request query. Any DHCP server on the network will reply to this and assign an IP address to the network card.
Additionally, the DHCP server will direct the network card to download an 'boot image'. This boot image gets loaded and the PC/diskless workstation/thin client (what have you) will then boot itself off the boot image. It's really nice when it all works.
The boot image is transferred via a protocol called TFTP. Both BpBatch and PXES each require a different TFTP server. (What can I say? We simply set up another server to run the additional TFTP server)
Once the boot image is transferred to the workstation, what you see happening on the workstation, looks exactly like a normal Linux boot. This can be as stripped down or as fancied up as you like.
Originally, not knowing any better, (...oops! have to go now...aftershocks.) I used a Red Hat 6.1 CD to create the disk image. This was really simple. I just got a spare PC and installed Red Hat 6.1 straight from the CD just like a normal install. Then, I created a zipped image file using the BpBatch's MrZip utility. This allowed me to download and uninstall the Linux image file onto any PC. But this wasn't what I really wanted to do. I wanted a pure diskless boot, without affecting the local hard drive at all.
Eventually, I realised that I needed to set up a 'fake' directory structure on the server, which would be exported via NFS to the workstation. Through a lot of trial and error, I ended up with /tftpboot/remotes into which I created a sub-directory for each workstation, containing the usual /boot, /etc, /bin ... directory structure. When I finally got it right, I made a tarball of this directory so I wouldn't have to do this in future.
Over time, I learned that there were certain files that needed to be changed for each workstation. I wrote a script to edit these files. Basically, since each workstation has a different hostname/IP address combination, these files need to know the hostname/IP address for the diskless workstation to work properly.
Some of our PCs are Pentium 166's with 32MB RAM. This setup works well for them, so we continue to use the old Red Hat 6.1 configuration for them. But I came across a really slick setup called PXES. This was a project by a guy called Diego Torres Milano. It seems to have been taken over by another company now and it works differently now, but at that time, I downloaded his CD.
His project was meant to work off a CD, but I modified it so it would work over a DHCP server, though it doesn't use NFS. Diego seems to create a filesystem in RAM and he boots off that instead. So it will not work for machines with 32MB RAM.
To summarise
1. NIC sends DHCP request
2. DHCP returns IP address to workstation
3. DHCP server sends IP address of TFTP server
4. TFTP server sends boot file to workstation
5. workstation loads boot file into memory and boots from it
6. Linux kernel mounts its filesystems from NFS/or RAM disk
7. Linux kernel loads either X-window login screen or rdesktop to Windows terminal server
My /etc/dhcpd.conf files looks like :-
subnet 192.168.0.0 netmask 255.255.255.0
{
use-host-decl-names on;
filename "/tftpboot/bpbatch.P";
range 192.168.0.70 192.168.0.90;
host ingram {
hardware ethernet 00:c0:4f:92:4a:58;
fixed-address 192.168.0.128;
option host-name "ingram";
option vendor-encapsulated-options "gn166";
}
}
This defines an IP address (192.168.0.128) for a PC with a NIC MAC address = 00:c0:4f:92:4a:58 and gives it the hostname 'ingram'.
The 'boot file' loaded by the workstation is /tftpboot/bpbatch.P, which is actually a command interpreter. This is nice because it allows me to build scripts. The boot script looks like :-
if "${BOOTP-Host-Name}" == "ingram" include "/tftpboot/diskless.bpb"
/tftpboot/diskless.bpb contains :-
set cachenever="ON"
linuxboot "/tftpboot/kernels/remote-boot-kernel"
which, finally, loads that remote-boot-kernel into memory.
Page Information
|
Wiki Information |
Recent PBwiki Blog Posts |