Linux Terminal Server Project

1686173559
ADVERTISEMENT
Linux terminal server project

File Name: ltsp.pdf

File Size: 408.43 KB

File Type: Application/pdf

Last Modified: 9 months

Status: Available

Last checked: 3 days ago!

This Document Has Been Certified by a Professional

100% customizable

Language: English

We recommend downloading this file onto your computer

Summary

LTSP
Linux Terminal Server Project
A pdf export of https://ltsp.org
Copyright © 2000-2022 the LTSP developers
Table of contents
Table of contents
1. About 4
2. Documentation 5
2.1 Documentation 5
2.2 Preparation 6
2.3 Installation 7
2.4 Personal Package Archive 12
2.5 Netboot clients 13
3. Man pages 14
3.1 Man pages 14
3.2 ltsp 15
3.3 ltsp.conf 17
3.4 ltsp-dnsmasq 22
3.5 ltsp-image 23
3.6 ltsp-info 26
3.7 ltsp-initrd 27
3.8 ltsp-ipxe 28
3.9 ltsp-kernel 30
3.10 ltsp-nfs 32
3.11 ltsp-remoteapps 33
4. Guides 34
4.1 Guides 34
4.2 Chat room 35
4.3 Coding 36
4.4 ISC DHCP server 38
4.5 Markdown 39
4.6 Netconsole 41
4.7 Proposed PPA 42
4.8 PXELinux 43
4.9 Specifications 44
4.10 Snap 45
4.11 Versioning 46
5. Support 47
5.1 Upstream 47
5.2 Community 47
5.3 Commercial 47
- 2/47 - Copyright © 2000-2022 the LTSP developers
Table of contents
5.4 Bounties 47
5.5 Donations 47
- 3/47 - Copyright © 2000-2022 the LTSP developers
1. About
1. About
Linux Terminal Server Project helps in netbooting LAN clients from a single template installation that resides in a virtual
machine image or a chroot on the LTSP server, or the server root (/, chrootless). This way maintaining tens or hundreds of
diskless clients is as easy as maintaining a single PC

LTSP has been redesigned and rewritten from scratch in 2019 by alkisg in order to
support new technologies like systemd, updated desktop environments, Wayland,
UEFI etc. Only the new version is actively developed, while the old one is now called
LTSP5 and is in minimal maintenance mode

LTSP automatically configures and uses the following tools:
• iPXE: network boot loader that shows the initial client boot menu and loads the
kernel/initrd

• dnsmasq or isc-dhcp-server: DHCP server that assigns IPs to the clients, or
ProxyDHCP server when another DHCP server is used, e.g. a router

• dnsmasq or tftpd-hpa: TFTP server that sends ipxe/kernel/initrd to the clients

• dnsmasq: optional DNS server for DNS caching or blacklisting

• mksquashfs: creates a compressed copy of the template image/chroot/VM to be used as the client root /

• NFS or NBD: serve the squashfs image to the network

• tmpfs and overlayfs: make the squashfs image temporarily writable for each client, similiarly to live CDs

• NFS or SSHFS: access the user's /home directory which resides on the server

• SSH or SSHFS or LDAP: authenticate users against the server

What are you waiting for? Continue to the installation page!
- 4/47 - Copyright © 2000-2022 the LTSP developers
2. Documentation
2. Documentation
2.1 Documentation
Read the following pages in order to setup LTSP:
1. Preparation
2. Installation
3. Personal package archive
4. Netboot clients
For additional security like disabling the iPXE shell, you may also read the security wiki page

- 5/47 - Copyright © 2000-2022 the LTSP developers
2.2 Preparation
2.2 Preparation
Before installing LTSP, make sure that it fits your needs and that your hardware is appropriate

2.2.1 When to use
The main reason to use LTSP is if you want to maintain a single installation, instead of many. It saves administration time

The older LTSP5 targetted thin clients with reduced hardware specifications; this is no longer the case. The LTSP clients should
be able to run the distribution with their own CPU/RAM; except with LTSP they'll be using a network disk instead of a local disk,
so they can be diskless

2.2.2 Network
• The server ⟺ switch connection should be gigabit; i.e. gigabit server NIC, switch port and 5e+ cabling

• The clients ⟺ switch connection may be 100 Mbps

• It's best if the LTSP clients are connected to the same switch as the server

As network performance is very important for LTSP, after it's up and running do a LAN benchmark with epoptes, to make sure
the server can send and receive data with at least 800 Mbps bandwidth

