Installing a ‘netbooted fat client’ with Nubae’s Scripts

May 11th 2009
Richard Braddock
3 Comments
respond
trackback

There are quite a few approaches to installing local apps on thin-clients, and your mileage may vary with any of the techniques. For the purpose of my scenario, I’d like to put as many apps as possible on the fat image whilst retaining the central management that my Edubuntu LTSP server provides me with. For this reason, I’ll be using the scripts of Linux coder David Van Assche, a.k.a Nubae. This walk-through is intended to supplement the guide you can find over at his personal site in creating a ‘netbooted fat client’. Code is highlighted.

1.    You should first expand your virtual hard drive to at least 16GB to accommodate the new chroot.

2.    Open a terminal and run
sudo apt-get install portmap nfs-kernel-server nfs-common

3.    After installation has concluded type the following into the terminal:
echo “/home SERVERIP/NETMASK(rw,no_root_squash,async)” | sudo tee -a /etc/exports /dev/null
Take care to replace SERVERIP/NETMASK with the appropriate values. In my tutorials I’ve been using a server IP of 192.168.1.151 with a netmask of 255.255.255.0.

4.    One last command here – run:
sudo exportfs –a

5.    It’s vital that you’ve performed the above correctly. Failure to do so will cause the home filesystems not to be mounted when using your fat client, which will cause you not to be able to get to the desktop at all!

6.    Now download the fat client script from Nubae or from our mirror. I’ll presume you’re saving it to the desktop for the purposes of this guide. If like me you are using a single NIC setup you’ll want to edit this file to alter what it perceives to be which interface. I have included the excerpt below to help convey what I changed. You’ll notice we’re telling it that eth0 is actually eth0, and then asking it to use the IP address of that interface (the server IP) to mount the network file system. I must admit, I completely missed that the first time around, and was met by the system that booted but that wouldn’t mount the home directories, simply because I didn’t have an eth1, thus no IP was copied into nfsmounts.sh

eth0=$1
shift
eth1=$@
### Add nfs startup script for lts.conf
cat <<EOF >> /opt/ltsp/$CHROOT/etc/nfsmounts.sh
# nfs starts before portmap so mounts fail, so we restart portmap here
/etc/init.d/portmap restart
mount -t nfs $eth1:/home /home

7.    Place this edited file inside
/usr/share/ltsp/plugins/ltsp-build-client/Ubuntu/030-fatclient

This folder requires root permissions to manage, so it’s best achieved through the terminal by running sudo cp ./Desktop/030-fatclient /usr/share/ltsp/plugins/ltsp-build-client/Ubuntu

8.    A quick note here. When I installed the scripts at my most recent attempt (for this tutorial) the mozilla-acroread and acroread packages were broken. You can simply replace these with another open source PDF reader like FoxPDF..

9.    With the file copied, it is ready to be executed. We’ll be preparing a high-fat client here, so again at the terminal we execute sudo ltsp-build-client –chroot name-of-chroot –fatclient Ubuntu –highfat

Again, ensure you change the option that requires user input, in this case, the name of the chroot is italicised. The regular thin client chroot is simply named i386 so it would seem logical to prefix that with ‘fat’ or similar.

10.    If you’ve used the correct syntax you will see the terminal start to output lines signalling that software packages are being pulled from various repositories. This could take quite a while depending on your Internet connection, so put your feet up and relax!

11.    The next step is telling the DCHP server we worked with earlier in the documentation which machines need to be delivered the new chroot. To do this, we re-enter the dhcpd.conf file, accessible by running the following command from your terminal
sudo gedit /etc/ltsp/dhcpd.conf

12.    I’ve included my dhcpd.conf file below for reference. Remember that it’s setup for a single NIC environment and in this case a single thin client & two fat ones.

#
# Default LTSP dhcpd.conf config file.
#

authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-name “edubuntu.localhost”;
option domain-name-servers 192.168.1.1;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
#    next-server 192.168.1.254;
option subnet-mask 255.255.255.0;
pool {
allow unknown-clients;
range 192.168.1.160 192.168.1.200;
}
}

# regular thin clients
group {
deny unknown-clients;
get-lease-hostnames true; ### make sure you’re /etc/hosts contains all the hostnames of the clients
if substring( option vendor-class-identifier , 0 , 9 ) = “PXEClient” {
filename “/ltsp/i386/pxelinux.0″;
} else {
filename “/ltsp/i386/nbi.img”;
}
option root-path “/opt/ltsp/i386/”;
host thinclient1 {
hardware ethernet  00:FF:1E:00:00:00;
fixed-address 192.168.1.161;
}
}

# fatclients with highfat
group {
deny unknown-clients;
get-lease-hostnames true; ### make sure you’re /etc/hosts contains all the hostnames of the clients
if substring( option vendor-class-identifier , 0 , 9 ) = “PXEClient” {
filename “/ltsp/fati386/pxelinux.0″;
}
else {
filename “/ltsp/fati386/nbi.img”;
}
option root-path “/opt/ltsp/fati386/”;
host fatclient1 {
hardware ethernet  00:15:C5:00:00:00;
fixed-address 192.168.1.171;
}
host fatclient2 {
hardware ethernet  00:15:C5:00:00:00;
fixed-address 192.168.1.172;
}
}

