Debian_Etch_Server_And_Diskless_LinuxCNC_Thin_Clients - rmu75/linuxcnc-wiki GitHub Wiki
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.
Use server machine to do the followings.
Prepare a system which can run EMC2 and AXIS.
See Debian Etch Compile LinuxCNC for more information.
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
SSH server allows you to remotely control the diskless EMC2 client machines.
apt-get install openssh-server |
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 |
apt-get install bind9 |
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; |
Change INTERFACES in /etc/default/dhcp3-server
INTERFACES="eth0" |
TFTP server will transfer the initial files to the diskless EMC2 clients.
apt-get install tftpd-hpa cd /var/lib/tftpboot |
Change RUN_DAEMON in /etc/default/tftpd-hpa
RUN_DAEMON="yes" |
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) |
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 |
/var/lib/tftpboot/pxelinux.cfg/01-08:03:2b:4c:49:34
DISPLAY pxelinux.txt DEFAULT EMC2 |
/var/lib/tftpboot/pxelinux.cfg/01-08:03:2b:4c:49:35
DISPLAY pxelinux.txt DEFAULT EMC2 |
/var/lib/tftpboot/pxelinux.txt
Boot Menu --------- |
/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 |
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 |
/var/lib/tftpboot/client01/nfsroot/etc/network/interfaces
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 |
Repeat the same things for each clients.
If your client machine has a PXE-capable BIOS, modify its BIOS settings to boot from network and reboot.
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.
Boot your diskless EMC2 client machine and start to use it.