Search Tillamook Rage
Google Custom Search
Showing posts with label documentation. Show all posts
Showing posts with label documentation. Show all posts

7.15.2008

No CDROM Error in Hardy 8.04 Installation

Improvements are nice, but sometimes they do away with support for older hardware, which is quite irritating. Recently I was installing Ubuntu Server 8.04 on an IBM Netfinity 5000 server, and while the installer was detecting and installing hardware it informed me I didn't have a CDROM drive. Since I was booting from the CD and the message I was receiving had come from the CD, I thought that was a silly message to receive. But lo, I couldn't complete the install. Well now I have a quick and easy solution, in case anyone runs into this again. It appears that Hardy is no longer loading the ide_generic driver by default, so here's how you can change that.

As always, be careful when following advice and procedures from this, or any other site, as your system and/or installation could be damaged if a mistake is made. See our disclaimer for details.

Boot from the distro CD you plan to install from, in this case Ubuntu Server, but I also tried this with Xubuntu. Once in the installation environment press Alt-F2. Then press Enter to activate the console. For those who didn't know previously, you can use several other consoles while installing or running Linux for use in recovery or diagnostics. This comes in very handy for snags in the installer, such as this and what I have come to call the "curse of anthy," which is where the installer hangs on installing anthy. Now type

modprobe ide_generic

and press Enter. It should think for a second and then finish. If all went well you should be able to press Alt-F1 and get back to the installer. Continue as normal and it should install and leave you with Penguiny Goodness.

Created: 7-15-08
Revised: 7-15-08

6.20.2008

Wireless/Dialup Computer Labs - Part 2

This is the second part of a two part series about using the LTSP and FreeNX servers together to accommodate low bandwidth (i.e. wireless and dial-up) clients. This post is all about setting up the clients. Since wireless and dial-up clients don't support network booting from an LTSP server, we need another means of getting them up and going. The clients that you create will technically be "fat-clients" instead of the normal diskless "thin-clients", but that's a necessary evil.

If you need to set up the server, check out Part 1 of this series.

This procedure was developed using Puppy Linux 3.01 Seamonkey which is available at the Puppy Linux website. It may also work with other versions of Puppy, but 3.01 is the only one that I've tried so far. The one version that we know this won't work with is Puppy 4.0. You can install FreeNX manually and it will function properly, but the .pup installers won't run correctly. We'll update this post as soon as we get a chance to correct the problem.

We are currently looking for hosting for the files in this post (the installers referenced below are stuck on YouSendIt for now), so if you have an interest in hosting these files for us please let us know. We would appreciate the help.

As always, please be careful when following procedures from this site, or any other, as a mistake can leave you with a broken system. See our disclaimer for full details.

Getting Started
Boot off of the Puppy Linux CD, choose your keyboard layout, and hit Enter to select Xorg on the Puppy Video Wizard screen. You can try Xvesa later if Xorg gives you problems. The next screen allows you to choose your video settings. The default will probably work fine, but you should press the Right Arrow key once to select TEST and hit Enter. You will probably see another screen asking you to verify that you have a PS/2 mouse (if you have one), and you can hit Enter to select TEXT_X_NOW. If the video test completes successfully, you're all set. To exit the test screen, press the CTRL, ALT, and BACKSPACE keys at once. Once the test completes, you'll be back at the video settings screen, and so you can just hit Enter to select FINISHED. There will be one final screen asking you if you are done. Hit Enter to select DONE. If you have video problems with Puppy at any time during this process, you can reboot from the CD and try different settings on these screens. Be careful not to get to crazy with the video settings though. If the configuration screen tells you that your monitor does not support certain settings, you might want to avoid them. Some settings can damage your CRT monitor or LCD screen. You should be able to look up the model number of you video card and monitor to find their maximum resolution and refresh rate if in doubt.

Once you get to the desktop, start the Puppy installer (Menu > Setup > Puppy universal installer). Note that following my instructions will wipe all data from the client computer's hard drive, so make sure you either back up the data and/or do a frugal install if there's data you don't want to lose.

Once the installer comes up you just follow the instructions to install Puppy. If you need an example, you can follow along with what I did below.

My Example
Since my client had a regular IDE hard drive in my test computer, I selected IDE (ATA) internal hard drive from the list of media to install to and clicked OK. The next dialog that came up was just telling me what drive Puppy was going to be installed to so I clicked OK again. The next dialog just showed me what Puppy found out about the drive I was installing to, so I clicked the button beside Install Puppy to hda1: since there was only one drive in my client. Once you click that button you will see another dialog asking you if it's ok to go ahead with the installation on the selected drive. I just clicked the OK button here too. The next dialog box asks you whether you want to do a Frugal or Full installation. I chose Full so that the installation would use the entire hard drive. At this point if you've done a Puppy install on the hard drive before, a dialog will come up asking you whether you want to UPGRADE or WIPE the installation. I chose WIPE (since I had another failed installation on the drive).

Once the installation is finished, you will see a dialog box asking how you want Puppy to boot up. I had the choice of booting from a USB stick or installing GRUB on the hard drive. I wanted everything to be enclosed on the client's hard drive so I chose Install GRUB. The next dialog tells you that the 'grubconfig' script is ready to run - click the OK button. The next dialog asks you if you want to do a simple or expert GRUB install. I'm a simple person so that's what I selected, and then hit the OK button. I clicked the OK button on the next 4 dialogs which is what I suggest you do unless you have a reason to do otherwise. One of the things you might want to change is where GRUB will install to. I usually go with either the Root or MBR option since they are the cleanest in my opinion. Eventually, you will see the GRUB INSTALL SUCCESS message, and you can just click OK. After that you will see a dialog asking you if you want to reinstall GRUB. If GRUB didn't fail you can just hit No to exit the installation.

Now you're ready to shut down and restart the computer. To shut down, go to (Menu > Shutdown > Power-off computer). Make sure that you take the Puppy CD out of the drive and select DO NOT SAVE on the screen that comes up as puppy is shutting down. That screen is just asking you if you want to save the settings from your current session. You don't need to do that.

