Main

Swap

there are a few options to enable swap in ltsp.

(this assumes an ltsp dir of /opt/ltsp, and achitecture of i386, adjust to your
configuration if necessary)


using local swap partitions from the hard disk:

add to /opt/ltsp/i386/etc/lts.conf:

[Default]
USE_LOCAL_SWAP=Y


network swap using NBD:

touch /opt/ltsp/i386/etc/nbd-client

in /opt/ltsp/i386/etc/lts.conf:

[Default]
NBD_SWAP=Y


apt-get install nbd-server

update-inetd --group LTSP --add "9210 stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/nbdswapd"


encrypting swap space:

in /opt/ltsp/i386/etc/lts.conf:

ENCRYPT_SWAP=Y

and install the cryptsetup package:

chroot /opt/ltsp/i386 apt-get install cryptsetup


alternately, you can configure nbd-server the hard way:

apt-get install nbd-server

in /etc/nbd-server:

NBD_PORT[0]=9210
NBD_FILE[0]=/opt/ltsp/swap/swapfile.%s
NBD_SERVER_OPTS[0]=""

invoke-rc.d nbd-server start


create a file for each possible ip address that will attempt
to connect to the server:

# size in megabytes
size=100
your_ip_addresses="10.0.2.2 10.0.2.3 10.0.2.4 ..."
mkdir -p /opt/ltsp/swap/
for a in $your_ip_addresse ; do
  dd if=/dev/zero of=/opt/ltsp/swap/swapfile.$a bs=1024k count=$size
done