UbuntuHelp:UbuntuLTSP/FatClients
来自Ubuntu中文
点击翻译: |
English |
请不要直接编辑翻译本页,本页将定期与来源同步。 |
This page is specific to Ubuntu versions 9.10, 10.04 |
If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.
目录
Introduction
LTSP 5.2 comes with support for fat clients. Similarly to thin clients, fat clients use the server as a network disk for /home and for the root file system, and authenticate with ldm/ssh. But in contrast with thin clients, fat clients use their own RAM and CPU power to run the applications. Of course this also means that their hardware requirements are the same as for running Ubuntu on normal workstations.
ltsp-build-client fat-client parameters
A chroot for fat clients needs to be specially prepared, either by providing some command line parameters to `ltsp-build-client` or by creating an ltsp-build-client.conf file. The command line parameters are mentioned in this paragraph, while the rest of the document refers to the ltsp-build-client.conf method. --arch: The thin client chroot architecture you'll be installing. This is the CPU architecture of the fat clients that will be used. --chroot NAME: Replace NAME with what you want the chroot's name to be (for example, --chroot fat-i386 will produce /opt/ltsp/fat-i386 and associated nbd image name). --fat-client: Installs the same desktop environment that is installed on the server. --fat-client-desktop: Chooses which desktop environment to install into the fat client chroot. Options are ubuntu-desktop, edubuntu-desktop, among others. --late-packages: Specify additional packages to install in the chroot (other than the ones you would normally get in a live session).
Preparation
In the following paragraphs the method that uses an ltsp-build-client.conf file is described. Any parameters would be put in that file, so that in the end you'll just need to run `sudo ltsp-build-client` with no parameters at all. Install ltsp-server-standalone (or ltsp-server, if you have an external DHCP server):
sudo apt-get install ltsp-server-standalone
Lucid warning: if ldm-server installation hangs, switch to another terminal, and run:
sudo service openbsd-inetd restart
Create an /etc/ltsp directory, to store some configuration files:
sudo mkdir /etc/ltsp
Extra steps for Ubuntu Karmic 9.10
Add stgraber's (Ubuntu LTSP maintainer) repository to your sources, and update/upgrade your packages:
sudo add-apt-repository ppa:stgraber sudo apt-get update && sudo apt-get dist-upgrade
Export stgraber's key, it'll be needed for the chroot as well:
sudo apt-key export E7716B13 | sudo tee /etc/ltsp/stgraber.asc
Creating ltsp-build-client.conf
Run the following command to create the ltsp-build-client configuration file
sudo gedit /etc/ltsp/ltsp-build-client.conf
and paste the following contents into it, while adjusting them to your needs:
# The chroot architecture. ARCH=i386 # ubuntu-desktop and edubuntu-desktop are tested. # If you test with [k|x]ubuntu-desktop, edit this page and mention if it worked OK. FAT_CLIENT_DESKTOPS="ubuntu-desktop" # Space separated list of programs to install. # The java plugin installation contained in ubuntu-restricted-extras # needs some special care, so let's use it as an example. LATE_PACKAGES=" ubuntu-restricted-extras gimp nfs-client " # This is needed to answer "yes" to the Java EULA. # We'll create that file in the next step. DEBCONF_SEEDS="/etc/ltsp/debconf.seeds" # If you have Ubuntu Karmic, uncomment the following lines, so that you get # LTSP 5.2 which is required for fat clients. #EXTRA_MIRROR=" # http://ppa.launchpad.net/stgraber/ppa/ubuntu $DIST main #" # If you have Ubuntu Karmic, also uncomment the following lines, to install # the necessary keys for the extra mirrors. #APT_KEYS=" # /etc/ltsp/stgraber.asc #" # This uses the server apt cache to speed up downloading. # You can't use apt on the server while building the chroot, though. MOUNT_PACKAGE_DIR="/var/cache/apt/archives"
Creating debconf.seeds
Run the following command
sudo gedit /etc/ltsp/debconf.seeds
to create a new file that will contain the debconf seeds, which are needed for the unattented Java installation. Paste the following lines into that file:
# Do you agree with the DLJ license terms? sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
Of course adding those keys manually means that you have read and accepted the Java EULA.
Running ltsp-build-client
After the steps above, open a terminal, and just enter the command:
sudo ltsp-build-client
You might want to enable "unlimited scrollback" in your terminal preferences, so that you have all the logs in case of failure. If everything goes well, when it finishes you'll be able to boot your fat clients. If you want some clients to be booted as thin clients instead, you can put LTSP_FATCLIENT=false in lts.conf for those clients.
Further chroot customizations
To install additional programs after the initial chroot generation, the following script might help you. Save it as "ltsp-enter-chroot", run "chmod +x ltsp-enter-chroot", and run it with "sudo ltsp-enter-chroot":
#!/bin/sh . /etc/ltsp/ltsp-build-client.conf ROOT="/opt/ltsp/$ARCH" chroot "$ROOT" mount -t proc proc /proc || die "Not a valid chroot: $ROOT" mount --bind /var/cache/apt/archives "$ROOT/var/cache/apt/archives" cp /etc/resolv.conf "$ROOT/etc/" export LTSP_HANDLE_DAEMONS=false echo "Entering chroot $ROOT, type 'exit' to exit." chroot "$ROOT" || true unset LTSP_HANDLE_DAEMONS umount "$ROOT/var/cache/apt/archives" if ! umount "$ROOT/proc"; then echo "$ROOT/proc is in use, forcing unmount!" umount -l "$ROOT/proc" fi
While inside the chroot, you may run apt-get update/dist-upgrade/install etc. Of course every time you modify your chroot you also need to run ltsp-update-image (and possibly ltsp-update-kernels) afterwards.
Troubleshooting
Symlinks problems
Some applications, like pulseaudio, googleearth, google chrome etc, try to create locks/symlinks from within the sshfs mounted user home directory to other places like /proc or /tmp. For those apps to work, SSH_FOLLOW_SYMLINKS=False is required in lts.conf.
NFS_HOME
Unfortunately, even with SSH_FOLLOW_SYMLINKS=False, some applications that require file locks (e.g. evolution) fail to run properly. A new lts.conf variable was introduced to overcome this, NFS_HOME. In order to use it,
- Install nfs-client in the chroot,
- Install nfs-kernel-server on your server,
- Add `/home *(rw,sync,no_subtree_check)` to your /etc/exports on your server,
- Run `sudo exportfs -ra` for the previous change to take effect,
- And finally, add `NFS_HOME=/home` on your lts.conf.
Separating chroots
It is recommended to build a separate chroot for fat clients, if you have thin clients on the same server with equal or less than 128MB RAM. You can achieve this by using the --chroot NAME parameter, replacing NAME to what you want the chroot's name to be (for example, --chroot i386.fatclient will produce /opt/ltsp/i386.fatclient). Doing this will also enable a new nbdrootd process on a different port (check /etc/inetd.conf for which port after the chroot is built). At this point you will specify which clients will boot to the fat client chroot by copying /var/lib/tftpboot/ltsp/ARCH/pxelinux.cfg/default to /var/lib/tftpboot/ltsp/ARCH/pxelinux.cfg/01-MacAddressOfClient (substitute MacAddressOfClient with the MAC address of your fat client NIC) and changing the nbdport=2000 variable to the one of the fat client chroot port you found in /etc/inetd.conf. Remember to include 01- in your filename!
2-NIC setup
If you're using a 2-NIC setup, where your fat clients are connected to one NIC of your server and your server connects to the internet through another NIC, then you'll need to follow the howto at ThinClientHowtoNAT to get internet access working on your clients.
See Also
- UbuntuLTSP - Community Ubuntu LTSP Documentation.