This page is an attempt to document how to put together a complete machine using this distribution. Links are provided to jump to particular sections.
- Required hardware
- Downloading Fold-Server
- Installing
- Installing from CD
- Configuring network adapters with Web-config
- Configuring folding and building the client image
- Testing a client
- Configuring your router
- Reconfiguring
- Getting VNC going or removing it
- Using the web interface
- Using the shell
- Miscellaneous stuff
This distribution is fairly lenient with regard to what hardware is required.
- Fairly recent processor (Pentium-II should be okay)
- 32 MB of ram (more required if folding)
- An IDE hard drive you don't mind wiping (2gb is plenty)
- CD-ROM
- A motherboard which supports booting from CD-ROM
- Two, count 'em two network cards.
The things to note are the network cards. A list is provided of the ones built into the kernel. I tried to pick cards that were common, or at least that I had heard of. If I guessed wrong and you have a card supported by the kernel but not built into mine, please contact me at the link above and let me know. If I get enough requests for a card, I'll build it into the kernel for future releases. You can also try building your own kernel and repackaging; you'll probably want to start from my kernel configuration.
Downloading Fold-ServerThe single file you must download to run Fold-server is an ISO file. It is an image of a CD, which must be burned to CD before use. If you're running Fold-server in a virtual machine, you don't need to burn it, but I'm gonna guess you know what you're doing with respect to that.
Anyways, to burn the CD you will need some CD burning software and an appropriate drive. I suggest that you burn this at a low speed if you're using an old CD-ROM drive, since they can have problems with new media burned at high speeds. It's only 50 MB, anyways, so it won't take long even at slow speeds. With Linux, a line like "cdrecord speed=4 driveropts=burnfree the.iso.filename.here -v" will burn the CD and show you what's going on. In Windows, you're on your own. Nero has a "Burn Image" option under "Recorder" (at least in my version...). I don't have EZ CD creator, but I'd imagine it's fairly eazy. I mean easy. In any case, the goal is to end up with a CD with several files and directories on it, not just one .iso file. If you've burned an image before, you'll be fine; if you haven't, there's an excellent resource for this kind of thing.
Installing Fold-ServerInstalling from CD
Pop the brand new CD into the machine you're going to use as a server. It should boot okay; if not take it back to the machine you burned it on and see what's on it. It should have several files on it, not just one. Other than that, make sure it boots other CDs okay and then give up. Or email me. See the link above.
Okay, now you've got the CD booted. A bunch of stuff will scroll by; don't worry about it. This is normal. When it stops, the last few lines should look something like (except the dates):
Now type "/installer". A little secret here: Just type "/i" and hit tab. It will fill in in the rest of the filename, since this is the only file that starts with "/i". Just one of those nice things about Linux. Press enter and the installer will start. Read everything it prints, and you'll be okay.
Just hit enter.
Hit Alt-F2; you should see something like this:
This means I have one hard disk (hda) plugged in and recognized. Figure out which disk you want to install to, and remember it. Hit Alt-F1 to switch back, and then enter to continue configuring.
Enter the name of the target disk. If you forgot already, press Alt-F1 and Alt-F2 to switch back and forth.
Now switch to console 2 and partition this disk. The optimal setup for fold-server is to have 3 partitions. The first (or hda1) will be for the root, or /, filesystem. The next is the swap partition, similar to Windows' swapfile. The third is for /foldsave, where the progress of the clients goes.
So how do we get here? Here are the detailed steps to set up your disk like this. This will erase all your existing data, be warned.
- If any partitions exist, delete them all by:
- pressing "d"
- entering one of the remaining numbers
- display partition table with p to make sure it's empty (enter "p")
- make a new partition for the root of about 500 MB by typing:
- n for new partition
- p for primary
- 1 for partition #1
- 1 for start of partition
- +512M
- Similarly, make a new partition for swap with around 2*ram:
- n, p, 2, <enter>, +512M
- Make a new partition for /foldsave, with the rest of the disk:
- n, p, 3, <enter>, <enter>
- Make the first partition active
- a for set active
- 1 for partition #1
- Finally, change the type for the "swap" partition:
- t for change type
- 2 for partition #2
- 82 for partition of type "Linux Swap"
- p for display partitions
This is (more or less) what it should look like. The important parts are:
- there are 3 partitions: hda1, hda2, and hda3
- The first is 512ish MB (the size is expressed in K, so this is the 500440 one)
- The second is about twice as big as the ram in the system, 256 mb in this case AND of type Linux swap
- The third is the rest of the disk, of type Linux.
- There's a * indicating active under Boot for the first partition.
On to the next step!
Whatever partition you made type 83, enter it here. If you didn't make one, switch back to console 2 and do it before answering here.
Probably a yes, especially if you just made the partition.
Same deal as two questions ago. Change type if necessary.
Note that you'll have to manually format this partition yourself. In future installs, you won't want to format this partition, since it will contain all of your client data.
This sets the password for the web interface. This is not the password you use to log in with; you may log in with either user "dsl" and blank password, or user "root" and password "Fold@on". You will want to try this interface out; it provides a set of useful services to your whole LAN.
This is the configuration I use, in case you care; in any case, it makes a reasonably sane configuration. Next comes a bunch of output, hopefully with no errors in it. You can use Shift+Page Up and Shift+Page Down to scroll through it. Below is a nominal run (this is what's expected to happen).
This run is from version 0.8; newer versions have slightly different output.
And your system is installed. Now let's see how it works. Eject the cdrom, and type "reboot" to finish the install. After the computer comes back up, log in as "root" with password "Fold@on". The username and password are case sensitive. Then you can work on configuring your new fold-server.
Setting up networkOn one of the computers on your "normal" network, go to "https://" plus the default address of the server (192.168.1.15) and click on the "Change Configuration" link. You set the password during the install pricess. If you'd like to change this password, you'll need to do the following:
You may also configure the server by starting X and using the firefox installed there. It will start automatically if you log in as "dsl", with no password. See more on this topic down at the section about the web-based interface.
Configuring folding and building the client imageWhen the system comes up again, log in as "dsl" (there's no password); it'll start X. If it gets this far, it probably means everything will work. First we'll set up your username and team for FAH. As usual, there's two ways to do this. First, you can run "/root/foldconfig.sh" and follow the instructions. Second, log into the web interface, and click on the "Configure Folding@Home username/team" option. Just in case you couldn't guess.
Next we'll retrieve the Folding@Home client. This will require that your internet connection is active. Below is a complete log of what is output; if you need help getting this to run, skip over the next section and go down one.
If you can't get this going from the above output, here it is step by step.
- First, get into a terminal as root. You may either log in to a console as root (press Alt+F(number) keys to change what console you're on) or, when in X, right-click on the desktop, go to "XShells", and select "Root Access".
- To make sure you start in the right place, enter "cd /root". This will make sure that you end up in the /root directory.
- Enter "./getfold.pl". Remember, tab completion is your friend!
- If you happen to be behind a proxy, you'll need to tell the script is, like this:http_proxy=http://proxy.IP.addres.s:PORT ./getfold.pl
- The script will run to completion. It will download about 9 megabytes (April 2005), so it may take a while. Be patient.
This script makes all the stuff it downloaded, along with the client configuration file, into a single package for easy distribution to the clients. To make sure that this worked, first let's do "ls -s /foldsave".
Okay, the file exists. Now let's see what's in that file.
Okay, we've got the FAH client, and a bunch of cores. Looks good.
Now that we've got Folding@Home ready to go, it's time to generate the client image.
The warning from rm is normal, that file doesn't exist on this first run-through. Let's see what we've got:
This is a normal listing. Some files may be added or removed based on release, but what's important is that there exist:
- bzImage.current: this is the kernel that the clients will use. It is a "symbolic link" to the real kernel.
- initrd.current: this is the root filesystem. It is a "symbolic link" to the real compressed filesystem, myroot.gz.
- fold-boot: this is for etherboot. It contains both the kernel and the root filesystem.
- pxelinux.cfg and pxelinux.0: this is for PXE. They tell PXE what files to load.
Also, the myroot.gz and bzImage files are what is used to generate fold-boot, and are used directly for PXE. Don't delete them. BUILD shows a history of when the "update" script was run and what number build that was. As you can see, there's a lot of 'em. (1.0 has 247 builds in its log!)
Testing a clientNow try booting one of your clients. A PXE client will probably be easier to get going, so if you have any of those try them first. If all you have is Etherboot clients which you're going to use floppies for, there are two ways to write the images to floppies so you can boot from them. If you want to write the images from the server, do the following:
This will write to the floppy in the A: drive. If you happen to have a B: drive, substitute "fd1" for "fd0".
To write the images on another machine, go to it and type in the External IP in a web browser. Then click on the "Etherboot floppy images" link and download the one you want. Get Rawrite for Windows too (it's at the top), unzip it and run it. Follow the instructions. If you have another Linux machine you'd like to write the images with, download them from fold-server and follow the same procedure as with writing them from the server.
Now it's time to try the client. If you're using PXE, make sure the BIOS is set to boot from LAN; if you're using Etherboot, boot from floppy (make sure you insert the disk, too). Try it. Good luck.
FIXME: troubleshooting client problems?Configuring your router
One thing people seem to be having problems with is dealing with routing. Routing is indeed a complicated thing, and since fold-server is a router, you'll have to deal with this at least a little. The problem is that everyone in the connection chain has to know how to get to the people on both sides, or data can't flow. Makes sense? Well, the effect of this is that you'll have to add something to your existing router. I have examples for a Linksys router, a Linux machine and a Windows machine, so if your router is any of these, you're all set.
Why do you need static routes? Here's why. Imagine you're sending a simple ping from one of your client machines to fold-server.sf.net. Here's the path on the way out:
So it works okay. The client knows how to get to fold-server, fold-server knows about the router, and the router knows how to talk to the internet. So the packet goes out to the destination, a response is generated, and sent back along the same path. This time, though, we hit a snag.
So the packet knows how to get back to the router fine, it's sent to your external IP. But then the router gets the packet. It sees it's bound for (for example) 10.3.1.43. "10.3.1.43? I don't know who that is!" it says, and to the great Bit Bucket in the sky that packet goes. This causes the client machine, 10.3.1.43, to never see a response and give up. So what the static route does is to let the router know that all the packets bound for the 10 network can be sent via that guy over there, the fold-server.
LinksysAdding a static route to a Linksys "blue box" is fairly easy. Log into the Linksys router, click on advanced, and enter the information as in the third screenshot. Then hit submit.
Linux
Many people have a machine with m0n0wall, smoothwall, ipcop, or a similar linux- or BSD-based firewall distribution on it. I am only sure of how Linux works with routes, so that's all I'll talk about here. Routes are added at bootup, so you'll need to find what starts up your network. On my Gentoo box, the file to look at is /etc/init.d/networking. On redhat, it is /etc/init.d/networking. A good way to find this file is to go to /etc and do `grep -R "route add" *`. This will probably return quite a few matches, so how do we know which one is important? First, it's likely to be one of the first results. Second, it's likely the same line or lines will appear several times in a row with filenames like 'rc.d/rc5.d/S10network' or something similar. Editing any of these files will work, as they are all symlinked to the same file, so changing one changes all of them.
Okay, so now we've got the right file to edit. What do we put in it, and where? First, check if there's a section dedicated to static routes already. If there is, we'll add our stuff in there. Note that there may be distro-centric methods of setting up static routes; I'm just going to ignore them. They may change in the future, this method of setting up static routes will always work. However, I'd suggest you put the changes in the static route section so you can find them later if it's necessary. So what do we add? Here's my original contents:
And here it is after my changes:
and that's it! At this point, you can reboot your machine to see the changes take effect, or just run that last line as root to apply it.
IPCopThis page contains instructions on how to do this. Basically, add this:
to /etc/rc.d/rc.netaddress.up . Then reboot, or just run that command to get it to apply to the current session.
WindowsAs an Administrator:
and that's it!
D-linkThe D-Link router I tried to add a static route to (d-link 514) DID NOT SUPPORT static routing. You may be SOL on these. Sorry. I am working on a single-subnet version of fold-server. This will eliminate the problem, but until then, buy a cheap Linksys box. The 54g models are particularly nice, I hear.
Want to see your router here? Give me a sequence of screenshots or instructions, similar to the ones for Linksys for hardware routers or Linux if it's a computer. If for some reason you've only got text for your blue box or graphics for your OS, those are fine too. Hit that Contact link to the left and email them to me. Make sure to modify the address as necessary.
NATThere's a way around all this garbage, Network Address Translation or NAT. This makes it appear to the outside world that there's only one computer, while really there are many machines making requests and having them fulfilled. This works by having fold-server look at incoming packets, and "take over" the ones going to the outside, and keeping track of what connections it's got going. This is planned to be on by default for fold-server 1.1, but right now it takes a bit of patience to set up. First get these two files:
If you just copy/paste these into a PuTTY terminal (or type them in), that'll get the job done.
Then we activate it:
Then we'll add it to the bootup script so that it'll get started every time fold-server boots. Run "nano /opt/bootlocal.sh"; this will give you a menu-driven editor which changes the bootup script. Move down to the end, and put that last line in again. Hit ctrl-X to exit, y to save changes, and enter to accept filename.
This makes it appear to the outside world that there's only one computer, while really there are many machines making requests and having them fulfilled. This works by having fold-server look at incoming packets, and "take over" the ones going to the outside interface by writing its own address on the "source" machine, and keeping track of what connections it's got going.
This assumes that you've got the default IP for fold-server; if you don't, that's the only item you'll need to change.
Configuring various aspects of your systemGetting VNC going or removing it
Getting VNC going is fairly simple. All you need to do is set the password for access to the desktop, and tell it to start once. It is configured to start on boot by default. To configure the password and start it:
Now you can connect to your machine in two ways. First, visit the external IP in a web broswer from one of the machines on your network. There are two links which pertain to VNC: "Login via VNC" and "Get VNC viewer for Windows". If you click on the first link, a Java applet will load and ask you for a password. Enter the correct password and you will be logged in. If you click on the second of these links, your browser will download "vncviewer.exe". Run this (or save it, up to you) and enter "YOUR_EXTERNAL_IP:1" for the server name and whatever your password is and you will also be logged in. The Windows viewer is nicer than the browser one; it supports high color (if your network is fast enough (odds are it is)) and other nice features like full screen.
Configuring what VNC does is also fairly simple, but a bit more advanced. There are two files which may need changing: /usr/bin/vncserver and /home/dsl/.vnc/xstartup. In vncserver, you can change the resolution and bit depth that the server runs at; 800x600x24 bit is the default. In xstartup, you can change what programs run when VNC starts. The defaults are to run xtdesk to start icons, run dillo (a web browser), start the monitoring program, and use fluxbox. You may change these, but I suggest strongly that you leave "exec fluxbox" last.
Configuring VNC not to run is easy. Edit /opt/bootlocal.sh and remove the lines in red:
It is also possible (and very easy!) to do this with the web interface.
Using the web interfaceThe web-based interface is designed to be easy to use and complete in terms of functionality. It is new in release 0.8. To get to this interface, either:
- enter "https://" followed by the IP address of fold-server (default is 192.168.1.15) in a web browser from one of the machines on your network. This assumes that your network configuration is set up correctly. If you have an unusual network configuration, choose the next option instead - it'll work even if the network interfaces are down.
- start X on the local machine (type su - dsl, and it'll go from there) and run "firefox https://localhost".
With Release 0.9, there is now SSL turned on by default. You will have to accept my SSL certificate in order to use the web interface. This certificate is not used for anything else, so there's no security risk in accepting it. I suggest you choose the "accept always" option.
Then click on the "Change Configuration" link. Enter the password (the default is "Fold@on", if you want to change it look at this part of the documentation.
Using the shellWhen X starts, it starts Firefox, but you can just minimize that (click on the minus sign in the upper right, like in Windows). Right-click on a blank space on the desktop, and a menu will pop up. Go to XShells, and click on "Root Access".
You'll get a prompt like this:
This is a "bash prompt" or "shell". If you've used DOS or Windows command line, the principles are fairly similar. A few things of note:
- The path seperator is /, not \. Instead of C:\Program Files\Whatever, a UNIX path is something like /home/dsl/a.file.
- There's "tab completion": if there is a unique beginning to a filename, you can press the Tab key to complete it. For example, there's only one thing that begins with "h" at the root of the drive (type "ls /" to confirm this), so we can type "cd /h[Tab]" and get "cd /home/" automatically.
- The file utilities are named "cp" for copy, "mv" for move, "rm" for remove (delete), and "ls" for list (files in a directory). Also of interest is nano, a menu-driven text editor. vi is also available, for hardened *nix veterans.
- The way to give options to a program is usually -option (in contrast to DOS-style /option). Options are usually single characters, which can be combined to give the same effect as using them seperately. For example, "ls -as" means the same as "ls -a -s" (this example lists all files, showing sizes for each).
This is by no means a complete list of features, but some are available on the Web for free. (From Linux.org, From about.com, From redhat.com) Googling will turn up countless results on this topic, I suggest you pursue the topic.
Stuff that didn't fit anywhere elseWinSCP is a Windows SCP (secure copy) client. You can copy files to and from your fold-server using this. It has an interface similar to CuteFTP or Norton Commander, and it easy to use.
AliensBashTutorial is a fairly advanced tutorial on a bunch of the common UNIX utilities with respect to scripting with them. You probably don't need to write any scripts to use fold-server, but if you're interested in Linux (especially as an administrator) these commands will serve you well. I recently took a class on this sort of thing, and learned a lot of little tiny utilities that do obvious things. You know how you sometimes try to do something simple, and it takes 50 lines of script? Someone else has probably had that problem, and written a program to solve it that does it much simpler (and nicer) than your way. As an example, look at seq and rename. Powerful (simple!) tools, but how to find them? Look through this if you're interested in improving fold-server, helping me with bugs, or whatever.
If you want to shut down Folding, run:
If you don't want folding to start on boot, there are two places you probably want to change. First, in /opt/bootlocal.sh, remove the line marked in red:
This means folding itself doesn't start: your processor won't be working on anything in particular.
Second, in /home/dsl/.xinitrc (this is a hidden file, do "ls -a" to show all the hidden files), remove the line marked in red here:
This means that the monitor window won't pop up when X (the graphical environment) starts up.