The first thing that you will see when you reboot is the GRUB menu. Just hit the Enter key to boot the default option. When Puppy is starting up for the first time, you will be asked again to select your keyboard layout, "X server", and video settings. Follow the instructions above to see what to do.

Changing the GRUB Boot Delay
Once Puppy is booted up, go to the Puppy desktop and click the home icon which should bring up a window showing the files in your home directory (Figure 1). Hit the up arrow (boxed in red in Figure 1) until you see boot as one of the directories in the window. Click on the boot folder icon, then on grub, and then on menu.lst. The menu.lst file will open in Geany and you will be able to edit it. Be very careful to double and triple check what you do from here on out since we'll be editing configuration files that can cause your installation to malfunction.

Figure 1

Once menu.lst is open, find the line

#timeout 30

and remove the # and change the 30 to a smaller value like 5. What this does is set the amount of time that the GRUB boot loader will wait before booting Puppy. With the # (comment symbol) in front of the line it will wait forever for the user to hit the Enter key. That's not acceptable behavior when you're setting up lab computers for people. Double check what you've done against Figure 2. Now click the Save button and close Geany.

Figure 2

Setting Up Your Wireless Card In Puppy
You only need to read this section if you have a wireless card in your fat client that you're going to use to connect to the server. For my test setup I was using a CNet CWP-854 wireless card with the RT 2561 chipset. Fortunately for me, Puppy recognizes this card right out of the box, so I didn't have to do anything except configure it. You'll find that Puppy recognizes a wide range of wireless cards, and I noticed that version 3.01 did a better job than previous versions of Puppy Linux.

First, we need to launch the Network Wizard (Menu > Setup > Network Wizard). When the Puppy Network Wizard dialog window comes up, click the button for your wireless card. It will probably say something like wlan0. See Figure 3 to get an idea of what you'll be looking at.

Figure 3

Once you click the wireless card's button, the Configure network interface wlan0 dialog box will come up. Keep in mind that wlan0 will be replaced with the name Puppy gives your wireless interface. Just substitute your card's name for wlan0 from here on out. On the configuration dialog, click the Wireless button (Figure 4).

Figure 4

Clicking on the Wireless button will open a new dialog window asking you to enter your wireless network information (Figure 5). You will need to get this information from your network administrator. Click the button matching the type of network you have - Open, WEP, WPA/TKIP, or WPA2 and enter the appropriate settings. There are too many variations for me to give any detailed instructions here. If you have troubles, post a comment with your question(s) and we'll do our best to help you out.

Figure 5

Once you have entered your wireless network information, make sure you've entered a profile name of your choosing into the Profile Name: text box and click the Use This Profile button (Figure 5).

