You might be interested in this post if you want to set up an LTSP server. We've gone through the pain of finding the best way to set one up so you don't have to. No need to thank us, the smiles on your faces are thanks enough.
This procedure was developed using the Xubuntu 7.04 (Feisty Fawn) Alternate Install CD running XFCE. As always, be careful when editing your system configuration files, or following any procedures from any site, as you can do harm to your system if a mistake is made. Always make backups of the configuration files that you change, or you might just find yourself with a broken system that's a pain to fix.
This walk through should leave you with a complete LTSP server that clients with their "network boot" setting enabled can boot from. While it's true that the Xubuntu Alternate Install CD has an option to install an LTSP server automatically for you that works well, there are usually a few gotchas that you have to watch out for. This post is intended to guide you through the gotchas with a minimum of hardship. The hard drive of the computer that you're using during this procedure will be completely overwritten, so make sure you don't have anything on it that you don't want to lose. Also, this walk through will reference a couple of other posts on this blog to cut down on duplicate instructions. I apologize ahead of time for the low quality of a few of the screen shots. Lets get started.
The Installation Process
Boot the computer that will become your server from the Xubuntu Alternate Install CD and, if you're running a version prior to 8.04, select the Install an LTSP server option when the menu comes up. If you're using Xubuntu 8.04 or later, you'll need to follow the instructions in our LTSP update post to start the LTSP server installation. Make sure that the computer is hooked up to the network so that it can download the packages for the LTSP client build (Build chroot) step later on. Follow the directions for the Choose language screens, the Configure the keyboard setup screens, and the Configure the network screen (enter whatever host name you want the server to have). On Xubuntu 8.04 and newer, you may also be asked to select your timezone. Once you get through all of those, you will be at the first Partition disks screen (Figure 1).
You want to choose the Guided - use entire disk option unless you have a good reason to do otherwise. This will use the entire hard drive (remember that you're supposed to get everything important off of it), giving the server the most possible storage for your users. The more users you have, the more hard drive space you will probably require. Also, while I'm at it I will mention that using Serial ATA (with NCQ) or SCSI instead of Parallel ATA hard drives will significantly improve the performance of your server. This is because SATA and SCSI drives handle simultaneous requests from multiple users more efficiently. Now, back to the installation. Once you have selected Guided - use entire disk, hit Enter and you will be brought to the second Partition disks screen which asks you which hard drive to partition. Select the drive (be aware that multiple disk RAID configurations may show up as only one drive) that you want to partition for the server to use and hit Enter. The next and final Partition disks screen is a confirmation screen confirming the partition configuration that you just set up. You will see more than one partition (there should be a swap partition in there somewhere), and that's normal. Hit the Left Arrow to go over to Yes and hit the Enter key. You will probably hear the hard drive(s) start crunching at this point while the partitions are created and formatted. Once that step is complete, Xubuntu versions earlier than 8.04 will have you go through a Configure time zone screen, and a Configure the clock screen asking about UTC time. After these screens, you will come to the Set up users and passwords set of screens (4 of them). Enter whatever user name and password information you want here, just make sure you remember it for later. Beginning with Xubuntu 8.10, home directory encryption became an option, so if you're running 8.10 or newer, you will see an encryption screen next. Whether or not you choose to encrypt your home directory is up to you. I personally would not for this server, since encryption is designed to protect your data in the event a computer itself is stolen. This is more of a concern with laptops. Once you're done with that you will see the Configuring APT screen, which may ask you if you use a proxy server (on newer versions). If you don't have a proxy server just hit Enter. The system will configure apt, and then the Select and install software screen will come up. All of this part of the setup is automated, so get yourself a cup of coffee, its gonna take awhile. The Building LTSP chroot... (Building Thin Client System... on newer Xubuntu versions) step may error out at 50% done, and if it does you'll see the RSOD (Red Screen of Death) in Figure 2.
If you see this screen, don't worry. Just hit Enter to Continue, and then hit Enter with Build LTSP chroot selected on the Ubuntu installer main menu screen. Once you are done installing and the server has rebooted, check out our post Build chroot Fails During LTSP Server Install which will walk you through the process of redoing this step. Next you'll see the Installing GRUB boot loader screen, and the the Finishing the installation screen just before the CD ejects and a screen asking you to Continue to complete the installation comes up. Take the CD out and hit Enter to restart the computer.
Set Up the Server Environment
The first thing you want to do is ensure that your X Terminal works (Application -> Accessories -> Terminal in the default XFCE setup). There is a problem with XFCE that some people (including us) have experienced where trying to launch and X term will cause XFCE to exit out to the login screen. If you try to launch the XFCE Terminal (or any other terminal for that matter) in XFCE and it crashes, check out our post entitled "XFCE Terminal Crash Fix" to remedy the problem. Once you have a working X Term, we can move on.
Assuming that you are at the Xubuntu logon prompt, type in the user name and password combo that you set up during the installation and log in. The first thing that I would recommend doing is shutting down the DHCP server daemon that should now be running on your LTSP server. This is just a precaution to make sure that no DHCP clients accidentally get an IP address from your server instead of your network's primary DHCP server. If all of the computers on your network have static IP addresses, you should be able to skip this step. To shut down the DHCP server, open an X Term and type sudo /etc/init.d/dhcp3-server stop and hit Enter. You should see the message in Figure 3.
Once this is done, you have two different paths you can take. If the LTSP installation went fine without the Red Screen of Death telling you the Build chroot step failed, just continue straight on to the end of this. If the installation failed on the Build chroot step, just follow the directions in the post entitled Build chroot Step Fails During LTSP Server Install and then come back to this post and continue from this point.
The next thing you want to do is set your server up to on it's own physical network. Once you have that done, you can start adding the LTSP client computers as well. You could also just leave it on a network that already has a DHCP server (like the one you're probably already on), but the issues surrounding that type of setup will have to be covered in another post. Once you have the server isolated on its own network, its time to set a static IP for it. Open the network settings dialog (Applications -> System -> Network) double click on your main network connection (Wired connection for me). On newer versions of Xubuntu, you may have to right click on the network manager icon in the system tray and then click Edit Connections... .Take a look at Figure 4 to see what I'm talking about.
Once the settings dialog comes up for that interface, change the Configuration: drop down box to Static IP address, and enter your static IP address information. Just for your information, I used 192.168.0.1 for the IP address, 255.255.255.0 for the Subnet mask, and 192.168.0.1 for the Gateway address. Have a look at Figure 5 to see what I mean.
Notice that the Gateway address is the same as the IP address in this case. I did this because this is a simple (and hopefully well generalized) procedure, so I didn't worry about getting the LTSP server on the Internet. If you need it to be on the Internet, just add the actual address of the gateway on the network, or leave it as the LTSP server if you're making it the gateway too. Once you have set the static network configuration, hit OK and then click Close on the Network Settings dialog box. Open an X Term and type sudo /etc/init.d/dhcp3-server start to start the DCHP server back up again.
Now, set up a client on the same physical network (by physical network I mean the same network switch or router by the way), set it to boot from the network, and try to boot it. At this point the client should boot off of the LTSP server you have set up and will eventually bring you to an X desktop (assuming you don't have any video issues). If things don't work out for you and the client won't boot, see the section below called So Its Broke and You Want to Fix It for help. You will see the Ubuntu load and logon screens when the client boots up but don't worry, this is normal. Once you log on it will be just like the Xubuntu environment that you set up on the server. Go ahead and log on to your new LTSP client-server setup using the user name and password you set up for the client and reap the fruits of your labor.
Something to note here is that the easy way to make changes to the client user interface (XFCE or otherwise) that the LTSP clients will see, is to log on to the server with the client's user name and password and make the changes. The next time you boot your client, it should reflect the changes that you have made on the server. You can use some of the other tips, tricks, and fixes on this blog (i.e. "LTSP Client Shuts Down Server - The Fix") to help you set up a workable, stable environment for your users. Also, since we all know that these types of procedures are almost never a "one size fits all" type of thing, see the "So Its Broke and You Want to Fix It" section below if you need it. Otherwise, enjoy.
So Its Broke and You Want to Fix It
If you've done everything in this post so far, but you're still having problems, you've come to the right place. I'm going to go through a few things that have given us fits in the past.
First, open an X Term and type sudo ifdown eth0 (where eth0 is the name of your main network card) and then type sudo ifup eth0. This will shut down and then bring back up your network interface, updating it with the changes you have made. Restarting the computer will have the same effect if you don't know the name of your network interface.
Second, please check your physical network setup and connections. I can't tell you the number of times that we (meaning me) have thought I had a broken LTSP server when it was just a network connection that I either forgot to hook up, or a switch that I forgot to plug in.
Third, if your client will not do a network boot correctly from the server, check to make sure that you have the BIOS set up to do a network boot. This can be a pain on some computers like the Dell Optiplex GX100 (who says you can't reuse an old computer huh?) that I'm using as my test bed to write this blog. In order to even get the option to use the network interface as a boot device, you have to enable an network interface option that says On w/ MBA in the BIOS. Thanks for that extra step Dell, my life wouldn't have been complete without it. Also, make sure that your network interface supports the protocols being used to boot off of the LTSP server (i.e. PXE). If it doesn't , get yourself another network card or computer that will work. Once you're sure of all this, check the next step.
Fourth, Xubuntu uses the H. Peter Anvin version of tftp (tftp-hpa, and thank you Mr. Anvin). This version of tftp responds to a switch (-s) that prepends a path onto the beginning of the path that the client uses for its download. If this isn't set right, you will get a file not found TFTP error on your client during the net boot. Check your /etc/ltsp/dhcpd.conf file along with the tftpd entry in your /etc/inetd.conf file to make sure that the path after the -s switch, plus the path to either of the image files (pxelinux.0 or nbi.img) in the dhcpd.conf file adds up to a valid path to your network boot image files. For instance, on the LTSP system that I set up while writing this, the complete path from adding the tftpd and dhcpd.conf entries was /var/lib/tftpboot/ltsp/i386/pxelinux.0. It could also be /opt/ltsp/i386/boot/pxelinux.0 too and it wouldn't hurt anything. They are the same file. Verify that this path points to a valid image on your system. If it does not, I would suggest searching the root (/) directory for the pxelinux.0 file (or the nbi.img file if you're not using a PXE enabled client). While you are in the dhcpd.conf file, take a look at the bottom and you'll notice the entry option root-path "/opt/ltsp/i386"; or something similar. This is that chroot(ed) directory that we set up earlier that will act as the root directory for your LTSP clients.
If this post was helpful to you and you liked it, let us know in the comments. If you didn't like this post, Boot wrote it and posted it under my name.