13.    If you have made changes, remember to save and restart the DHCP server by issuing sudo invoke-rc.d dhcp3-server restart or sudo /etc/init.d/dhcp3-server start

14.    The final step is to alter your hosts file to match hostnames to IPs. The markup in Nubae’s sample DHCP script (above) prompts you to so this, but it’s easily forgotten. Use sudo gedit /etc/hosts to open the text file in question and use an identical syntax to the localhost entry; that is:
IP    HOSTNAME

15.    It was at this point that I booted a prospective fat client and finally got up and running. Just a couple of things were left to irk me.

a)    There was no sound
b)    Flash based videos weren’t playing. This is to say, flash was rendering the window replete with controls and progress bar, but not the content.

16.    To fix the sound issues, we need to ensure pulseaudio is using the local machine as its server (it’s running locally now remember). We use nano because it’s a text editor that doesn’t need a window manager.
nano /etc/pulse/client.conf
Add these lines:
default-driver=pulse
default-server=127.0.0.1

17.    To fix the flash issues, I first attempted to copy update the sources list on our server, and copy that over to the chroot in question. Then we enter the fati386 image, purge the flash package, clean up all sight that it ever existed, and then update our sources from the list we just copied. Armed with updated repositories we should be able to issue a simple install command for flash 10 to be added successfully. By the way, remember that all these commands are issued on the server. Also, for those wondering, the reason we’re so exhaustive with these steps is to ensure the install goes off without a hitch; because there were a catalogue of errors in older sources lists that caused the process to fail.
sudo cp /etc/apt/sources.list /opt/ltsp/fati386/etc/apt/
sudo chroot /opt/ltsp/fati386
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get –y –purge remove flashplugin-nonfree
wget
sudo apt-get install flashplugin-nonfree

However, it should be noted that I did not manage to get flash successfully working. By reinstalling flash I even managed to make firefox lock up completely every time it visited flash based sites.  I attempted downloading the .deb straight from Adobe and even compiling from source but still came up against the same problems. Obviously this is far from acceptable, and I will revisit thie segment once I have found a solution!

18.    At this point we can exit the chroot environment by issuing exit or hitting Control + D

19.    Lastly, we need to update the squashfs image that is eventually delivered to our fat-clients, otherwise none of these changed will make it onto our machines (which will need rebooting).
sudo ltsp-update-image -a fati386

20.    And there you have it. Fat-clients with local processing. As I have said, once I find a fix to the flash woes, I’ll amend this piece.

Show Sources »

[1] Van Assche, D. (2009) LTSP netbooted fat client. [Internet] Available from: <http://www.nubae.com> [Accessed 11th May 2009]


3 Comments

  1. Live

    Hi, THANK YOU for explaining How To setup an LTSP Fat client with details.

    Can I ask a question?

    I’m using Ubuntu Jaunty 9.04 Desktop as my LTSP server.

    When logging as THIN clients, there’s no problem, I can do it thanks to your wonderful guide.

    However, I wanted to try the FAT client. I followed Nubae’s guide STEP by STEP: http://www.nubae.com/ltsp-linux-terminal-server-project-netbooted-fat-client-for-ubuntu-hardy-and-intrepid.

    I also used the UPDATED Jaunty script, but I STILL can’t get it to work.

    When I login my FAT client, it says, “Your home directory is listed as: ‘/home/user1′ but it does not appear to exist…”.

    I’ve searched a lot in Google about this, but since I’m a newbie, couldn’t understand what they’re suggesting.

    Can you teach me a STEP by STEP process on how to do ELIMINATE the HOME Directory Problem?

    I have a basic idea about ETH1 being used instead of ETH0, my NFS shares NOT being mounted to clients, or I need to MODIFY your script.

    However, I don’t have a clue on these since they’re QUITE Advanced for ME, is there a SIMPLE way to enable fat clients to use their HOME folders?

    Do I just need to modify a /etc/ configuration? Enter my SERVER IP somewhere or replace ETH1 by ETH0? I’m sorry for being a newbie, that’s why I really wanted your help.

    Also, I already followed these:

    sudo apt-get install portmap nfs-kernel-server nfs-common

    echo “/home 192.168.2.0/24(rw,no_root_squash,async)” | sudo tee -a /etc/exports /dev/null

    sudo exportfs -a

    But still getting the error message.

    Hoping for your kind answer. I’ve been on this home directory issue for 3 weeks and can’t get it to work! =(

    More power to your blogs!

    ReplyReply
  2. @Live: Hi there. This is a difficult one because it’s been so long since I last worked on this.

    From memory, the home directory problem you describe is due to not performing steps 2-4 quite correctly.

    You seem t have used an invalid IP as your server (192.168.2.0) and also not specified a subnet mask. You need to amend this to follow the format below

    echo “/home SERVERIP/NETMASK(rw,no_root_squash,async)” | sudo tee -a /etc/exports /dev/null

    So in my case:

    echo “/home 192.168.1.151/255.255.255.0(rw,no_root_squash,async)” | sudo tee -a /etc/exports /dev/null

    ReplyReply

Leave a Reply