After you click the Use This Profile button, you will be returned to the Configure network interface wlan0 dialog box. If your client is on a network with a DHCP server (i.e. you're not using static IP addresses for each of your clients), then you should click the Auto DHCP button to start the wireless card off using the network's DHCP server (Figure 6). If you followed the instructions in Part 1 of this series to the letter, your LTSP/FreeNX server will be the DHCP server.

Figure 6

I'm assuming here that the rest of your wireless network is up and running properly, otherwise your client won't be able to see anything - including the DHCP server. Once you've clicked the Auto DHCP button, you will have to wait just a little bit and then you should see a dialog box saying NETWORK CONFIGURATION OF wlan0 SUCESSFUL! (Figure 7) which will present you with the option to save the configuration for the next boot. I would suggest clicking Yes here so that your wireless card will start working automagically the next time you boot up.

Figure 7

You can now click the Done button on the network configuration dialog. Now you can move on to start working on the FreeNX integration.

XAuth Installation
If you are running older versions of Puppy (i.e. 2.x), you will need to install xauth before you can get FreeNX running. If you're running a version of Puppy with xauth already installed (Puppy 3.x or greater), skip to the next section. You can download the DotPup installer that we've made here instead of downloading the version in the next section and it will take care of the xauth installation for you. XAuth will install in the /usr/X11R6/bin directory where the FreeNX client binary will be able to find it. If you're not sure if your version of Puppy has xauth installed, you can manually check the /usr/X11R6/bin directory or you can open a console (terminal) and type

find / -iname xauth

and hit Enter to have your computer do the searching for you. If you see xauth show up in any X11Rx directory, where x is the version number (probably 6 or 7), then you should be fine.

FreeNX Installation
Now you're ready to download and install the FreeNX DotPup file that we here at Tillamook Rage have created for you. Go here, and click the DOWNLOAD NOW button for the FreeNX_Client_1_5.pup file. If your client is not on the Internet, you will have to burn the FreeNX client installation file to a CD, or put it on a flash drive to move it over. We have created a post called Working With Drives And Files in Puppy Linux which walks you through dealing with copying the installer file to and from external drives and also installing the FreeNX DotPup.

Once you've gone through the post mentioned above, a window should open showing you the /usr/NX directory where the FreeNX client files are stored. If that window doesn't open, you can click on the home icon on your desktop and hit the up arrow that is boxed in red in Figure 1 until you see a usr directory. Click on it, click on the NX directory, click on the bin directory, and then run the FreeNX client by clicking on the nxclient binary file.

Configuring the FreeNX Client
Now we're going to set the FreeNX Client up to connect to the server. If you haven't run the FreeNX Client yet, go ahead and click on the nxclient executable file that's in the /usr/NX/bin directory to launch the application. You will see the Welcome dialog box (Figure 8) - go ahead and click Next.

Figure 8

Now you will see the Session dialog (Figure 9) that allows you to select a name for your session, along with the session settings. You can pick any name for the session (I used TestName), but I would suggest keeping it relatively short.

Figure 9

In the text box beside Host, type the IP address of the LTSP server that you set up from Part 1. I used 192.168.0.1 as you can see in Figure 9. The slider towards the bottom sets how much network bandwidth is available to your client. It may take some experimentation to get this setting right for your network conditions. Wireless networks may need special tweaking to get them set just right. If you have several computers on your wireless or dialup connections and you start running out of bandwidth, try moving this slider closer to Modem to see if that fixes the problem.

Click Next and you will end up at the Desktop settings dialog (Figure 10). Pull down the list box that has KDE in it and select Custom.

Figure 10

Now click the Settings... button. Under the Application section click the option button for Run the following command and type

/usr/bin/xfce4-session

Check to make sure that your Custom - Settings dialog box looks like the one in Figure 11 and then click the OK button.

Pull down the list box that says Available Area and select Fullscreen, and then check to make sure that your NX Connection Wizard dialog looks like the one in Figure 11. You can also check the Enable SSL encryption on all traffic, but if your session runs slowly try un-checking it again. Once you've checked it out, you can click the Next > button.

Figure 11

Click the Finish button on the next screen and you will see the login dialog in Figure 12. If you get an error dialog about not being able to create an icon on the desktop, don't worry about it.

Figure 12

Once you are ready, you can type the user name and password of a user that you have set up on the LTSP server and click the Login button. You might get a dialog about not being able to establish the authenticity of the host/server, but you are the one that set it up, so don't worry about it. Just click the Yes button to go ahead and connect.

It takes FreeNX a while to get the remote session up and going, but eventually you should see a desktop session from your LTSP server running on your Puppy Linux "fat-client". I tested the setup for this post using a computer with a Celeron 466 over wireless, and it took about 30 to 45 seconds to connect and display a desktop.

Configuring Puppy to Work Well With FreeNX
We're now ready to set Puppy up to look and act like a LTSP client. If you just wanted to run FreeNX without using this client as a fat-client, you can skip this section. I'm just going to show you how to tidy things up so that your users only see the LTSP desktop.

The first thing that we want to do is to set the FreeNX client up to start automatically when Puppy starts. To do this click on the console icon on the desktop, and when the console application comes up type

geany ~/.jwm/jwmrc-personal

and hit the Enter key. This will open the configuration file for your window manager (the app that handles displaying all of your windows for you). When the Geany window comes up, insert the line that's circled in red in Figure 13 in the location shown.

Figure 13

Save the file and close Geany. Now the next time you (re)start the computer, the FreeNX client will start up automatically.

Next, we'll set the FreeNX client up to be full screen. Go back to the console window, or bring a new one up by clicking on the console icon on the desktop, and then type the following two lines, each followed by the Enter key.

cd /root
geany .jwmrc

Once Geany comes up, scroll down until you see the line that sets the Height attribute of WindowStyle (which is the same as the BorderStyle entry in Puppy 2.x versions) to 22 (Figure 14). This entry should be toward the bottom third of the file . Change 22 to 2 . If your original Height line doesn't have the value of 22 don't worry, just check to make sure you're between the tags (denoted by the less than and greater than signs) and change whatever the value is to a 2. See Figure 14 to see what it looked like after I made the change. This doesn't technically remove the window title bars, it just makes them 2 pixels tall which makes them look like they've been removed. This is the only way I've found to get rid of the title bars in JWM so far.

Figure 14

Now, save the file and exit Geany. After you restart your computer, you won't see any title bars on your windows. Now, the question might occur to you "how do I move the windows now?". I've got you covered. In JWM (Puppy's default window manager), as well as many other window managers, you can hold down on the ALT key and then drag a window around by clicking and dragging anywhere on it. You can also close an application when you can't see the close x button on the title bar by right clicking on the application in the task bar and then selecting the Close menu item. That should keep you moving right along even without title bars.

The next thing we want to do is auto hide the task bar so that it's not taking up screen real estate that's meant for FreeNX. To do this, open the JWM configuration dialog (Menu > Desktop > JWM configuration or Menu > Control Panel > JWM configuration in Puppy 2.x) and click the OK button on the informational dialog that comes up. Click the button beside Taskbar to launch the Taskbar configuration dialog. Click the button beside Tray Autohide Option, click the option button for ON:Tray Autohide on, and then click the OK button (Figure 15). You might get a dialog box telling you that the tray autohide option is now on. You can just click OK. You should now be back at the Configuration Options dialog box, and you can click OK and and then click the Yes button beside Restart JWM now? on the JWM Configuration Manager dialog so that the changes will take effect.

Figure 15

You can now hit the Exit button on the JWM Configuration Manager dialog box and restart the computer to make sure that all of your changes take effect. Once the computer has rebooted, you should see the FreeNX client automatically launch, there should not be any title bar showing on it's window, and there should be no taskbar unless you move your mouse cursor over it.

You're now all set to start using the client in your lab. Wash, rinse, and repeat for as many clients as you have.

Troubleshooting
As with any server, having a log file to look at when things go awry is a must. By default, logging is disabled on the FreeNX server so I'll go through how to get it turned on. If you're getting authentication errors, or if you just plain can't get the clients to connect to the server, try this out and then take a spin through the log file(s).

The first thing you will want to do is to open the nxserver node configuration file, turn on logging, and set the logging level. To do this, open a terminal window (Applications > Accessories > Terminal) and type

sudo mousepad /etc/nxserver/node.conf

and hit Enter. You might have to type your administrative password of course. Again, you can replace mousepad in the line above with the command for your prefered plain text editor. Scroll down until you find the lines that refer to logging (Figure 16).

Figure 16

Uncomment the NX_LOG_LEVEL line by removing the # from in front of it, and change the 0 to the logging level you want. You'll notice that just above the NX_LOG_LEVEL line there are several commented lines explaining what each level does. I usually use level 4 which gives me the information that I need. The line should now read

NX_LOG_LEVEL=4

assuming that you chose to use log level 4 like me. Also, uncomment the line that reads

#NX_LOGFILE=/var/log/nxserver.log

again by removing the #. This time you don't need to change it, just remember where the log file is (/var/log/nxserver.log). Now, restart your computer - you could just restart the FreeNX server, but I like to be thorough.

When a user tries to connect to the server, the general information about their login attempt is recorded in the nxserver.log file, and some information specific to their own session may be stored under the ~/.nx directory. There are so many things to look for in the log file that I can't cover them all here. If you have trouble, post your log file information to the comments at the end of this post and we'll try to help. One thing that may help you is to open a terminal (Applications > Accessories > Terminal) and type

sudo tail -f /var/log/nxserver.log

and hit Enter. The tail command displays the last 10 lines from a file, and using the -f switch causes tail to update in real-time for the changes to the file. So, with the command above you can watch as your clients try to connect to the FreeNX server and monitor what goes wrong and when.

Don't forget to disable (or reduce) the NX_LOG_LEVEL setting again once you get your server running or you'll just be wasting system resources. If you want, you can turn the logging level down to 1 so that you only see errors in the log files. I wouldn't leave it much higher than that since you don't usually need all the information (like the client-server communication) after you have your server all debugged.

Conclusion
I hope that this series has been and will be helpful to anyone trying to set up a computer lab using low bandwidth network equipment. Let us know how things go while you are trying this setup. We are always grateful for comments and questions on our posts.

Enjoy!

Additional Reading
Puppy Linux Homepage
Addtional Reading Section of Part 1

Created: 06-20-08
Revised: 06-20-08

6.16.2008

Wireless/Dialup Computer Labs - Part 1

You might be interested in this post if you want to use an LTSP server with clients that are connecting over low bandwidth connections such as wireless or dial-up. Also, this post has the side-effect of enabling the use of LTSP with clients that can't do network boots (i.e. with PXE) which is really useful since almost no wireless cards support any type of network boot functionality. If you get a chance to work through these instructions, please let us know what you find and what you have problems with so that we can improve this post in future revisions.

In Part 1 we'll take a look at how to set up the server, and in Part 2 we'll do the client computer(s).

This procedure was originally developed using the Xubuntu 7.04 Alternate Install CD, and updated using the Xubuntu 9.10 Alternate Install CD. You should be able to use other versions of Ubuntu and Xubuntu to do this procedure, but your mileage may vary. If you are able to get this procedure to work with another version, please post your findings in the comments section for the rest of us.

As always, be careful when following advice and procedures from this site or any other, as you can do serious damage to your Linux system if a mistake is made. See our disclaimer for details.

Introduction
The standard LTSP server-client model works well over wired Ethernet connections, but there are some situations where it just can't cope. Wireless clients usually don't have the ability to boot from the network, and if you want people to connect to your LTSP server over dial-up, standard LTSP is too slow.

One thing to note before we get too far is that setting up your LTSP lab this way will greatly increase the load on your server. The X sessions (the graphical session that displays the desktop) for each of the clients will be run on the server itself, instead of locally on each client. That means that the server has to have enough horsepower to handle as many graphical X sessions as you have clients. Also, keep in mind that running anything computationally intensive (like programs that do a lot of calculations) will add to the stress on the server. I can't really give you a hard and fast rule on how much horsepower you need, but if you've got over 20 to 30 clients, you're probably going to need a high end single core processor or a dual core processor computer with plenty of RAM (at least 1 gigabyte). If you have a lower end server already though, I would suggest you try this procedure out before you go and get another one. You might be able to get away with it and it's not too hard to replace that server later if you need to.

The Procedure
The first thing that you want to do is to follow the procedure outlined in our post LTSP Server Setup The (Relatively) Easy Way. Once you have finished that procedure, you should have a functioning LTSP server that is ready to have the FreeNX server software (more on that later) installed on it. Be sure to check out the troubleshooting section in that post and also the various other updates that we've written in the Additional Reading section below.

The next thing I would suggest is updating your new server installation. To do this, make sure you have a connection to the Internet, Open the Update Manager (Applications > System > Update Manager), and click the Install Updates button. It will probably ask you to enter your administrative password. It will take awhile for all the updates to be downloaded and installed, but once the computer is done updating, you can move to the next step.

Once you have your LTSP server humming along the way you want it, make sure it has a connection to the Internet and install FreeNX. Lucky for us there's now a set of packages available from the Ubuntu community Ubuntu FreeNX Team PPA (Personal Package Archive). The instructions for installing FreeNX from the PPA are different depending on whether you're running Xubuntu 9.10, or an older version. The next section outlines the instructions for 9.10, you can skip over them to the next section if you're running an older version.

Install FreeNX In Xubuntu 9.10
You need to first open a terminal window if you don't have one open already (Applications > Accessories > Terminal). Once the terminal window is open, type the following and hit Enter after typing (or copying) each line.

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:freenx-team

These lines make sure that you have the command to install the PPA repository installed (add-apt-repository), and then adds the repository.

Once that has finished, we need to update the local cache so that our system knows what packages have been added from the PPA repository.
sudo apt-get update

And finally we'll install the FreeNX package and run a setup script.

sudo aptitude install freenx

sudo /usr/lib/nx/nxsetup --install

You may be asked to hit Y multiple times to finish the installation.

Install FreeNX In A Previous Xubuntu Version
If you're running a version of Xubuntu earlier than 9.10, you will need to follow the instructions on the FreeNX team's Ubuntu documentation page. Look for the Installing the FreeNX server on older Ubuntu Versions section.

Beginning The FreeNX/LTSP Integration
After the FreeNX server is finished installing, you can download the Symbiont Workstation Manager files for LTSP/FreeNX integration. You should be able to download them directly at http://downloads.sourceforge.net/symbiont/NX1.5.0-141_LTSP_0.8.tgz?modtime=1149606780&big_mirror=0 , but since broken or incorrect links are always a danger, I'll give you a less direct and more sure-fire way to get to it. Go to www.sourceforge.net and search symbiont workstation manager under the Software category. The main hit should be the one that you want, so click on it. Click on their Downloads tab and look at the Miscellaneous downloads category. To get the LTSP/FreeNX downloads to show up you'll probably have to click the link View older releases from the Miscellaneous package. Once the full list pops up, click on the NX_LTSP link, and then click the NX1.5.0-141_LTSP_0.8.tgz link. That should get you what you need.

Once you have the file downloaded, you need to extract it. You can do this by double clicking on the file in Thunar (the file manager in XFCE) and clicking the Extract button on the window that comes up. If you extract the the file you downloaded this way, you can now skip down to "Installing The FreeNX Files."

If you want to extract the file from the command line, you can go back to the terminal and type

cd ~/Desktop

and hit Enter. You should replace the ~/Desktop portion above with the directory where you downloaded the NX_LTSP file to. If you're using Firefox (which I would guess you probably are), the default is almost always to the Desktop directory. The ~ above is the same thing as your home directory. So, instead of typing /home/user/Desktop I would type ~/Desktop .

Anyway, now that you're in the directory where the NX_LTSP file is, type

tar -zxvf NX1.5.0-141_LTSP_0.8.tgz

and hit the Enter key.

Installing The FreeNX Files
Once the file is done extracting you need to copy the files to the LTSP server directory, being careful to preserve all the files and their properties (including symbolic links). You can do this graphically through Thunar, but I prefer using the terminal for this. So, follow me back to your trusty X term (that is already cd'd to the desktop with cd ~/Desktop) and type

cd NX1.5.0-141_LTSP

and hit Enter to go into the NX_LTSP directory, then type

sudo cp -a i386/ /opt/ltsp/

and hit Enter to copy the files to where they need to go. You may be asked to enter your adminstrative (root) password after hitting Enter, but that's normal.

Now that all of the new files are copied over, we need to copy the authentication key for the FreeNX server over so that it will be used by the LTSP clients. Once you get more familiar with FreeNX, you'll want to regenerate this key, since using the default key is a security concern, but that's for after you have the server running. To copy the key, switch back to the terminal window and type (copying this line would be easier)

sudo cp /var/lib/nxserver/home/.ssh/client.id_dsa.key /opt/ltsp/i386/usr/NX/share/client.id_dsa.key.session

(all on one line) and hit Enter.

Now we need to make the LTSP server software aware of the FreeNX server, so type the following line and hit Enter.

sudo mousepad /opt/ltsp/i386/etc/lts.conf

You can replace mousepad in the line above with the command for your favorite plain text editor. Once the file is open, add the line

SCREEN_02 = startnx

(preserving the case and spacing) at the end of the indented section that starts with the line [default] (add the [default] entry if you have to). The file should now look like Figure 3. Save the file and exit the text editor.

Figure 3

Now the last thing you have to do is type the following line and hit Enter.

sudo ltsp-update-image


That's it, you should be able to restart your new FreeNX-LTSP hybrid server and then log in with the client(s) that you will set up in the second and final post in this mini-series. Normal LTSP server maintenance and administration procedures should apply directly to this setup. One quick tip I will give you is to make sure that your FreeNX users don't have the permissions to shut the computer down. When people are logged in using FreeNX in full screen mode, the natural thing to do is to try to log out or shut down when they're done. Shutting down via their account will shut your server down though - a bad thing for the other users.

Troubleshooting
See the troubleshooting section at the end of Part 2.

Conclusion
Well, there it is in all its geeky glory. I hope that gets you started off in the right direction. Please keep us up to date, since as I said in the introduction, this procedure is a work in progress and is still being tested out in the wild. Please don't try these instructions on a server that you can't afford to kill. Start out with an isolated test setup to see if this is going to work for your situation, and remember to keep us up to date on what you find.

Enjoy!

Additional Reading
Linux Terminal Server Project Homepage
FreeNX Homepage
Finding The LTSP Option With Xubuntu 8.04
Build chroot Fails During LTSP Server Install
An LTSP Update
LTSP Client Shuts Down Server - The Fix
LTSP Server Setup - The (Relatively) Easy Way
Ubuntu Community FreeNX Installation

Created Date:06-16-08
Revision Date:01-13-10

5.05.2008

CAD and 3D Graphics Programs For Linux

Boot and I have been asked quite a bit about CAD in Linux, so we decided to put together a quick rundown of CAD and animation programs for your reading enjoyment. This is by no means an exhaustive list, and we haven't had much experience with several of these applications, we're just trying to give you a starting point so that you can search out what works for you. If you see something that should be added to our list, please let us know in the comments section.

2D CAD
QCaD (available in the Ubuntu repository)
QCaD (Figure 1) is a fairly simple 2D CAD application that you can use to create and dimension drawings. It allows you to separate drawing entities out into separate layers, has snap-to functionality for both a standard grid and other entities (endpoints, midpoints, etc), can open and save AutoCAD DXF formats (2000 and R12), and much more.

You can install QCaD by opening the Add/Remove Applications dialog (Applications > System > Add/Remove...) and typing qcad in the search field. That will bring up the entry for QCaD that can be used to install it. Alternatively, you can open a terminal window (Applications > Accessories > Terminal) and type

sudo apt-get install qcad

Figure 1

SagCAD (Available in the Ubuntu Repostitory)
SagCAD (Figure 2) is a 2D CAD program with a few more features than you get with QCaD. I did find SagCAD somewhat less intuitive, but you might decide that the added functionality is worth it in the long run. You should try both QCaD and SagCAD to see which one you like better. One really nice feature that SagCAD has that I didn't see in QCaD is CAM output. If you have a hobbyist level machine shop in your garage, this might come in very handy. I haven't gotten to try this feature out yet though, so I don't know how well it works.

You can install SagCAD the same way as QCaD above, just replace qcad with sagcad when searching or installing.

Figure 2

3D CAD
avoCADo
avoCADo (Figure 3) is a 3D CAD system that is still in its pre-alpha stage, but it shows great promise. One of it's core principles is to be usable by those both with and without 3D CAD experience. To achieve that goal a few things will have to be compromised, but they are trying to make it fit as many people as possible. If you want to try it out, you can download it from its Sourceforge site here. You just extract it (I put it in /opt) and run the avoCADo script in the program folder to launch the program. To do this, open a terminal window (Applications > Accessories > Terminal), use the cd command to change to the avoCADo directory (to the location that you extracted it to), and type

./avoCADo

One important thing to note is that you have to run avoCADo using version 6 of Java. Earlier versions of Java give an error about the avoCADo jar file being corrupt.

Currently you only have the options of revolution and extrusion to create 3D features, with no add or subtract functionality, but you can still make several fun things with it. The avoCADo crew is also looking at building in features to make it easy to share your drawings with others, so people doing open idea collaboration will have a great tool if this project takes off. There has also been talk of a community part repository for shared models to help cut down on drawing time. If you need a bolt in your assembly drawing, you'll just go to the repository and get one. No need to redraw it. I encourage anyone reading this with an interest in CAD to have a look and get involved.

Figure 3

freeCAD
freeCAD (Figure 4) is a 3D drawing and motion simulation package whose website makes it unclear whether or not it's open source. According to the website it is built using open source tools, but to me that doesn't mean that it's open source. Also, there are placeholders inside the main window where presumably advertisers would place their ads to lure you into buying things. I'm not a big fan of that, but if you need the functionality that this package offers, you might be willing to put up with it.

Installing freeCAD is not as easy as installing some of the other programs in this post, but it's not impossible by any means either. Download the main program's zip file and the patch zip file from the download site. Extract both of those files into a new directory, open a terminal (Applications > Accessories > Terminal), navigate to the directory you extracted freeCAD to using the cd command (cd ~/Destkop would take you to the desktop if you downloaded it there), and type

./visual freecad8.im

and hit Enter, replacing the 8 in the terminal line with the version number that you downloaded.

Don't expect to learn this one in a hurry. The tutorials leave a bit to be desired, and it's complex enough that it's difficult to just hack your way through. I would suggest trying the "tutorials" out and then opening one of their pre-built assemblies to get an idea of how it was created. If you need to do motion simulation and analysis, this might be a contender for you.

Figure 4

BRL-CAD
BRL-CAD (Figure 5) was originally created by the U.S. military (Army) for solid modeling, rendering, and "system performance analysis" (whatever that means), but is now maintained by the open source community. It's a collection of over 400 programs that have been developed over the course of many years, and is very powerful, with a correspondingly difficult learning curve. There are many examples of the rendering capabilities of BRL-CAD on its website, and if you want a powerful 3D modeling and realistic rendering system, this might be the one for you. Be prepared to spend quite a bit of time just to figure out if it's what you need though.

I was only able to find the current version in the form of a deb file, so people using a non-Debian distro may need to poke around on the Internet a bit to find a tgz or rpm. Once installed, I found all the files in the /usr/brlcad directory, and the main command window can be launched by opening a terminal window (Applications > Accessories > Terminal) and typing

/usr/brlcad/bin/mged

and hitting Enter. Other than that, all I can tell you is to read a lot and experiment. There's a ton of things to learn, and way too much to cover in this post.

Figure 5

3D GRAPHICS AND ANIMATION
Blender3D
Blender3D (Figure 6) is an extremely powerful 3D animation package. It's kind of like an open source Autodesk Maya. Don't expect the learning curve to be easy though if you don't have any experience in the 3D animation industry. The Blender3D user interface is very powerful and makes sense once you learn it though. Part of this user un-friendliness is offset by the fact that there are many video tutorials out there to help you get started. I was totally lost at first, but after watching a few videos, I was amazed at what I could do. A CAD program this isn't though. It's more like working with clay than doing precision machining work.

Make sure you're willing to invest the time to get familiar with Blender. Fifteen minutes of hacking won't be enough to figure out how to use it and have fun with it. To download and install Blender, go to the main website and click the Download link at the top. There were two versions available at the time of this writing, so I grabbed the the one that used the version of Python that I had (2.5). If you want to make sure that Python is installed on your system and to check what version it is, open the Add/Remove Applications dialog (Applications > System > Add/Remove...), and type python in the search field. If you see the Python entry with a check mark, it's installed so look at what version of Python it is and make sure you download the matching version of Blender.

Figure 6

Another thing that you will have to do is install the Open Audio Library and one of its supporting libraries. To do this, open the Synaptic Package Manager (Applications > System > Synaptic Package Manager) and search (Edit > Search...) for libopenal. Several entries will come up, but you want to select the first main libopenal entry (Figure 7). Your version numbers may vary slightly, but hopefully Figure 7 gives you a good idea of what you're looking for. Don't forget to click the Apply button. The next thing to do is repeat this process for libalut.

Figure 7

Now, you're ready to double click on the file and extract it's contents. I usually put the extracted folder in /opt and then create a symbolic link to it in /usr/bin so that I can launch it from a terminal without typing in its full path. This makes it less cumbersome to create a launcher for the program as well. Once you've put the extracted folder with all of the Blender files in /opt (or wherever you decided to put it), you can create a symbolic link to it by typing the following in a terminal window.

sudo ln -s /opt/blender_dir/blender /usr/bin/blender

Notice that in the line above, you would replace blender_dir with the name of your blender folder. Now you can just double click the blender binary in the blender folder, or you can type blender in a terminal window to launch it.

CYCAS For Architects
For all of you hobbyist architects out there, the pickings are currently slim. You can always use QCaD and SagCAD for your floor plans, and something like BRL-CAD for renderings of your structure, but that may not cut it for some of you. So that I wouldn't leave anyone out, I managed to dig up CYCAS (Figure 8). CYCAS is an architectural drawing program that is available for free if you promise not to use it for commercial applications, and if you can put up with some reduced functionality (the most annoying of which is support for only one drawing layer). To see what functionality is not available in the free version, check their website. If you don't need the power of a more advanced architectural drawing package, and are just going to use it for personal projects, this might be worth a shot. You can find the download for it here, but be aware that you'll have to enter your name and email address to get at the download.

Figure 8

Wrapping Up
I hope this gives you a start in the world of CAD and 3D modeling in Linux. As I said before, this is not an exhaustive list. There are several more CAD programs out there, we just feel that these will give you a good start. Let us know what you find and what you think. We always welcome your comments.

Enjoy!

Additional Reading
Sybex Blender Book

Created:05-05-08
Revised:07-02-08

4.10.2008

Reuse Robotics - An Introduction

If you're like me, then you don't have a ton of money to blow on your hobbies (that darn money tree just won't grow). I'm sure that everyone is like me and would love to build C3PO or a Replicator/Replicant in their garage , but who has the cash to heat their evil lair and still buy equipment? Well, that's where reuse robotics comes in. Now, I'm not talking about modular robotics platforms, or reusable source code, I'm talking about getting outdated and discarded computers and electronic components, and reusing/re-purposing them for your projects. There are examples of these types of projects all over the Internet, just try to Google mousebot and see what happens. Boot has written a great post on some ways that we can lay our grubby little paws on discarded computer/electronic equipment (legally I might add), so that even if you have no money at all, you should still be able to get gear. Check out his post called High tech "dumpster diving" for details.

As time goes on and Boot and I continue to have a blast with Linux, we find all sorts of things that could cross over to robotics. I myself have a penchant for robotics and embedded systems, and I find a lot of reuse ideas through doing my own projects. As Boot and I come across things, we'll use this series to pass them along to you. By the way, for any of the un-initiated among you, when I refer to embedded systems I'm talking about computers that have as much as possible crammed onto a single motherboard (storage too). Your cell phone is a good example of an embedded system.

Below are just a few things that I want to mention as we start this series.

Exhibit A
As I mentioned above, Boot has a post on the basics of scrounging for equipment. I can't recommend this post highly enough. Whether you're a pre-teen or teen with no money, or whether you're Donnie Trump, you can get some good out of the information that Boot is issuing forth in that one. Please check it out.

Exhibit B
A website that I really like from a hobbyist perspective is Anthony Beckwith's robotics page. To me a lot of his projects are the purest form of reuse robotics. You can see parts from computers, VCRs, calculators, and much much more in his robot designs. He also does quite a bit with solar powered robots, which I think is really cool. Mr Beckwith, I salute you.

Exhibit C
Boot and I are working on several posts for this series, and as time goes on and more things come to us, we'll throw them on here. To give you and idea though, coming up we'll have at least one post on building diskless robot controllers out of old motherboards and network cards, and we'll also have a post on using the sound card of a computer for analog sensor inputs.

Well, there you have it. The things that I've mentioned here are just to whet your appetite. Stay tuned for future installments of this series. We've got lots of cool ideas and information to share with you.

Enjoy!

4.03.2008

Digital Imaging In Linux

You might be interested in this post if you want to use digital cameras and/or scanners in Linux.

This procedure was developed using both Xubuntu Feisty (7.04) and Xubuntu Gutsy (7.10), but should work equally well with any version or derivative of Ubuntu or any Debian derivative - with some minor changes.

As always, be careful what you do with the advice and procedures from this site or any other, as you can do serious damage to your system if a mistake is made. Please see our disclaimer for details.

Introduction
Recently, I was thrown into the task of mind-melding Linux (specifically Xubuntu) with a newer digital camera when my dad bought a Kodak EasyShare M883. He also wanted to get an all-in-one printer so that he could print, fax, and scan. He really likes the Xubuntu Feisty system that I set up for him many months ago, and I didn't want to ruin things for him by switching it back to Windows, so I had to make things work well for him in Linux. This post is about my (mis)adventures in trying to do that. My hope is that it will give some of you a head start on using your own digital imaging equipment in Linux, and will help you avoid the same mistakes that I made.

Camera-Shy
There are several digital camera packages for Linux, and the most commonly used one is gphoto. I found that gphoto recognized my dad's M883 right off the bat, and I was able to download photos to the computer. It's interesting to note that gphoto's website didn't have the M883 on their compatibility list. That goes to show you that it doesn't hurt to try something even though you think it might not work. When you get a new camera, I would suggest just trying to plug it in first to see if Linux recognizes it as an external hard drive. If that doesn't work you can install the gphoto library manually and use it, or you can check out the next section on using Picasa. To install gphoto, open an X terminal (Applications > Accessories > Terminal) and type the following line, hitting Enter afterwards. Note that this line is installing two programs at once, gphoto2 and gtkam.

sudo apt-get install gphoto2 gtkam

The libraries and applications with the gphoto package can be used from the X terminal, but it's easiest to use it with a program like Picasa or GThumb. If you want to use gphoto by itself, you can run the program gtkam that we installed with the command above. gtkam is a graphical front end for the gphoto library which you can use to grab the photos off of your camera. I prefer using Picasa instead of gtkam, so this post will focus on that, but if you want a post on using gphoto without installing any other programs, you can ask in the comments section. We'll be happy to oblige.

Unfortunately, not every camera will work under Linux. gphoto can't cover all of the available camera models, and many companies don't put out Linux drivers for their cameras. There is still hope though, even if Linux won't recognize your particular camera. There are two basic ways to get your photos off of your camera if it has a removable memory card. The first is with a memory card reader, the kind that fits in a 3.5 or 5.25 inch bay in the front of your computer. If your motherboard supports card readers, most likely Linux will recognize it. Once you have the card reader installed you can just insert the camera's memory card and either open the card as an external drive, or use it in a program like Picasa (see below).

I have to give credit for this second technique to Boot, since I had seen these products around but never put two and two together. What you can do is buy a USB memory card adapter for your memory card type (my dad's was SD). Even when the camera isn't recognized, the adapter with the card in it will be recognized as an external flash drive. That way you can get your photos off the camera while you wait for gphoto or one of the other camera libraries to catch up. You can use it as either an external drive and just copy the files off, or you can open the card and import the photos using a program like Picasa (see below). These adapters come in several flavors, but they usually look like over-sized USB flash drives and accept memory cards (chips) like SD and XD.

Picasa
Once again, the people at Google have done the world a great favor. By teaming up with Codeweavers, Google has ported ("moved" might be a more accurate term) Picasa2 over to the Linux platform. It uses much of the original Windows code and runs it on top of the Windows emulator Wine. Not purely Linux, but an efficient way to make your app cross-platform quickly. Google currently has RPM, DEB, and BIN installers available for the i386 platform. I really like well done BIN installers, so I tried that one out. I was not disappointed. I got a nice graphical installer, and everything installed without a hitch. It's not in the Ubuntu repositories (that I know of) as of the writing of this post, so you'll have to grab one of the installers here. One side-note here is that I found documentation that said Picasa is designed for Gnome and KDE, but I didn't have any problems with it in XFCE.

I had Picasa go ahead and run the new storage detector in the background so that it would automatically detect my dad's camera, and had it put an icon on the desktop.

To import photos from your camera, attach your camera to the computer and do whatever the camera's documentation says to get the camera talking to the computer. Then run Picasa and click on the Import button shown by the red oval in Figure 1.

Figure 1

Once you are in the export screen you'll see the Select Device pull down menu shown in the red oval in Figure 2. When you click the pull down menu, you should see your camera in the list of available devices. The names can be kind of cryptic, so if in doubt, I would start at the top one and work your way down. The top entry in the pull down list is usually your camera in my experience. Once you select your camera, Picasa should start the import process. Once you're to that point, you can select photos one by one (while holding the control key) and then click the Import Selected button, or you can import all of the photos by clicking the Import All button.

Figure 2

Printers
I found an HP Officejet 6110 All-In-One for my dad at a local solid waste management district (recycling facility). See Boot's post on High Tech Dumpster Diving for ways to find good technology cheap. The printer needed a minor repair, so I got even more of a discount on it. It works great and for less than the price of the cartridges I got a complete, working, all-in-one printer. Not bad eh?

Anyway, Boot and I are pretty big fans of HP printers for Linux since we almost never have one that isn't recognized. You might have problems if you buy a bleeding edge HP printer, but one with any age on it at all should work. A lot of the printers from other manufacturers will work fine too, but they are a little more hit and miss (especially Lexmark and Xerox).

XSane...In The Membrane
XSane is a graphical program that allows you to use scanners. XSane can be integrated with Gimp for 1 step scanning for editing. More about that below. You can install XSane by opening an X terminal (Applications > Accessories > Terminal), typing

sudo apt-get install xsane

and hitting Enter. To install XSane graphically, open the Add/Remove Software dialog (Applications > System > Add/Remove...) and search for xsane. Once the XSane entry comes up, you can click the checkbox beside it and click the Apply Changes button.

Once XSane is installed, you can launch it by going to Applications > Graphics > XSane Image Scanner. You'll be presented with the set of windows in Figure 3. These windows will allow you to change things like the color balance and brightness of the document. There are many settings, and to write about all of them would take another post. I'll leave you to experiment. Make sure your scanner is turned on and plugged in to your computer, make sure your document is in the scanner, and click on the Scan button highlighted by the red oval in Figure 3.

Figure 3

XSane will scan the document and then a new window will pop up showing what was scanned. You can then do the typical File > Save As... routine to save the digitized document to the hard drive. If you go the Save As... route, make sure to set the file type using the pull down menu with the red oval around it in Figure 4, or specify the file type by typing the correct extension. So, for a JPEG file, you would type something like myimage.jpg and then click the OK button.

Figure 4

Gimp + XSane = Goodness
Most of us who run Linux (and many who use Windows) use Gimp for our photo editing. If you want to use XSane directly with Gimp, it's pretty easy to do. You can create a symbolic link for XSane in Gimp's plugins directory to make it recognized in Gimp's menu system. Before you can create this link though, you need to gather some information about the version of Gimp and where XSane is installed on your system. Open an X terminal (Applications > Accessories > Terminal) or switch back to one that you haven't closed yet, and type the following command, hitting Enter afterwards.

sudo find / -iname xsane

This search line will show you the location(s) of the xsane binary. You may see several, but look for one in either the /usr/bin directory or the /usr/local/bin directory and remember the full path. Next you can type the following line, this time hitting the Tab key afterwards.

~/.gimp-

Once you hit tab, this line will complete with the version number of Gimp that is installed on your system. Remember this version number.

Now that you have the information from the commands above, you can create the symbolic link in the Gimp plug-ins directory. For all of you who are used to Windows, a symbolic link is kind of like a shortcut. Type the following line, replacing /usr/bin/xsane with the path to xsane on your system, and the 2.4 in ~/.gimp-2.4/plug-ins with the version number of Gimp that you found.

ln -s /usr/bin/xsane ~/.gimp-2.4/plug-ins/

Make sure to hit the Enter key after you've typed in the command.

Now that is done, launch Gimp (Applications > Graphics > GIMP Image Editor). Once it launches, go to the XSane acquire menu (File > Acquire > XSane) and you should see something similar to Figure 5. Notice that I've put a red box around the XSane menu in the figure. If you've already used XSane with your scanner, you will probably see it in the list below Device dialog... and in my case it's the entry that begins with hpaio. Your scanner name will differ from mine of course. You can either click on the entry for your scanner (if it's there), or you can click on the Device dialog... entry. Each of these entries opens XSane (Figure 3), but clicking the Device dialog... entry searches for a scanner first. If after clicking one of these two entries you get a dialog box telling you that there's no device present, you need to verify that your scanner is hooked up to the computer, that's it's turned on, and that it's supported in Linux.

Figure 5

Once the XSane windows pops up (again, Figure 3) you can use it just like before, but the scanned document opens in a Gimp window so that you can start editing it immediately. I like this because it avoids the extra steps of saving the scanned image and then reopening it in Gimp. This way you also have more flexibility on what you do with the document before you save it, and which formats you can save it in.

Windows Camera Software With Wine
There is a chance that you may be able to run the Windows software that came with your camera. Wine is a Windows Emulator for Linux, and can be installed by opening an X terminal (Applications > Accessories > Terminal) and typing

sudo apt-get install wine

or you can open the software installer (Applications > Settings > Add/Remove...) and search for wine.

If you're following the X terminal route, you may be asked if it's ok to use more space on your hard drive. Just type Y and hit Enter.

Once you have wine installed, you should have a Wine item in your Applications menu. If you have the menu item, expand its menu and click on Configure Wine (Applications > Wine > Configure Wine). As you can see from Figure 6, there are a lot of options that you can experiment with when you're trying to get your Windows programs running. The one that is going to probably be the most critical to you though is the Windows pull down menu with the red box around it in Figure 6.

Figure 6

With this option set to the default of Windows 2000, my dad's Kodak software installer wouldn't even run. It complained about the version of Windows I was running. When I set it to Windows XP though, it ran fine. Once the program is installed you can open the Wine C drive (Applications > Wine > Browse C:\ Drive) and navigate to where the program was installed (probably the Program Files directory) and double click it. I can't guarantee it will work, but with some tweaking I've been able to get most things to run. Check out the Wine website for extensive information on how to configure Wine to run Windows programs.

I hope that at least gives some of you a headstart on getting your digital imaging equipment working in Linux. If you hit any snags or have any questions, post them to the comments section and we'll try to help.

Enjoy!