[Home]Debian Etch Server And Diskless LinuxCNC Thin Clients

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Showing revision 55

Contents

1. Preparing a sample client system
1.1. Installing base system
1.2. Installing required packages
1.2.1. NFS client
1.2.2. SSH server
1.3. Saving the client system
2. Preparing the server system
2.1. Installing DNS server
2.2. Installing DHCP server
2.3. Installing TFTP server
2.4. Installing NFS Server
2.5. Installing SYSLINUX
2.6. Restarting deamons
2.7. Configuring the clients' filesystems
2.7.1. Creating the first client's filesystem
2.7.2. Creating the other clients' filesystems
3. Using the client machines
3.1. Booting from network
3.1.1. Method 1: PXE-capable BIOS
3.1.2. Method 2: Thinstation Universal Boot Floppy
3.2. Running EMC2

This page describes how to prepare a system with a Debian Etch server and many diskless EMC2 thin clients. Client machines have no harddisk and they use server's harddisk to store and read files. But they use their own RAM and CPU power to run EMC2.

1. Preparing a sample client system

Use server machine to do the followings.

1.1. Installing base system

Prepare a system which can run EMC2 and AXIS.
See Debian Etch Compile LinuxCNC for more information.

1.2. Installing required packages

1.2.1. NFS client

NFS client allows diskless EMC2 clients to access and use the server's disk.
su -
apt-get install portmap nfs-common

Because of dependencies the following packages will be installed too:

 libevent1 libgssapi2 libnfsidmap2 librpcsecgss3 ucf

1.2.2. SSH server

SSH server allows you to remotely control the diskless EMC2 client machines.
apt-get install openssh-server

1.3. Saving the client system

apt-get clean
cd /
tar czf root.tar.gz \
        bin/ \
        boot/ \
        cdrom \
        dev/ \
        etc/ \
        home/ \
        initrd/ \
        initrd.img \
        lib/ \
        media/ \
        mnt/ \
        opt/ \
        root/ \
        sbin/ \
        srv/ \
        tmp/ \
        usr/ \
        var/ \
        vmlinuz

2. Preparing the server system

2.1. Installing DNS server

apt-get install bind9

2.2. Installing DHCP server

DHCP server assigns IP addresses to the diskless EMC2 clients.
It's assumed that:
 * The IP address of Debian Etch server is 192.168.0.1
 * Gateway address is 192.168.0.254
 * MAC address of 1st diskless client machine is 08:03:2b:4c:49:33
 * MAC address of 2nd diskless client machine is 08:03:2b:4c:49:34
 * MAC address of 3rd diskless client machine is 08:03:2b:4c:49:35

To install DHCP server
apt-get install dhcp3-server dhcp3-common

/etc/dhcp3/dhcpd.conf
ddns-update-style none;
option domain-name "domain.loc";
option domain-name-servers 192.168.0.1;

default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {
	option broadcast-address 192.168.0.255;
	option routers 192.168.0.254;
	next-server 192.168.0.1;
	filename "pxelinux.0";

	host client_01 {
		hardware ethernet 08:03:2b:4c:49:33;
		fixed-address 192.168.0.11;
	}

	host client_02 {
		hardware ethernet 08:03:2b:4c:49:34;
		fixed-address 192.168.0.12;
	}

	host client_03 {
		hardware ethernet 08:03:2b:4c:49:35;
		fixed-address 192.168.0.13;
	}
}


Change INTERFACES in /etc/default/dhcp3-server
INTERFACES="eth0"

2.3. Installing TFTP server

TFTP server will transfer the initial files to the diskless EMC2 clients.

apt-get install tftpd-hpa
cd /var/lib/tftpboot

mkdir client_01
mkdir client_01/nfsroot
cp /boot/vmlinuz-2.6.17-rtai client_01/
cp /boot/initrd.img-2.6.17-rtai client_01/

mkdir client_02
mkdir client_02/nfsroot
cp /boot/vmlinuz-2.6.17-rtai client_02/
cp /boot/initrd.img-2.6.17-rtai client_02/

mkdir client_03
mkdir client_03/nfsroot
cp /boot/vmlinuz-2.6.17-rtai client_03/
cp /boot/initrd.img-2.6.17-rtai client_03/

Change RUN_DAEMON in /etc/default/tftpd-hpa
RUN_DAEMON="yes"

2.4. Installing NFS Server

NFS server allows the diskless EMC2 client machines to mount a disk partition on the Debian Etch server. In this way, the diskless clients can run without a local harddisk.
apt-get install nfs-kernel-server
touch /etc/modprobe.d/lockd

Change STATDOPTS in /etc/default/nfs-common
STATDOPTS="--port 32765 --outgoing-port 32766"

Change RPCMOUNTDOPTS in /etc/default/nfs-kernel-server
RPCMOUNTDOPTS="-p 32767"

/etc/modprobe.d/lockd
options lockd nlm_udpport=32764 nlm_tcpport=32764

Add following lines to /etc/exports
/var/lib/tftpboot/client_01/nfsroot	192.168.0.11(rw,sync,no_root_squash,subtree_check)
/var/lib/tftpboot/client_02/nfsroot	192.168.0.12(rw,sync,no_root_squash,subtree_check)
/var/lib/tftpboot/client_03/nfsroot	192.168.0.13(rw,sync,no_root_squash,subtree_check)

