License

Copyright (C) 2008-2017 Oliver Bohlen.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

A copy of the license is included in the section entitled "GNU Free Documentation License".

Introduction

This documentation comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

Howto: Server for thinclients for Gentoo Linux

This part describes how I boot client-PCs over the network. For this I use PXE, DHCP, TFTP and NFS.
For UEFI Grub do

cd /gtc/pxe ; grub-mkstandalone -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi --fonts="unicode" -o bootx64.efi boot/grub/grub.cfg

If you want to use this solution you need the following howto(s) finished:

Required software

The required software has to be installed with the following command(s):
emerge net-fs/nfs-utils
emerge sys-boot/syslinux
emerge net-ftp/tftp-hpa

Changes in /etc/conf.d/in.tftpd

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /etc/conf.d/in.tftpd

Changed on 04.04.10
Issued by olli
Beginning line 15

Path for PXE files and necessary bootoptions for tftpd.


Before change
INTFTPD_OPTS="-R 4096:32767 -s ${INTFTPD_PATH}"
After change
INTFTPD_PATH="/gtc/pxe"
#INTFTPD_OPTS="-R 4096:32767 -s ${INTFTPD_PATH} --refuse blksize --refuse tsize --refuse blksize2 --user nobody -vvv"
INTFTPD_OPTS="-p -u nobody -s ${INTFTPD_PATH} -vvv"

Changes in /etc/conf.d/nfs

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /etc/conf.d/nfs

Changed on 10.03.10
Issued by olli
Beginning line 8

Thist starts the rpc.idmapd for UID/GID Mapping on NFSv4. It hast to be startet at the clientside too. If this Service is not started all UIDs/GIDs are mapped to ID 4294967294. The Configurationfile /etc/idmapd.conf should be the same on Client and Server


Before change
NFS_NEEDED_SERVICES=""
After change
NFS_NEEDED_SERVICES="rpc.idmapd"

Changed on 23.12.08
Issued by olli
Beginning line 16

Allow a maximum of 20 Clients at the same time on your NFS Server


Before change
#OPTS_RPC_NFSD="8"
After change
OPTS_RPC_NFSD="20"

Changed on 23.12.08
Issued by olli
Beginning line 24

The rpc mountd should listen on port 32767 (needed for some firewall settings).


Before change
#OPTS_RPC_MOUNTD=""
After change
OPTS_RPC_MOUNTD="-p 32767"

Changed on 23.12.08
Issued by olli
Beginning line 32

The rpc statd should listen on port 32765 and send outgoing connections over port 32766 (needed for some firewall settings).


Before change
#OPTS_RPC_STATD=""
After change
OPTS_RPC_STATD="-p 32765 -o 32766"

Changes in /etc/cron.daily/pxe.cron

File permissions:
Owner: root
Group: root
Permissions: -rwx------

Click here for a download of the complete file: /etc/cron.daily/pxe.cron

Changed on 13.01.09
Issued by olli
Beginning line 1

PXE Update workaround. If syslinux is updated the new pxelinux.0 or/and menu.c32 file are stored in /usr/share/syslinux. For our use this files have to stay in /srv/thinclient/pxe. So once a day the file is copied to the correct place. A symlink (because of TFTP) or hardlink (because of different filesystems) doesn't work for me. I didn't find a better solution. If you have one let me know ;-)

mkdir -p /gtc/pxe
cp -p /usr/share/syslinux/pxelinux.0 /gtc/pxe/
cp -p /usr/share/syslinux/menu.c32 /gtc/pxe/
cp -p /usr/share/syslinux/ldlinux.c32 /gtc/pxe
cp -p /usr/share/syslinux/libutil.c32 /gtc/pxe

Changes in /etc/dhcp/dhcpd.conf

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /etc/dhcp/dhcpd.conf

Changed on 06.09.08
Issued by olli
Beginning line 22

This is for starting the syslinux (pxelinux) bootmanager for thinclients booting over pxe.

next-server my.lan.ip.addr;
option architecture-type code 93 = unsigned integer 16;
if option architecture-type = 00:09 {
filename "bootx64.efi";
} elsif option architecture-type = 00:07 {
 filename "bootx64.efi";
} else {
filename "pxelinux.0";
}

Changes in /etc/exports

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /etc/exports

Changed on 23.12.08
Issued by olli
Beginning line 2

NFS4-configuration for test and production environment of the Thinclients.

/gtc    my.lan.network.ip/XXX.XXX.XXX.XXX(ro,fsid=0,no_subtree_check,async,no_root_squash,ro,insecure)
/gtc/test	my.lan.network.ip/XXX.XXX.XXX.XXX(no_subtree_check,async,ro,no_root_squash,insecure)
/gtc/stable	my.lan.network.ip/XXX.XXX.XXX.XXX(no_subtree_check,async,ro,no_root_squash,insecure,nohide)

