How I Spent My Summer Vacation: Bringing Linux to Nicaragua, Part II
August 2nd, 2004 by Kevin Brandes in
Editor's Note: In Part I of this article, Kevin explained how he ended up spending his summer in Nicaragua and why Linux is finding an audience there. Here, he discusses some of the technical aspects of his work.
As for what I've actually been doing down here, the most significant project to date is getting diskless clients to run with our current install, SuSE 9.0. Diskless clients are important to us because it gives us a clear advantage over Windows when marketing to local businesses and schools. Instead of trying to roll it myself, I decided I might as well utilize the years of work that have been put into the LTSP project and chose the LTSP 4.0 release for this project.
The first part of understanding diskless clients is knowing how they boot. Because they have no hard drive, they have to access booting information over the network. The LTSP documentation covers the booting process in detail, but here's a summation:
Machine goes through its POST (power on self test) and then looks for ways to boot.
If the network card is capable of booting, the machine tries to boot off of it.
The card then sends a DHCP request out on the network. This request includes the MAC address of the network card. This is how the whole process really starts.
The dhcpd daemon on the server receives this request and looks through its configuration file for an entry matching the MAC address of the client.
The dhcpd daemon then responds to the client with the following information: IP address for the workstation; NETMASK setting for the local network; path name of the kernel to download; path name of the root filesystem to mount; and optional parameters to be passed to the kernel, using the kernel command line.
The network card receives this information and configures its TCP/IP appropriately.
Using TFTP (trivial file transfer protocol), the boot loader downloads the kernel, places it into memory at the correct location and hands control over to it.
The kernel then initializes the system and peripherals.
As part of how LTSP works, a filesystem image resides on the end of the kernel command line. The kernel grabs this image (again using TFTP) and decompresses it into memory.
We give a root=/dev/ram0 argument to the kernel such that it runs its root filesystem off of the image just decompressed into a RAM disk.
From there, the kernel continues booting. Once it's ready, it starts X, if you have the X package installed.
A request is sent to the login manager on the server (in my case, KDM), which then responds and allows the remote machine to log in.
When you're sitting in front of the diskless client, it appears as though you are using the server.
That's the basic idea of how this process works. The LTSP documentation goes into much more detail towards the end of the list, but for our purposes, this level of detail is sufficient. We now can configure each of the pieces in order; the machine will get closer and closer to functional as we go along.
The first thing to do, as far as I'm concerned, is make sure the network card in your client is capable of booting from the network. This is accomplished in two main ways, either by PXE (Preboot eXecution Environment) or by etherboot. Because the network cards on my clients already were PXE-capable, I went that route. If your network card does not support booting off of the network, ROMs are available for purchase that enable your card to do so in most cases. Often, though, it's cheaper simply to buy a new network card. I recommend Realtek 8139 cards, as I've always had good experience with them. In my experience, however, any modern network card has a bootable ROM.
Also, it is imperative that you understand that all of this configuration is done on the server--not on the client. The client has no hard drive, so it can't store settings. The client will be more successful continually as you go along configuring the server.
Once you've established this setup is possible with your current equipment, the next step is to configure the dhcpd daemon. First, you need to make sure that dhcpd is installed on your system. It's usually installed with the Server group of packages or something akin to that. You can find out for sure if it's installed by typing whereis dhcpd on the command line. On my SuSE 9.0 system, it's installed as /usr/sbin/dhcpd.
You also want to make sure the daemon starts every time you boot. The way this is accomplished on every system is different, so I'll leave you to your distro's documentation. In SuSE 9.0, it is accomplished by utilizing the DHCP configuration module of YaST, under Network Services. Instead of talking about how to get all the correct values in the config file with YaST, I find it easier simply to edit the file by hand. If you're using SuSE, you must be careful not to re-run the DHCP module, as doing so overwrites your changes.
Here is the dhcpd.conf I currently have:
/etc/dhcpd.conf
ddns-update-style ad-hoc;
allow booting;
allow bootp;
subnet 198.186.207.0 netmask 255.255.255.0 {
range dynamic-bootp 198.186.207.128 198.186.207.254;
default-lease-time 21600;
max-lease-time 43200;
}
group{
next-server 198.186.207.124;
filename "pxelinux.0";
option root-path "/opt/ltsp/i386/";
host cieba {
hardware ethernet 00:E0:4C:84:3E:58;
fixed-address 198.186.207.127;
option host-name "cieba";
}
host chilamate {
hardware ethernet 00:E0:4C:84:9A:67;
fixed-address 198.186.207.123;
option host-name "chilamate";
}
}
If you wanted to allow the clients to have dynamic IPs--it doesn't really matter, as they're merely thin clients--you should set up the file like this:
ddns-update-style ad-hoc;
allow booting;
allow bootp;
subnet 198.186.207.0 netmask 255.255.255.0 {
range dynamic-bootp 198.186.207.128 198.186.207.254;
default-lease-time 21600;
max-lease-time 43200;
}
next-server 198.186.207.124;
filename "pxelinux.0";
option root-path "/opt/ltsp/i386/";
Make sure the IPs your network uses are what you put in the range and fixed address areas, if you're using them. I wish I could give more direction in this area, but it really depends on your network setup. On most home networks, this is 192.168.1.1??.
The most important parts of this file are the next-server, filename and option root-path values. The Linux kernel as a whole is too large to be loaded directly by PXE on the network card. So, to accomplish this, we use a boot loader called PXE Linux. It's included with LTSP. This is the pxelinux.0 file that's referenced under the filename marker. The root path is standard for an LTSP implementation.
As for the clients, the hardware Ethernet option is the MAC address of the network card. This can be found using /sbin/ifconfig. I've elected to give the hosts static IPs, but this isn't mandatory.
Once you have your dhcpd.conf file edited appropriately for your network, it's time to restart the dhcpd daemon to apply the changes. On SuSE, rc<name of service> restart restarts any system-wide service, so go to a command line as root and issue the command rcdhcpd restart. On Red Hat-like systems, this is accomplished with service dhcpd restart. Once the daemon's restarted, start your client on network boot, configured in the BIOS, and see how far it gets.
You most likely will get a TFTP error of some kind. Your client has grabbed an IP address--static or dynamic, depending on your dhcpd.conf file--and should tell you what it is. Verify that everything fits your network. If you go back and revisit the boot sequence, you can see that it's time to configure TFTP on the server.
In SuSE, this step is dead easy. Open YaST -> Network Services -> TFTP Server. Select Activate and leave the default directory of /tftpboot. Don't worry if it doesn't exist, YaST will create it for you. Click Finish, and you have TFTP configured. If you navigate to the root (/) directory, you should see the appearance of /tftpboot. If you're using a different distro, you may have to install a TFTP server package, configure it and get it going, I can't really help you here. Consult forums and mailing lists, and good luck.
If you restart your client now, you should get a TFTP: File not found error error. This is because the pxelinux.0 file it's looking for (from dhcpd.conf) is not there. We're using LTSP 4.0, but the LSTP 3.0 initrd kits work fine. These are files that contain the necessary components to boot an LTSP system. Download this tarball, and you'll find a file called pxelinux.0; move it to the /tftpboot directory. Now, we must configure the PXE Linux boot loader, which is done on the server.
In the /tftpboot directory, make a subdirectory called pxelinux.cfg. The boot loader searches this directory for a config file named after the MAC address of the network card in multiple ways. I found that I didn't need separate files for the clients, so I used only one file, called default. This file is much like a LILO config file. Place the following lines in the file, using your favorite text editor:
/tftpboot/pxelinux.cfg/default
prompt=0
label linux
kernel <kernel image>
append init=/linuxrc rw root=/dev/ram0 initrd=<initrd image>
where <kernel image> is the name of the kernel image and <initrd image> is the name of the initrd image included in the initrd kit. The kernel should be named bzimage something and the initrd image is initrd something.gz. Please don't use the LPP (Linux progress patch) kernel until you're sure everything works correctly; it has lpp in its name. This process displays a nice progress bar, which is wonderful--unless something goes wrong. In that case, it's far more useful to have the kernel messages.
Next, you need to place the kernel and init images in the /tftpboot directory. Do not place them in a subdirectory, simply in the /tftpboot directory. If you boot up your client now, you should see it try to mount the root filesystem and fail. That's because it doesn't exist yet; it comes from installing LTSP on the server.
The LTSP team has done a fantastic job of making this step as painless as possible. The install process is described on the LTSP site; it installs LTSP to /opt/ltsp/i386.
Go through the installer again, but this time select the X package instead of the base package.
Make sure the LTSP install path (the default is /opt/ltsp/i386) is exported by way of NFS, or your client will not be able to mount the root filesystem. This means you need to configure NFS if you haven't already done so. Again, this step is dead easy on a SuSE system; all you have to do is utilize the appropriate module is YaST.
The client now should boot up to a grey screen with an X mouse cursor; alternatively, you may get a login screen. If you got the login, you're done. Otherwise, you're almost there. Whether you get a login is dependent on whether the login manager on the server is set up to accept remote connections. f you didn't get a login screen, then most likely your login manager is not configured to accept remote logins. On SuSE, go to YaST, System, /etc/sysconfig Files Editor, find Desktop -> Display Manager -> DISPLAY_MANAGER_REMOTE_ACCESS and set it to Yes. Your client now should boot up into a fully functional desktop, as if you were sitting at the server.
If you aren't using SuSE or if YaST leaves you in the cold, the configuration file for KDM is located at /etc/opt/kde3/share/config/kdm on a standard directory structure. If you use Red Hat or another non-standard distro, then I can't help you. Check your documentation. Once your login manager accepts remote connections, you should have a fully functional thin client.
If you want to limit access to certain parts of the KDE desktop--if, for instance, you're setting up an Internet café, then you should use Kiosk mode. A Kiosk mode editor is available for SuSE 9.1 or KDE 3.2.2, which greatly simplifies your life. Otherwise, you can create a user and then edit the configuration files by hand. The KDE team has a HowTo on this subject on its site.
Special Magazine Offer -- 2 Free Trial Issues!
Receive 2 free trial issues of Linux Journal as well as instant online access to current and past issues. There's NO RISK and NO OBLIGATION to buy. CLICK HERE for offer
Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.
Sorry, offer available in the US only. International orders, click here.
Subscribe now!
The Latest
Featured Videos
Linux Journal Live - Oct 2, 2008
October 3rd, 2008 by Shawn Powers
The October 2, 2008 edition of Linux Journal Live! Associate Editor, Shawn Powers, and Steven Evatt, Online Development manager for The Houston Chronicle discuss surviving disaster with Linux.
Mastering IPTables, Part I
October 2nd, 2008 by Elliot Isaacson
Linux comes with a powerful firewall built-in, although the interface can be a little intimidating. This is the first in a multi-part tutorial on how to master basic and not-so-basic IPTables functionality and create the perfect firewall for your home network.
Recently Popular
From the Magazine
November 2008, #175
There aren't many numbers that put the US national debt to shame, but here's one: 1,100,000,000,000,000. What's that? That's how many floating-point operations per second the Roadrunner supercomputer at Las Alamos can perform. That's about 100 FLOPS per dollar of US debt (unfortunately, the debt is winning the second derivative race). Read the article about Roadrunner in this month's High Performance Computing issue of LJ.
Along with that, find out how to program the Cell processor and how to use CUDA with your NVIDIA GPU. Also in this issue: Mr HandS (aka Kyle Rankin) gives us a few tips on using Compiz, Chef Marcel shows you how to get blogging off your plate quicker, Mick Bauer talks about Samba security, Dan Sawyer interviews Cory Doctrow and Doc talks about how information technology can affect democracy and fix the national debt (just kidding about that last part). That and more for your reading pleasure in this month's Linux Journal.
Delicious
Digg
Reddit
Newsvine
Technorati