2.2.3 Server
Any recent PC will do with e.g. 4 GB RAM and 3000 cpubenchmark.net score. An SSD disk for both rootfs and home will probably
make client network disk access a bit faster

2.2.4 Clients
Consult your distribution for client specifications. 1 GB RAM with 500 cpubenchmark.net score could be the minimal specs, and
2 GB RAM / 2000+ score the recommended

- 6/47 - Copyright © 2000-2022 the LTSP developers
2.3 Installation
2.3 Installation
2.3.1 Installation
All the terminal commands in the documentation should be run as root, which means you should initially run sudo -i on Ubuntu
or su - on Debian

Server OS installation
The LTSP server can be headless, but it's usually better to install the operating system using a "desktop" .iso and not a "server"
one. All desktop environments should work fine, but MATE receives the most testing. Any .deb-based distribution that uses
systemd should work; i.e. from Ubuntu Xenial and Debian Jessie and onward. If you choose Ubuntu, you may also consider
removing snap to avoid some issues

Adding the LTSP PPA
The LTSP PPA is where stable upstream LTSP releases are published. It's mandatory for distributions before 2020 that have the
older LTSP5, and optional but recommended to have in newer distributions. Follow the ppa page to add it to your sources, then
continue reading here

Installing LTSP server packages
The usual way to transform a normal installation into an LTSP server is to run:
apt install --install-recommends ltsp ltsp-binaries dnsmasq nfs-kernel-server openssh-server squashfs-tools ethtool net-tools epoptes
gpasswd -a administrator epoptes
Replace administrator with the administrator username. If you're not using the PPA, also replace ltsp-binaries with ipxe

Description of the aforementioned packages:
• ltsp: contains the LTSP code, it's common for both LTSP servers and LTSP clients

• ltsp-binaries: contains iPXE and memtest binaries

• dnsmasq: provides TFTP and optionally (proxy)DHCP and DNS services. Possible alternatives are isc-dhcp-server and tftpd-
hpa, but only dnsmasq can do proxyDHCP, so it's the recommended default

• nfs-kernel-server: exports the virtual client disk image over NFS

• openssh-server: allows clients to authenticate and access /home via SSHFS

• ethtool, net-tools: allow disabling Ethernet flow control, to improve LAN speed when the server is gigabit and some clients are
100 Mbps

• epoptes: optional; allows client monitoring and remote control; the gpasswd command allows the sysadmin to run epoptes

All those packages can also be displayed with apt show ltsp | grep ^Suggests

Network configuration
There are two popular methods to configure LTSP networking. One is to avoid any configuration; this usually means that you
have a single NIC on the LTSP server and an external DHCP server, for example a router, pfsense, or a Windows server. In this
case, run the following command:
ltsp dnsmasq
Another method is to have a dual NIC LTSP server, where one NIC is connected to the normal network where the Internet is, and
the other NIC is connected to a separate switch with just the LTSP clients. For this method to work automatically, assign a static
IP of 192.168.67.1 to the internal NIC using Network Manager or whatever else your distribution has, and run:
- 7/47 - Copyright © 2000-2022 the LTSP developers
2.3.1 Installation
ltsp dnsmasq --proxy-dhcp=0
You can read about more ltsp dnsmasq options, like --dns or --dns-servers, in its man page

Maintaining a client image
LTSP supports three methods to maintain a client image. They are documented in the ltsp image man page. You can use either
one or all of them. In short, they are:
• Chrootless (previously pnp): use the server root (/) as the template for the clients. It's the easiest method if it suits your needs,
as you maintain only one operating system, not two (server and image)

• Raw virtual machine image: graphically maintain e.g. a VirtualBox VM

• Chroot: manually maintain a chroot directory using console commands

In the virtual machine and chroot cases, you're supposed to install the ltsp package to the image, by adding the LTSP PPA and
running apt install
--install-recommends ltsp epoptes-client , without specifying any other services. In the chrootless and virtual machine cases, if
you're using separate partitions for some directories like /boot or /var, see the ltsp image man page EXAMPLES section for how
to include them. When the image is ready, to export it in squashfs format and make it available to the clients over NFS, run the
following commands