2.5. Installing SYSLINUX

SYSLINUX is used as a PXE bootloader during network boots.
We'll create a config file for each clients in /var/lib/tftpboot/pxelinux.cfg/ directory.
The config file's name will be 01-MAC_address. Don't forget to write 01- before MAC address.

apt-get install syslinux
cd /var/lib/tftpboot
touch pxelinux.txt
cp /usr/lib/syslinux/pxelinux.0 .
mkdir pxelinux.cfg
cd pxelinux.cfg
touch 01-08:03:2b:4c:49:33
touch 01-08:03:2b:4c:49:34
touch 01-08:03:2b:4c:49:35

/var/lib/tftpboot/pxelinux.cfg/01-08:03:2b:4c:49:33
DISPLAY pxelinux.txt
DEFAULT EMC2

LABEL EMC2
KERNEL client_01/vmlinuz-2.6.17-rtai
APPEND initrd=client_01/initrd.img-2.6.17-rtai root=/dev/nfs nfsroot=192.168.0.1:/var/lib/tftpboot/client_01/nfsroot nfsopts="hard,intr,rsize=8192,wsize=8192" ip=dhcp vga=normal ramdisk_size=10240 pnpbios=off rw --

LABEL local
localboot 0

PROMPT 1
TIMEOUT 50

/var/lib/tftpboot/pxelinux.cfg/01-08:03:2b:4c:49:34
DISPLAY pxelinux.txt
DEFAULT EMC2

LABEL EMC2
KERNEL client_02/vmlinuz-2.6.17-rtai
APPEND initrd=client_02/initrd.img-2.6.17-rtai root=/dev/nfs nfsroot=192.168.0.1:/var/lib/tftpboot/client_02/nfsroot nfsopts="hard,intr,rsize=8192,wsize=8192" ip=dhcp vga=normal ramdisk_size=10240 pnpbios=off rw --

LABEL local
localboot 0

PROMPT 1
TIMEOUT 50

/var/lib/tftpboot/pxelinux.cfg/01-08:03:2b:4c:49:35
DISPLAY pxelinux.txt
DEFAULT EMC2

LABEL EMC2
KERNEL client_03/vmlinuz-2.6.17-rtai
APPEND initrd=client_03/initrd.img-2.6.17-rtai root=/dev/nfs nfsroot=192.168.0.1:/var/lib/tftpboot/client_03/nfsroot nfsopts="hard,intr,rsize=8192,wsize=8192" ip=dhcp vga=normal ramdisk_size=10240 pnpbios=off rw --

LABEL local
localboot 0

PROMPT 1
TIMEOUT 50

/var/lib/tftpboot/pxelinux.txt
Boot Menu
---------

EMC2     to start diskless EMC2 client
local    to boot from local harddisk

2.6. Restarting deamons

/etc/init.d/dhcp3-server restart
/etc/init.d/tftpd-hpa restart
/etc/init.d/portmap restart
/etc/init.d/nfs-common restart
/etc/init.d/nfs-kernel-server restart

2.7. Configuring the clients' filesystems

2.7.1. Creating the first client's filesystem

cd /var/lib/tftpboot/client_01/nfsroot
tar zxf /root.tar.gz
mkdir proc
mkdir sys

Change client's hostname in /var/lib/tftpboot/client_01/nfsroot/etc/hostname
client_01

/var/lib/tftpboot/client_01/nfsroot/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
iface eth0 inet dhcp

So, the client machine can get its IP from the DHCP server.
Don't forget to comment "allow-hotplug eth0" or "auto eth0" line.
Otherwise, the client's network connection will lost at the boot time.

Remove all lines from /var/lib/tftpboot/client_01/nfsroot/etc/fstab and add the followings
proc            /proc           proc    defaults        0       0
/dev/nfs        /               nfs     defaults        0       0
none            /tmp            tmpfs   defaults        0       0
none            /var/tmp        tmpfs   defaults        0       0
none            /var/run        tmpfs   defaults        0       0
none            /var/lock       tmpfs   defaults        0       0

2.7.2. Creating the other clients' filesystems

Repeat the same things for each clients.

3. Using the client machines

3.1. Booting from network

3.1.1. Method 1: PXE-capable BIOS

If your client machine has a PXE-capable BIOS, modify its BIOS settings to boot from network and reboot.

3.1.2. Method 2: Thinstation Universal Boot Floppy

Thinstation is a thin client Linux distro and it allows your client machine to boot from network with a Universal Boot Floppy.
Download BootDisk522b.zip from ThinStation Download page.
Insert a floppy disk to the driver.

cd
apt-get install unzip
wget http://downloads.sourceforge.net/thinstation/BootDisk522b.zip?modtime=1070186918&big_mirror=1
unzip BootDisk522b.zip
dd if=ebnet522.dsk of=/dev/fd0

Use this floppy disk to boot from network on diskless EMC2 client machines.

3.2. Running EMC2

Boot your diskless EMC2 client machine and start to use it.

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions | View current revision
Edited February 5, 2007 3:27 pm by Acemi (diff)
Search:
Published under a Creative Commons License