Motivation - Why?
Knoppix comes with a wonderful Terminal Service, which enables you to remotely boot the OS on a diskless client on the network. But doing so meant having to run Knoppix on another dedicated machine, just so that the client can use its terminal service. Since most of the time I would prefer working on my _already_installed_ distro, I decided to duplicate the knoppix terminal service locally.
- You can continue to run your usual distro, while providing the knoppix environment to diskless clients.
- Since the knoppix image is shared from a hard disk (instead from a livecd), the clients will be able to load applications much quicker.
- You save time(=money) from having to set up remote boot manually.
- All the other advantages that come with Remote booting clients (see Network Boot HOWTO)
There arent any! :) unless ofcourse you want to remote boot your favorite Linux distro or you just want to buy a hard disk and install linux the _good_ol_way!
DISCLAIMER: The steps outlined in this document come with no guarantee (or warranty) that it will work, and what ever you do to your system is at your own risk! I hold no responsibility. Blah blah blah... If this makes you uncomfortable stop reading any further!
At the time of writing, I used Knoppix 3.3 with Gentoo Linux 1.4 as the host. I will include some notes for other distros as well.
1. Boot Knoppix off the CDROM
Provided you already got knoppix on to a CD, fire it up and boot the livecd on the host machine you later wish to serve the knoppix image from.
2. Execute the knoppix terminal service.
This can be found in the knoppix services menu or by executing /etc/init.d/ knoppix-terminalserver. Configuring the terminal service is straight forward - just follow the onscreen instructions. Just make sure you include the proper network kernel modules and any other modules needed by the clients.
3. Boot the diskless workstation
If your diskless client is PXE enabled, all you need is to change the bootup sequence to have an option like "Boot from the network" from within the BIOS menu. Otherwise you can get a boot ROM floppy image for your network card from Rom-o-matic. If everything goes well, you should now be able to boot knoppix on the diskless client.
4. Copy knoppix files to the local hard drive
Mount your local hard drive and copy some important files that the terminal service created.
$ knoppix> su
# mount /mnt/hda1
# mkdir /mnt/hda1/root/knoppix
# cp -a /etc/dhcp3/dhcpd.conf /etc/exports /tftpboot /mnt/hda1/root/knoppix
# umount /mnt/hda1
5. Reboot system and load your local Linux distro.
6. Install required services on the host linux.
- DHCP Server
- #emerge dhcp ' -- on gentoo
- #apt-get install dhcp ' -- debian/apt based
- #rpm -Uvh dhcpd*.rpm ' -- RH/rpm based
- TFTP Server
- #emerge tftp-hpa
- #apt-get install tftpd-hpa
- #rpm -Uvh tftpd*.rpm
- NFS Server
- #emerge nfs-utils
- #apt-get install nfs-kernel-server
- #rpm -Uvh nfsd*.rpm
7. Copy the knoppix cd content.
Copy the content of the knoppix CD to the hard drive
# mkdir -p /opt/knoppix
# cp -a /mnt/cdrom/* /opt/knoppix
Since as knoppix boots remotely it looks for the nfs root at /cdrom/ by default, you might as well create a symlink to it.
# cd / && ln -s /opt/knoppix/cdrom .
Otherwise you could pass NFSROOT=/opt/knoppix/cdrom at the prompt before knoppix boots or at the time you configured the terminal service (see step2)
8. Configure Services
- DHCP Server
Copy the content of /root/knoppix/dhcpd.conf to where you should have dhcpd.conf on your distro. Before copying, backup the old file or alternatively modify the existing file to reflect that of /root/knoppix/dhcpd.conf.
# cp /root/knoppix/dhcpd.conf /etc/dhcp/
# /etc/init.d/dhcp start
Copy the content of /root/knoppix/tftproot to where your tftproot resides (usually /tftproot).
# cp /root/knoppix/tftproot/* /tftproot
# /etc/init.d/in.tftpd start -- if standalone
Otherwise modify /etc/xinet.d/*tftpd* or /etc/inetd.conf and enable tftp server. Make sure you have the -s flag to say tftpd should be run in a secure mode.
Put an entry in the /etc/exports file to export the directory you copied the Knoppix cdrom content (for me its /opt/knoppix).
# /etc/init.d/nfs start
If all the required services are up and running, you should now be able to turn on the diskless client and see it boot knoppix over the network. Once everything is successful you might want to either have these services automatically start at boot time or put them into a script that you can call when necessary
# vi /root/start_terminalservice
echo Starting Knoppix terminal service ...
/etc/init.d dhcp restart
#chmod 755 /root/start_terminalservice
Remote X sessions
If your diskless machines are too slow to run applications locally and you prefer a LTSP sort of setup instead, you can just connect to a remote X display manager and run applications off the server, while getting the output on the diskless client.
First enable XDMCP protocol access over the network (becareful you are on a trusted network as this can be a security risk). This requires a change to the DM (Display Manager) config file, depending on which DM you run. Since I am currently GDM (GNome DM), it will be something like....
# vi /etc/X11/gdm/
# Distributions: Ship with this off. It is never a safe thing to leave
# out on the net. Alternatively you can set up /etc/hosts.allow and
# /etc/hosts.deny to only allow say local access.
# /etc/init.d/xdm restart
# killall -HUP gdm-binary --possibly on RH/MDK
Additionally you might also need to enable access to XDMCP ports, should they be blocked by a local firewall rule or TCP wrapper. Once the server is set, then on your diskless knoppix client, press Ctrl+Alt+F2 to get a console and login as root. Then issue...
# X -query 192.168.101.61 :1
where 192.168.101.61 is the remote XDM server we connecting to.
Here is a screenshot of gentoo and knoppix running side by side.
References and Resources
|Buddhika Siddhisena <email@example.com>||Updated : April 13, 2004|
Created : April 13, 2004