Changes in /etc/fstab

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /etc/fstab

Changed on 29.06.09
Issued by olli
Beginning line 33

This mounts /proc for the test-thinclient environment. This is needed for some emerge-Operations. Further the Stable-thinclient-Root is bind-mounted to the main nfs4 export

/gtc/test/usr/portage	/usr/portage	none	bind,nofail		0 0
proc  	          /gtc/test/proc         proc    defaults,nofail        0 0

Changes in /gtc/pxe/pxelinux.cfg/default

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /gtc/pxe/pxelinux.cfg/default

Changed on 06.09.08
Issued by olli
Beginning line 1

Boot menu configuration for PXE boots.

default menu.c32
prompt 0
	    
menu title GTC-PXELinux Boot Menu
NOESCAPE 1
ALLOWOPTIONS 1
MENU AUTOBOOT Starting Gentoo Thinclient in # seconds

label test
 timeout 100
 menu default
 menu label ^Gentoo Test Thinclient 4.4.39
 kernel /kernel-genkernel-x86-4.4.39-gentoo
 append initrd=/initramfs-genkernel-x86-4.4.39-gentoo root=/dev/nfs nfsroot=my.lan.ip.addr:/gtc/test ramdisk_size=256000 acpi_sleep=s3_bios real_root=/dev/nfs i915.modeset=1 radeon.modeset=1 nvidia.modeset=1 nouveau.modeset=1 raid=noautodetect consoleblank=0
 ipappend 3

label stable
 menu label ^Gentoo Stable Thinclient 4.4.39
 kernel /kernel-genkernel-x86-4.4.39-gentoo
 append initrd=/initramfs-genkernel-x86-4.4.39-gentoo root=/dev/nfs nfsroot=my.lan.ip.addr:/gtc/stable ramdisk_size=256000 acpi_sleep=s3_bios real_root=/dev/nfs i915.modeset=1 noapic radeon.modeset=1 raid=noautodetect consoleblank=0
 ipappend 3

label bootlocal
 menu label ^Boot from local Disk
 localboot 0

Changes in /gtc/test/etc/thinclient/server-profile/etc/exports

File permissions:
Owner: root
Group: root
Permissions: -rw-r--r--

Click here for a download of the complete file: /gtc/test/etc/thinclient/server-profile/etc/exports

Changed on 23.12.08
Issued by olli
Beginning line 2

NFS(4)-configuration for test and production environment of the Thinclients.

/opt/gtcroot	*(fsid=0,crossmnt,no_subtree_check,async,ro,no_root_squash,insecure,nohide)

Changes in /usr/local/sbin/mkgtcstable.sh

File permissions:
Owner: root
Group: root
Permissions: -rwx------

Click here for a download of the complete file: /usr/local/sbin/mkgtcstable.sh

Changed on 29.06.09
Issued by olli
Beginning line 2

This is a small script for creating the stable environment from the test environment.

#!/bin/bash
/etc/init.d/rsyncd stop
mv /gtc/test/usr/portage/distfiles/jre* /srv/tmp
rm /gtc/test/usr/portage/distfiles/*
mv /srv/tmp/jre* /gtc/test/usr/portage/distfiles/
rsync -aXAHv --delete /gtc/test/ /gtc/stable/ --exclude=/_gtcroot/ --exclude=/gtcdvd/ --exclude=/proc/ --exclude=/sys/ --exclude=/tmp/ --exclude=/var/tmp --exclude=/root
mkdir -p /gtc/stable/proc
mkdir -p /gtc/stable/sys
mkdir -p /gtc/stable/tmp
mkdir -p /gtc/stable/root
chmod 0700 /gtc/stable/root
chmod 1777 /gtc/stable/tmp
mkdir -p /gtc/stable/var/tmp/portage
chmod 1777 /gtc/stable/var/tmp
mkdir -p /gtc/stable/_gtcroot
for i in `find /gtc/stable/var/log/ -type f` 
do
 >$i
done
for i in `find /gtc/stable/usr/src -maxdepth 1 -type d | grep linux`
do
 cd $i
 make clean
 cd -
done
/etc/init.d/rsyncd start

Setting up services

For starting the new service after system reboot you should add it to a runlevel with the following command(s):

rc-update add nfs default
rc-update add in.tftpd default
rc-update add rpc.idmapd default

Please send a feedback to: doc<at>gabosh.net

Howto listing
File Index

Here you can find the official Gentoo Linux Forums where you can find a lot of answers.

Here a link to the official Gentoo Linux Homepage.

Edit Howto

About / Impressum

Click here for About / Impressum

Wishlist

If you want to support my work you can find my Amazon whishlist here