For chrootless:
ltsp image /
Virtual machines need to be symlinked before running ltsp image :
ln -s "/home/user/VirtualBox VMs/debian/debian-flat.vmdk" /srv/ltsp/debian.img
ltsp image debian
For a chroot in /srv/ltsp/x86_32:
ltsp image x86_32
You need to run these commands every time you install new software or updates to your image and want to export its updated
version

Configuring iPXE
After you create your initial image, or if you ever create additional images, run the following command to generate an iPXE menu
and copy the iPXE binaries in TFTP:
ltsp ipxe
In LTSP5, syslinux was used, but iPXE replaced it as it's much more powerful. You can read more about it in the ltsp ipxe man
page

NFS server configuration
To configure the LTSP server to serve the images or chroots over NFS, run:
ltsp nfs
For finetuning options, see the ltsp nfs man page

Generate ltsp.img
A new procedure that wasn't there in LTSP5 is provided by the following command:
ltsp initrd
- 8/47 - Copyright © 2000-2022 the LTSP developers
2.3.1 Installation
This compresses /usr/share/ltsp, /etc/ltsp, /etc/{passwd,group} and the server public SSH keys into /srv/tftp/ltsp/ltsp.img, which
is transferred as an "additional initrd" to the clients when they boot. You can read about its benefits in its man page, for now
keep in mind that you need to run ltsp initrd after each LTSP package update, or when you add new users, or if you create or
modify /etc/ltsp/ltsp.conf, which replaced the LTSP 5 "lts.conf"

Questions
Questions? Start a discussion or come to the online chat room

- 9/47 - Copyright © 2000-2022 the LTSP developers
2.3.2 Raspberry Pi OS
2.3.2 Raspberry Pi OS
Basic installation instructions for netbooting Raspberry Pi clients from a Raspberry Pi OS (formely Raspbian) chroot on an LTSP
server

Prerequisites
The LTSP server should already be configured by following the installation page. If booting x86 clients is also required, do that
part first as it's easier

Client configuration
The client configuration is officially documented here. In short:
• To netboot Pi 2, format an SD card with the fat file system and put only bootcode.bin in it. This file can be found in /boot/
bootcode.bin inside your Raspberry Pi OS image

• For Pi 3B, boot from an SD card, run echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt and reboot

• Pi 3B+ supports netbooting out of the box

• For Pi 4 and Pi 400, boot from a fully updated SD card to get the latest firmware, then run sudo raspi-config and select
Advanced Options > Boot Order > Network Boot

Chroot preparation
Raspberry Pi OS is very optimized for Raspberries, so it's currently a better option than e.g. Ubuntu MATE or other distributions

The easiest way to generate a Raspberry Pi OS chroot isn't with the debootstrap command, but by downloading an image. You
may also follow the Raspberry Pi OS installation guide or you may use dd to read the SD card from an existing Raspberry Pi
installation; to keep the instructions shorter, we assume that in the end you have an uncompressed raspios.img on the LTSP
server