thanks
On September 27th, 2006 kamlesh (not verified) says:
it is working
From Panamá
On April 2nd, 2006 Okke Ornstein (not verified) says:
I've read this story with great interest. I'm a Dutch journalist living in Panama and my wife owns an internet cafe. I spent the last two weeks looking at Linux solutions to the Microsoft nightmare, and had already done a test with Skolelinux. But I think we'll go for Ltsp. It's not that I specifically like the weird commands and sometimes strange and incomprehensible installation procedures that come with Linux - I'm actually a happy Apple user but that is a too costly option for a cyber cafe in this part of the world, unfortunately.
That said, I must say that the developers for these school systems have done a great job to make everything as easy as possible even for illiterates like me. This really is great stuff for countries like ours.
And, I found a billing solution for cyber cafe's using thin clients at http://www.silentcoder.co.za/tiki/tiki-index.php?page=DireqCafe
Okke Ornstein
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 13th, 2004 Anonymous says:
Good work.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 5th, 2004 Anonymous says:
It's fine to meet same people interest in an altruistic mision ..... why don't you try:
Thinstation.sf.net
No NFS needed
all pre-processed ....No need to install compile....etc an best of all
a la carte prebuilt iso images ......
Ask 4 more .... pxes.sf.net .... looks alike
Karlitros
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 6th, 2004 Anonymous says:
We decided to use LTSP because we wanted the users to be able to just sit down and use it like it was a normal computer. No VNC, no starting other programs, just sit down and use it.
That said, LTSP doesn't involve any compiling. And especially with the release of 4.1, the installer is cake (albeit English Language Cake), by following their documentation and/or this article, thin clients are easy. Just a few steps, that's all. (But that's what YaST is for, right?) :-D
Kevin
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 4th, 2004 Anonymous says:
My question is, was Suse speaking Spanish to these people or did
they have to learn enough English to know what's happening?
Installing in Spanish
On August 5th, 2004 Anonymous says:
You can install in any of about 40 different languages. You can also configure KDE on a per-user basis. SuSE offers distributions with the manuals in Spanish.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 5th, 2004 Anonymous says:
Most linux come in different languages. I am in Mexico and I have SuSE but mostly running in english however I remember that I could enable the spanish module.
I used to have mandrake, and they run on a wide array of languages including some not so popular african and indian dialects.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 4th, 2004 Anonymous says:
It'd be worth looking at Skolelinux. It does all this setup straight out of the box and is aimed directly at schools.
GMc
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 4th, 2004 Anonymous says:
K12LTSP is better in my opinion. It is the most popular LTSP + OS solution out there. It is based on Redhat, has a whole bunch of educational software included and is a turnkey solution if you have a pci nic and video card. They have also been arround a long time.
How do you get a job like this?
On August 3rd, 2004 Anonymous says:
I'd be very much interested in how to get a job installing Linux systems in rural areas and Southern countries. I'm a CS student and part-time Linux professional in Germany and I'm looking for something like this.
Are there any job offers on the Internet? I'm especially interested in jobs in South America.
Any hints?
PS: My Spanish is better than my English... ;-)
Re: Linux volunteers wanted
On August 11th, 2004 Anonymous says:
Hello,
I am working with a non profit organization in Tanzania-East Africa that is looking for volunteers to introduce linux in the region.
For more info,please contact:joseph@icarusnetworks.com
Thank you.
Re: How do you get a job like this?
On August 6th, 2004 Anonymous says:
I got this job by responding to an online job posting on a local LUG. Just keep looking, it'll jump up and slap you in the face. :-)
Kevin
Re: How do you get a job like this?
On August 6th, 2004 Anonymous says:
Try idealist.org, there might be something.
Re: How do you get a job like this?
On August 5th, 2004 Anonymous says:
I think there was this organization called geek---sumthing... that were dedicated to bring IT to third world countries. They have rural areas in India and Ghana as well as other countries. I am sorry I dont have the name but it was a very similar name to another organization that brought education to third world coutries, but it wasnt geek-peace nor geek-unicef ... google might help you.
Re: How do you get a job like this?
On September 3rd, 2005 Clay (not verified) says:
I think you are are talking about http://www.geekcorps.com/
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 3rd, 2004 Anonymous says:
Boring.........................Show us some REAL Articles....
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 4th, 2004 Anonymous says:
Let's see. The poster is spreading Linux, is helping children with education, is making a cost savings argument for Linux, is helping the poor, and is donating his time to do something good. The author is giving back, so to speak.
The inspiration in this article is enough reason to justify writing and reading it. Not to mention, the author is also promoting LTSP, which is used in many a school.
The "Boring.........................Show us some REAL Articles...." rant was just a waste of bits and shows a complete lack of imagination and inspiration.
Thank you, Kevin Brandes, for donating your summer to the children of Nicaragua. I look forward to being inspired further! I feel challenged to do what you are doing.
OK, Anonymous, what are you going to do for the good of others? (In other words, put up or shut up.)
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 5th, 2004 Anonymous says:
The fact of the matter is that this article should have been in Reader's Digest and not Linux Journal. I hate people who try to mix politics and humanitarianism with computing. If you want to save the world fine, I'll cast a vote for you to receive a Nobel Peace Prize. Computers are not about Race, Religion, Politics, Humanity or anything else. We're not trying to save the world, we're doing what we love. All I'm saying is that I would prefer technical articles to people who believe they made some type of real contribution to the world by setting up a Linux Server and feel they should get some type of recognition for it. Linus wasn't trying to change the world, neither were Dennis and Ken, they were just doing what they liked and weren't trying to get recognized by anyone.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 10th, 2004 Anonymous says:
It's silly that I'm even replying to this, but there is a good point to be made. How many times has Microsoft used helping the poor as a PR move?
Obviously, you haven't read Linux Journal for very long.... Linux Journal has *plenty* of these types of articles, over the past few years, but they could do even more. (Thank you, Linux Journal). Inspiring articles tend to motivate people, promote good will and humanity, and garner support.
I can't see how you justify your position. It sounds like all you want is a dull, dry technical journal, which is uninspiring, does not promote good will and humanity, and does not garner support. There are plenty of HOWTO's and man pages on the 'net, in this vein. See http://www.google.com/ for more information about how to do Linux Terminal Servers, if you don't like it.
It sounds like you are motivated by selfish motives -- what you want, not what can be done for the good of others. The author of the article, and most of the responders, so far, see the value in helping others, for its own sake. In addition, though, it was a good thing that Linux got the case study, got people into license compliance, and gave poor people tools they didn't have, wasn't it?
Obviously, the editors of Linux Journal see it that way, too. Heck, the LTSP thinks so, otherwise what's this K12 project they got going!?!?! Take a look at how LTSP helps schools. Get inspired by THEIR articles while you're at it.
If we can mix the technical side with the human side, there is no down side, correct? If you don't think so, then are you really human, or are you just somebody that doesn't want to face the world and help people with real problems? Chip in and help where you can, why don't you?
Some day, when you die, what do you want people to say aboubt you, during this life? I'd certainly rather people say something like, "He was a humanitarian. He helped uneducated people learn how to read and write and use computers," than to hear people say, "He sure liked reading his technical manuals." Wouldn't you? (In case you think I'm being overly dramatic, think again and reread the main article.)
If LJ isn't a place for this, could you name a place for it? (The correct answer, of course, is "No.")
It was so nice to see yet another article in LJ where somebody uses Linux to help people. Thanks again for promoting good will, Linux Journal. I can't wait to see plenty more of these articles. (Remember, too, that LJ is running a MAGAZINE with a corresponding web site, not a FAQ/HOWTO site....)
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 10th, 2004 Anonymous says:
Like I said, if you want a Nobel Peace Prize I'll cast a vote for you, but I doubt you'd win. I hate these posers trying to turn computing into some type of Noble Cause mainly due to the fact that they have nothing else to do. This article was dull because it lacked any insightful information, which most people come to expect from Linux Journal. With all the heart felt reasons you gave in your last post, you should go work for the UN and stay away from the Computer Industry.
My $0.02
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 26th, 2004 Anonymous says:
what a jerk!
I am willing to bet you're a Script Kiddie wanna-be that sits at home and runs linux because it is L33T, not because you actually care about supporting the Open Source cause or anything that the GNU or GPL Licenses embody.
I agree with the rest of the people who had comments to make about your original post, I enjoyed reading this article, and I think what this person is doing is great. What you are failing to see is that People like this are the ones who will help us ultimately bring Linux to a position where it is as well known as Windows, or MacOS.
and for the record No I don't want a Nobel Peace Prize.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On September 20th, 2004 Anonymous says:
Also, for the record, I wrote this article because it was asked of me by my boss, the publisher of Linux Journal. I was not attempting to attract attention, but rather, to fulfill my commitment to my employer.
That being said, it was a wonderful experience, and I'm sure many will enjoy reading about it.
Kevin
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 5th, 2004 Anonymous says:
I'm pretty sure that Linus Torvalds would be delighted to hear that what he started is making a difference in other people's lives. He started Linux as a pet project, probably partly to see whether it could be done, but then he did something amazing: he set it free for all to use and modify, enhance and distribute.
The fact that it makes its way into the third world and enables people over there will eventually mean that it will be improved even further. This will ultimately benefit Linus and all of us as we constantly get better software to use. All this inspires other people to start projects like Wikipedia and Wiktionary. So it doesn't remain confined to computing either.
Nothing boring about that. Interesting things are happening all around us and all of that has become possible thanks to the existence of the Internet. Describing what he is doing and how he goes about it is another great way for the author of this article to give back to the community.
Muchas gracias, (No, mi idioma natal no es el castellano) desde Europa
Jo
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 3rd, 2004 Anonymous says:
I my opinion, it's a GREAT article my friend, I'm on Mexico and in our rural areas we're in the same situation as Nicaragua .
We have a goberment's big project called emexico, but most of it is hooked to M$, just because nobody with the guts has showed the goberment that giving rural people access to IT can be made easy and cheap with Linux.
When I was a student I taught computer basics to kids on a very far town in Queretaro with only a 486, MS-DOS, Works and Banner (can you remember those things?)... it's really amazing how this "trash technology" made a difference in their lifes and education.
I'm training my self to do the same project again but using Linux, so maybe in the future you'll see another boring article "Linux in Mexican rural areas".
Greetings from Queretaro, Mexico.
Quetzalli
PS.. not all of the people in the world does clustering, broadband projects, space research and so on... on my opinion, the beauty of Linux is the power to help people.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 3rd, 2004 Anonymous says:
Do you have any constructive suggestion to the author, who is giving his time & effort to share information? Or perhaps you want to show us your real articles?
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 31st, 2004 Anonymous says:
Hello Kevin,
I am wondering if you found or heard of a good place to find Java programmers in nicaragua. I am looking to develop a small application and I was thinking of nicaragua as a place to do it.
Sherif6@sympatico.ca
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 31st, 2004 Anonymous says:
Hello Kevin,
I am wondering if you found or heard of a good place to find Java programmers in nicaragua. I am looking to develop a small application and I was thinking of nicaragua as a place to do it.
Re: How I Spent My Summer Vacation: Bringing Linux to Nicaragua,
On August 4th, 2004 Anonymous says:
In a sense, he's right. It is, after all, really just a recap of the LTSP docs - so it'll be dead boring to someone who already uses and understands network booted linux thin clients, especially LTSP.
That said, it's well written, concise, clear, and a heck of a lot better than merely a pointer to LTSP. I think the article is well worth while, and certainly doesn't deserve the less than helpful criticism of the OP.
Post new comment