Author: Piotr Stera piotr.stera@polsl.pl
Source page: http://rose.aei.polsl.pl/~piotrs/howto-ltsp-f16.html
Last update: 2012-03-15
The LTSP (Linux Terminal Server Project) is a thin-client support to Linux servers. More about it you can find on LTSP Project website.
To do all described below operations you have to login as root.
There is the main problem with LTSP using Fedora 16: installation scripts are dedicated for Fedora 9, 10, 11 and 12 and it is necessary to prepare own configuration.
It is necessary to download and install Fedora 16 (Fedora download page, Fedora 16 Installation Guide).
The next step is LTSP software installing:
$ yum install ltsp-serverIt should install the following packages:
ltsp-server i686 5.1.95-3.fc16 fedora 90 k Instalowanie, aby rozwiązać zależności: dhcp i686 12:4.2.3-3.fc16 fedora 446 k isomd5sum i686 1:1.0.7-1.fc16 fedora 25 k ldminfod i686 2.0.46-2.fc15 fedora 11 k livecd-tools i686 1:16.9-1.fc16 updates 65 k ltspfs i686 0.5.13-2.fc15 fedora 31 k nbd i686 2.9.20-2.fc15 fedora 43 k pykickstart noarch 1.99.4-1.fc16 fedora 308 k pyparted i686 3.8-1.fc16 fedora 188 k python-imgcreate i686 1:16.9-1.fc16 updates 92 k squashfs-tools i686 4.2-1.fc16 fedora 111 k syslinux i686 4.02-5.fc16 fedora 789 k syslinux-extlinux i686 4.02-5.fc16 fedora 336 k tftp-server i686 5.1-1.fc16 fedora 39 k xinetd i686 2:2.3.14-37.fc16 fedora 122 k
Yum allow to install LTSP packages for F16, but these
packages is not ready to run in F16. You have to do some modifications
to run LTSP. I haven't tested described below modifications with SELinux
enabled (I suppose it will be problems to run LTSP with SELinux enabled).
To disable SELinux edit /etc/selinux/config
file, change
line
SELINUX=enforcingto
SELINUX=disabledand restart your system.
There is a need to establish the name of network device in system which
will be use for LTSP clients. In following example it is em1
.
To configure this device edit
/etc/sysconfig/network-scripts/ifcfg-em1
file and check/change/add setings:
DEVICE=em1 # do not change HWADDR=xx:xx:xx:xx:xx:xx # do not change BOOTPROTO=static ONBOOT=yes NM_CONTROLLED=no IPADDR=172.31.100.254 NETMASK=255.255.255.0 TYPE=Ethernet IPV6INIT=no USERCTL=no PREFIX=24 BRIDGE=ltspbr0
In /etc/ltsp/ltsp-server.conf
file change the network device
name.
LTSP_DEV=em1
Now, you can run script:
$ ltsp-server-initialize -yThe output can be like following:
/usr/share/ltsp//scripts.d/06-xdm-config-update: /etc/X11/xdm/xdm-config not found running hosts-update running dhcpd-updateand in
/etc/hosts
file should be:
[...] 172.31.100.1 ws001.ltsp ws001 172.31.100.2 ws002.ltsp ws002 [...] 172.31.100.253 ws253.ltsp ws253 172.31.100.254 server.ltsp serverIf there are errors in
/etc/hosts
file, they can be correct
manually.
There is the bug in NetworkMenager (starting network interfaces order is wrong) - may be needed to restart network service and DHCP service. After boot system you can test it with command:
$ /etc/init.d/network statusThe output with problem:
Configurated devices: lo em1 ltspbr0 Active devices: lo # there aren't em1 and ltspbr0 - there is problemThe correct output:
Configurated devices: lo em1 ltspbr0 Active devices: lo em1 ltspbr0 # OK - all devices are activeAnother test is:
$ ifconfigThe
em1
and ltspbr0
should have assigned
IP addresses.
If your system have described problem, there is the solution - restart
the network service. To automate this process add to /etc/rc.d/rc.local
file (if there isn't this file in your system, you have to create it and
change rights of it with $ chmod 755 /etc/rc.d/rc.local
):
#!/bin/bash /etc/init.d/network restart
If you need DHCP server only for LTSP, you do not need to do anything - LTSP server initialize should run DHCP server. You can test it with:
$ /bin/systemctl status ltsp-dhcpd.serviceThe output should be:
runningIf after reboot your system ltsp-dhcpd.service is dead you can add to
/etc/rc.d/rc.local
following line (That should be enough):
/etc/init.d/ltsp-dhcpd startIf you need DHCP server for something more than LTSP, you have to use version 2 configuration.
If you need DHCP server for something more than LTSP, this version is for
you. You have to stop ltsp-dhcpd service (it isn't works with
systemctl
- if you not stop it, normal DHCP Server will exit
after starting.
$ chkconfig ltsp-dhcpd off # stopping ltsp-dhcpd service $ touch /var/lib/dhcpd/dhcpd.leases # prophylactically if you haven't the file $ chown dhcpd:dhcpd /var/lib/dhcpd/dhcpd.lease # prophylactically if ltsp-dhcpd changed anything
Add to the DHCP configuration file (/etc/dhcp/dhcpd.conf
):
option subnet-mask 255.255.255.0; option broadcast-address 172.31.100.255; option routers 172.31.100.254; option domain-name-servers 172.31.100.254; option domain-name "local.org"; # You really should fix this option option-128 code 128 = string; option option-129 code 129 = text; get-lease-hostnames true; next-server 172.31.100.254; option root-path "172.31.100.254:/opt/ltsp/i386"; subnet 172.31.100.0 netmask 255.255.255.0 { range 172.31.100.100 172.31.100.199; if substring (option vendor-class-identifier, 0, 9) = "PXEClient" { filename "/var/lib/tftpboot/ltsp/i386/pxelinux.0"; } else{ filename "/ltsp/i386/vmlinuz-3.1.0-7.fc16.i686"; } }The kernel version (
filename "/ltsp/i386/vmlinuz-3.1.0-7.fc16.i686"
) could be another - correct it.
To test configuration you can run it:
$ systemctl start dhcpd.serviceTo automatically run your DHCP server do:
$ cd /etc/systemd/system/multi-user.target.wants $ ln -s /lib/systemd/system/dhcpd.serviceWarning: If you DHCP server not running after system reboot (the NetworkMenager bug described above), you can add to
/etc/rc.d/rc.local
file
/bin/systemctl start dhcpd.service
You have to prepare a new configuration. You should copy and change kickstart definition:
$ cp -R /etc/ltsp/kickstart/Fedora/12 /etc/ltsp/kickstart/Fedora/16 $ cd /etc/ltsp/kickstart/Fedora/16In files
ltsp-*.ks
in directory
/etc/ltsp/kickstart/Fedora/16
you have to:
ftp://ftp.ps.pl
, but you can use other)
release/12.ks
to release/16.ks
# Kickstart Definition for Client Chroot for i386 # we are going to install into a chroot, such as /opt/ltsp/i386 install #repo --name=released-12-i386 --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-12&arch=i386 #repo --name=updates-12-i386 --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f12&arch=i386 #repo --name=temporary-12-i386 --baseurl=http://togami.com/~k12linux-temporary/fedora/12/i386/ repo --name=temporary-16-i386 --baseurl=ftp://ftp.ps.pl/pub/linux/fedora-linux/releases/16/Everything/i386/os/ %include ../common/common.ks %include ../common/arch/i686.ks %include ../common/release/16.ks
To change common part of kickstart do:
$ cd /etc/ltsp/kickstart/Fedora/common/release $ cp 13.ks 16.ksand add following lines to
/etc/sysconfig/ltspdist
file
in case
for example before e15)
:
fc16) export VENDORDEF="Fedora" export RELEASEDEF=16 export TFTPDIR=/var/lib/tftpboot ;;
ltsp-build-client
script without patches give otuput:
[...] Instalowan: xorg-x11-xfs ##################### [414/429] Instalowan: ltsp-client ##################### [415/429] sed: nie można odczytać /etc/rc.d/rc.sysinit: Nie ma takiego pliku ani katalogu sed: nie można odczytać /etc/init.d/halt: Nie ma takiego pliku ani katalogu sed: nie można odczytać /etc/init.d/halt: Nie ma takiego pliku ani katalogu sed: nie można odczytać /etc/init.d/halt: Nie ma takiego pliku ani katalogu ostrzeżenie: Skrypt %post(ltsp-client-5.1.95-3.fc16.i686) nie powiódł się, stan wyjścia 2 Instalowan: mcstrans ##################### [416/429] Instalowan: MAKEDEV ##################### [417/429] Instalowan: neon ##################### [418/429] Instalowan: xterm ##################### [419/429] Instalowan: libxml2-python ##################### [420/429] Instalowan: libselinux-python ##################### [421/429] Instalowan: audit-libs-python ##################### [422/429] Instalowan: python-sqlite2 ##################### [423/429] Instalowan: e2fsprogs ##################### [424/429] Instalowan: cpp ##################### [425/429] Instalowan: less ##################### [426/429] Instalowan: tftp ##################### [427/429] Instalowan: diffutils ##################### [428/429] Instalowan: ethtool ##################### [429/429] /usr/sbin/setenforce: SELinux is disabled umount: /tmp/imgcreate-kU1vNn/install_root/sys/fs/selinux/load: nie znaleziono umount: /tmp/imgcreate-kU1vNn/install_root/sys/fs/selinux/load: nie znaleziono Cleaning up chroot /opt/ltsp/i386 sed: nie można odczytać /etc/rc.d/rc.sysinit: Nie ma takiego pliku ani katalogu sed: nie można odczytać /etc/init.d/halt: Nie ma takiego pliku ani katalogu sed: nie można odczytać /etc/init.d/halt: Nie ma takiego pliku ani katalogu sed: nie można odczytać /etc/init.d/halt: Nie ma takiego pliku ani katalogu error: LTSP client installation ended abnormallyProblem description: in
/usr/share/ltsp/chroot-setup.d/030-configure-client
script return error, because in the last line is:
/etc/init.d/haltbut it isn't exist in Fedora 16. If you prepare
halt
command
earlier, for example in /usr/sbin/chroot-creator
then chkconfig
package installation return an error
(/etc/init.d/ already exist).
My solution for this problem:
ltsp-client-5.1.95-3.fc16.i686.rpm
and
pyserial-2.5-2.fc15.noarch.rpm
packages and move them
into /opt/ltsp/
directory
/usr/sbin/chroot-creator
script from 77 line like below (spaces before comands are important!):
# NOTE: This part is LTSP specific # Copy mkinitrd configuration into /etc/sysconfig/mkinitrd before package installation # This allows mkinitrd to DTRT the first time. imgcreate.fs.makedirs(self._instroot + "/etc/sysconfig") imgcreate.fs.makedirs(self._instroot + "/etc/sysconfig/network-scripts") imgcreate.fs.makedirs(self._instroot + "/etc/kernel") imgcreate.fs.makedirs(self._instroot + "/etc/kernel/postinst.d") shutil.copyfile("/etc/ltsp/mkinitrd/sysconfig-mkinitrd",self._instroot + "/etc/sysconfig/mkinitrd") shutil.copyfile("/etc/ltsp/mkinitrd/sysconfig-network",self._instroot + "/etc/sysconfig/network") shutil.copyfile("/etc/ltsp/mkinitrd/ifcfg-eth0",self._instroot + "/etc/sysconfig/network-scripts/ifcfg-eth0") shutil.copyfile("/etc/ltsp/mkinitrd/ltsp-postinst.d",self._instroot + "/etc/kernel/postinst.d/ltsp") os.chmod(self._instroot + "/etc/kernel/postinst.d/ltsp",0755) ##### Patch for ltsp-client package ##### print("===> Patch for ltsp-client package") imgcreate.fs.makedirs(self._instroot + "/patch") shutil.copyfile("/opt/ltsp/ltsp-client-5.1.95-3.fc16.i686.rpm",self._instroot + "/patch/ltsp-client-5.1.95-3.fc16.i686.rpm") shutil.copyfile("/opt/ltsp/pyserial-2.5-2.fc15.noarch.rpm",self._instroot + "/patch/pyserial-2.5-2.fc15.noarch.rpm") ##### end of patch ##### # Create empty file to mark that this is a LTSP chroot open(self._instroot + "/etc/ltsp_chroot", 'w').write('')
/etc/ltsp/kickstart/Fedora/common/common.ks
configuration file non existing packages
(system-config-display
, kudzu
) and
ltsp-client
package.
/etc/ltsp/kickstart/Fedora/common/release/16.ks
file
like below:
%packages --excludedocs dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-serif-fonts plymouth-theme-charge dracut-network # needed for lokkit which is needed by livecd-creator system-config-firewall-base %end %post ##### patch for ltsp-client ##### echo "===> patch start" touch /etc/init.d/halt rpm -i /patch/ltsp-client-5.1.95-3.fc16.i686.rpm /patch/pyserial-2.5-2.fc15.noarch.rpm echo "===> patch end" ##### end of patch ##### /usr/sbin/plymouth-set-default-theme charge /usr/sbin/ltsp-rewrap-latest-kernel %end
Fedora 16 based on 3.x kernel. You have change /usr/share/ltsp/plugins/functions
file in 66 line. Original line:
kernelversion="`ls -d $ROOT/lib/modules/2* | sort -nr | head -n1 | xargs basename`"should be changed to:
kernelversion="`ls -d $ROOT/lib/modules/3* | sort -nr | head -n1 | xargs basename`"
Run ltsp-build-client
. The output:
Autoconfigured Kickstart: /etc/ltsp/kickstart/Fedora/16/ltsp-i386.ks Installing into /opt/ltsp/i386 Mounting /opt/ltsp/i386 for chroot installation ===> Patch for ltsp-client package WARNING:root:Skipping (/sys/fs/selinux,/sys/fs/selinux) because source doesn't exist. mount: punkt montowania /tmp/imgcreate-9lPbjO/install_root/sys/fs/selinux/load nie istnieje WARNING:root:No such package nss_db to remove WARNING:root:No such package hal to remove WARNING:root:No such package bluez-gnome to remove WARNING:root:No such package libvolume_id to remove WARNING:root:No such package iptables-ipv6 to remove WARNING:root:No such package pam_smb to remove WARNING:root:No such package firstboot-tui to remove WARNING:root:No such package cpuspeed to remove WARNING:root:No such package man to remove WARNING:root:No such package unix2dos to remove WARNING:root:No such package htmlview to remove WARNING:root:No such package rng-utils to remove WARNING:root:No such package ifd-egate to remove WARNING:root:No such package vixie-cron to remove WARNING:root:No such package rhpl to remove WARNING:root:No such package ccid to remove WARNING:root:No such package anacron to remove WARNING:root:No such package bluez-utils to remove WARNING:root:No such package sysreport to remove ostrzeżenie: fontpackages-filesystem-1.44-2.fc15.noarch: Nagłówek V3 RSA/SHA256 Signature, identyfikator klucza a82ba4b7: NOKEY Instalowan: fontpackages-filesystem ##################### [ 1/427] Instalowan: setup ##################### [ 2/427] Instalowan: filesystem ##################### [ 3/427] [...] Instalowan: gawk ##################### [ 80/427] Instalowan: libidn ##################### [ 81/427] install-info: Nie ma takiego pliku ani katalogu for /usr/share/info/libidn.info.gz Instalowan: cpio ##################### [ 82/427] Instalowan: pcre ##################### [ 83/427] Instalowan: grep ##################### [ 84/427] install-info: Nie ma takiego pliku ani katalogu for /usr/share/info/grep.info.gz Instalowan: libsigc++20 ##################### [ 85/427] Instalowan: openjpeg-libs ##################### [ 86/427] [...] Instalowan: pinentry ##################### [178/427] Instalowan: which ##################### [179/427] install-info: Nie ma takiego pliku ani katalogu for /usr/share/info/which.info.gz Instalowan: e2fsprogs-libs ##################### [180/427] Instalowan: libss ##################### [181/427] [...] Instalowan: plymouth-scripts ##################### [271/427] Instalowan: plymouth ##################### [272/427] Need 'inst' function, try setting PLYMOUTH_POPULATE_SOURCE_FUNCTIONS to a file that defines it Instalowan: dracut ##################### [273/427] Instalowan: kernel ##################### [274/427] [...] Instalowan: yp-tools ##################### [289/427] Instalowan: ypbind ##################### [290/427] Running in chroot, ignoring request. Instalowan: xorg-x11-drv-void ##################### [291/427] Instalowan: xorg-x11-drv-synaptics ##################### [292/427] [...] Instalowan: libcurl ##################### [352/427] Instalowan: gnupg2 ##################### [353/427] install-info: Nie ma takiego pliku ani katalogu for /usr/share/info/gnupg.info Instalowan: dhcp-common ##################### [354/427] Instalowan: dhclient ##################### [355/427] [...] Instalowan: cpp ##################### [423/427] Instalowan: less ##################### [424/427] Instalowan: tftp ##################### [425/427] Instalowan: diffutils ##################### [426/427] Instalowan: ethtool ##################### [427/427] ===> patch start warning: /patch/ltsp-client-5.1.95-3.fc16.i686.rpm: Header V3 RSA/SHA256 Signature, key ID a82ba4b7: NOKEY sed: can't read /etc/rc.d/rc.sysinit: No such file or directory ===> patch end /usr/sbin/setenforce: SELinux is disabled umount: /tmp/imgcreate-9meeRG/install_root/sys/fs/selinux/load: nie znaleziono umount: /tmp/imgcreate-9meeRG/install_root/sys/fs/selinux/load: nie znaleziono Cleaning up chroot /opt/ltsp/i386 sed: nie można odczytać /etc/rc.d/rc.sysinit: Nie ma takiego pliku ani katalogu WARNING: /opt/ltsp/temporary-16-i386/etc/ssh not found. skipping... Updating /var/lib/tftpboot directories for chroot: /opt/ltsp/i386 Skipping invalid chroot: /opt/ltsp/temporary-16-i386 info: LTSP client installation completed successfully
Run from menu: Programs > Administration > Firewall
and open ports: 69 (TFTP), 111 (sunrpc) and NFS4 (2049).
Change tab to "Other ports" and add:
111 tcp (sunrpc) 111 udp (sunrpc) 20048 udp (mountd)Restart firewall. In
/etc/sysconfig/iptables
file should be:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 20048 -j ACCEPT
Now you can try to run LTSP client :)
The start procedure with using PXE:
exportfs -aand restart client. The next start should be OK (is this bug in rpc.mound?)
/var/lib/tftpboot/ltsp/i386/pxelinux.cfg/default
file on server./var/lib/tftpboot/ltsp/i386/lts.conf
in [default]
section, for example:
LC_ALL=pl_PL.UTF-8 LANG=pl_PL.UTF-8 XKBLAYOUT=pl2 KEYTABLE=pl2but in some cases you have to change them after login in client X desktop configuration (for example keyboard layout).
If you want to start client from local hard disk, you should copy
following files from /var/lib/tftpboot/ltsp/i386
server
directory into client hard disk /boot
directory:
config-3.1.0-7.fc16.i686 initramfs-3.1.0-7.fc16.i686.img System.map-3.1.0-7.fc16.i686 vmlinuz-3.1.0-7.fc16.i686change network configuration file
/etc/sysconfig/network-scripts/ifcfg-em1
DEVICE=em1 # Your network card MAC address HWADDR=xx:xx:xx:xx:xx:xx BOOTPROTO=none #ONBOOT=no ONBOOT=yes NM_CONTROLLED=yes IPADDR=172.31.100.102 NETMASK=255.255.255.0 TYPE=Ethernet GATEWAY=172.31.100.254 IPV6INIT=no USERCTL=no PREFIX=24and add new item to client grub start menu
/boot/grub2/grub.cfg
(51d0fe25-b473-48a4-a86a-be13cd549bd1 change to UUID your hard disk partition):
[...] menuentry 'LTSP Client' --class fedora --class gnu-linux --class gnu --class os { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root 51d0fe25-b473-48a4-a86a-be13cd549bd1 echo 'Loading Linux 3.1.0-7.fc16.i686 ...' linux /boot/vmlinuz-3.1.0-7.fc16.i686 rw selinux=0 root=dhcp quiet rhgb LANG=pl_PL.UTF-8 KEYTABLE=pl2 echo 'Loading initial ramdisk ...' initrd /boot/initramfs-3.1.0-7.fc16.i686.img
/etc/xinetd.d/tftp
file:
# default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot per_source = 11 cps = 100 2 flags = IPv4 }
systemctl status xinetd.service
rpcinfo -p localhostshould output:
program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper
/etc/ltsp/dhcpd.conf
Original line:
filename "/ltsp/i386/elf.ltsp";change to:
filename "/ltsp/i386/pxelinux.0";
systemctl status netfs.serviceAbove can show NFS service is running, but it doesn't work. Better way is:
rpcinfo -p localhostThe output should be:
100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 nfs_acl 100227 3 tcp 2049 nfs_acl 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 nfs_acl 100227 3 udp 2049 nfs_acl [...] 100005 1 udp 20048 mountd 100005 1 tcp 20048 mountd 100005 2 udp 20048 mountd 100005 2 tcp 20048 mountd 100005 3 udp 20048 mountd 100005 3 tcp 20048 mountdand
ps axw | grep rpcThe output:
[...] 1400 ? Ss 0:00 /usr/sbin/rpc.mountd [...]If there isn't
rpc.mountd
, you can add following lines to
/etc/rc.d/rc.local
file:
/usr/sbin/rpc.nfsd /usr/sbin/rpc.mountd