Debian_Etch_Server_And_Diskless_LinuxCNC_Thin_Clients - rmu75/linuxcnc-wiki GitHub Wiki


date: '2007-03-10T14:01:55' title: Debian Etch Server And Diskless LinuxCNC Thin Clients

Contents

toc


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 client01 {
	hardware ethernet 08:03:2b:4c:49:33;
	fixed-address 192.168.0.11;
}

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

host client03 {
	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 client01 mkdir client01/nfsroot cp /boot/vmlinuz-2.6.17-rtai client01/ cp /boot/initrd.img-2.6.17-rtai client01/

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

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


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/client01/nfsroot	192.168.0.11(rw,sync,no_root_squash,subtree_check)
/var/lib/tftpboot/client02/nfsroot	192.168.0.12(rw,sync,no_root_squash,subtree_check)
/var/lib/tftpboot/client03/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 client01/vmlinuz-2.6.17-rtai APPEND initrd=client01/initrd.img-2.6.17-rtai root=/dev/nfs nfsroot=192.168.0.1:/var/lib/tftpboot/client01/nfsroot nfsopts="hard,intr" ip=dhcp vga=normal 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 client02/vmlinuz-2.6.17-rtai APPEND initrd=client02/initrd.img-2.6.17-rtai root=/dev/nfs nfsroot=192.168.0.1:/var/lib/tftpboot/client02/nfsroot nfsopts="hard,intr" ip=dhcp vga=normal 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 client03/vmlinuz-2.6.17-rtai APPEND initrd=client03/initrd.img-2.6.17-rtai root=/dev/nfs nfsroot=192.168.0.1:/var/lib/tftpboot/client03/nfsroot nfsopts="hard,intr" ip=dhcp vga=normal 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/openbsd-inetd 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/client01/nfsroot
tar zxf /root.tar.gz
mkdir proc
mkdir sys

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

client01


/var/lib/tftpboot/client01/nfsroot/etc/hosts

127.0.0.1     localhost
192.168.0.1   server.domain.loc     server
192.168.0.11  client01.domain.loc   client01
192.168.0.12  client02.domain.loc   client02
192.168.0.13  client03.domain.loc   client03

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts


/var/lib/tftpboot/client01/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/client01/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.

⚠️ **GitHub.com Fallback** ⚠️