losetup -rP /dev/loop8 2020-12-02-raspios-buster-armhf-full.img
mount -o ro /dev/loop8p2 /mnt
time cp -a /mnt/. /srv/ltsp/raspios
umount /mnt
mount -o ro /dev/loop8p1 /mnt
cp -a /mnt/. /srv/ltsp/raspios/boot/
umount /mnt
losetup -d /dev/loop8
At this point, Raspberry Pi OS should be in /srv/ltsp/raspios . This chroot isn't ready for netbooting yet, the following commands
are needed:
# Go to the chroot in order to use relative directories
cd /srv/ltsp/raspios
# Mask services that we don't want in netbooting
systemctl mask --root=. dhcpcd dphys-swapfile raspi-config resize2fs_once
# Remove SD card entries from fstab
echo 'proc /proc proc defaults 0 0' >./etc/fstab
# Use an appropriate cmdline for NFS_RW netbooting
echo 'ip=dhcp root=/dev/nfs rw nfsroot=192.168.67.1:/srv/ltsp/raspios,vers=3,tcp,nolock console=serial0,115200 console=tty1 elevator=deadline fsck.repair=yes
rootwait quiet splash plymouth.ignore-serial-consoles modprobe.blacklist=bcm2835_v4l2' >./boot/cmdline.txt
Server preparation
In ltsp.conf, set RPI_IMAGE to the chroot name. This will be used by ltsp kernel to generate the appropriate symlinks from
/srv/tftp/* to /srv/ltsp/raspios/boot/*

[server]
RPI_IMAGE="raspios"
Then, run:
- 10/47 - Copyright © 2000-2022 the LTSP developers
2.3.2 Raspberry Pi OS
ltsp kernel raspios
ltsp initrd
ltsp nfs
NFS_RW netbooting
At this point we're ready to netboot a single client in NFS_RW mode. This means that whatever changes we do on that client, like
installing new programs, are directly saved in /srv/ltsp/raspios

First, export the chroot in NFS read-write mode:
echo '/srv/ltsp/raspios *(rw,async,crossmnt,no_subtree_check,no_root_squash,insecure)' >/etc/exports.d/ltsp-raspios.exports
exportfs -ra
You may replace * with an IP to only allow access to a single client, or you may delete the /etc/exports.d/ltsp-raspios.exports file
when you're done, so that there are no security issues

Now boot a single client, add the LTSP PPA to your sources, and install the client-side packages:
apt install --install-recommends ltsp epoptes-client
LTSP mode netbooting
At this point our chroot contains the LTSP code and is ready to be netbooted. But it needs a different kernel cmdline than the
NFS_RW mode, so run the following commands:
echo 'ip=dhcp root=/dev/nfs nfsroot=192.168.67.1:/srv/ltsp/raspios,vers=3,tcp,nolock init=/usr/share/ltsp/client/init/init ltsp.image=images/raspios.img
console=serial0,115200 console=tty1 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles modprobe.blacklist=bcm2835_v4l2'
>/srv/ltsp/raspios/boot/cmdline.txt
# Finally, create the squashfs image
ltsp image raspios --mksquashfs-params='-comp lzo'
That's it, now you should be able to netboot all your Raspberry Pi clients

- 11/47 - Copyright © 2000-2022 the LTSP developers
2.4 Personal Package Archive
2.4 Personal Package Archive
Stable upstream LTSP releases are offered in .deb package format in the LTSP PPA. They should work in all .deb-based
distributions that use systemd, i.e. from Debian Jessie 8 and Ubuntu Xenial 16.04 and upwards

The LTSP PPA is mandatory for distributions before 2020 that have the older LTSP5, and optional but recommended to have in
newer distributions. When clients netboot, ltsp init dynamically configures a lot of other packages, like systemd, network-
manager, display managers, netplan etc. Some times normal distribution updates of said packages break the netboot process,
and urgent LTSP updates provided by the PPA are required to fix it

To install the repository in Ubuntu-based distributions, run as root:
add-apt-repository ppa:ltsp
apt update
To install the repository in Debian-based distributions, run as root:
wget https://ltsp.org/misc/ltsp-ubuntu-ppa-focal.list -O /etc/apt/sources.list.d/ltsp-ubuntu-ppa-focal.list
wget https://ltsp.org/misc/ltsp_ubuntu_ppa.gpg -O /etc/apt/trusted.gpg.d/ltsp_ubuntu_ppa.gpg
apt update
Note that normally Debian users should not be using PPAs. LTSP is an exception, as it only contains shell code (and a bit of
python), it is interpreted (Architecture:all, no compiled binaries involved), and the .debs are tested on Debian too

- 12/47 - Copyright © 2000-2022 the LTSP developers

Linux Terminal Server Project helps in netbooting LAN clients from a single template installation that resides in a virtual machine image or a chroot on the LTSP server, or the server root (/, chrootless). This way maintaining tens or hundreds of diskless clients is as easy as maintaining a single PC.

Download Now

Documemt Updated

ADVERTISEMENT

Popular Download

ADVERTISEMENT

Frequently Asked Questions

What is linux terminal server project?

Linux Terminal Server Project helps in netbooting LAN clients from a single template installation that resides in a virtual machine image or a chroot on the LTSP server, or the server root (/, chrootless). This way maintaining tens or hundreds of diskless clients is as easy as maintaining a single PC.

What operating system is used for linux terminal server?

The Linux Terminal Server is managed by the Linux Terminal Server Project (LTSP). The Operating Systems that LTSP can use are Debian based versions of Linux. Ubuntu works well. In this article, I will use Ubuntu 22.04 as the Operating System being used as the OS for the workstations. LTSP works with Debian Jessie (8.11) and onward.

What is a terminal emulator?

A terminal emulator is a program that allows the use of the terminal in a graphical environment. As most people use an OS with a graphical user interface (GUI) for their day-to-day computer needs, the use of a terminal emulator is a necessity for most Linux server users. Here are some free, commonly-used terminal emulators by operating system: