One of the biggest challenges for AwaOS will be printing. In Ubuntu, the main underlying infrastructure for printing is of course CUPS, but on the standard Gnome desktop, setting this up relies on GUI tools with Gnome dependencies. A Google search of course offers plenty of HOW-TO pages, such as this one: https://help.ubuntu.com/10.04/serverguide/C/cups.html Being part of the Ubuntu Server Guide, luckily this particular offering does not rely on the use of GUI tools. At the same time, not all the information presented is necessary, because in fact installing cups also installs a web server and content on your localhost that provides a web based configuration interface anyway, and when sharing a printer, this interface can be set to accept connections from your LAN (but not the Internet by default), making the GUI tools in Gnome not only redundant but almost obfuscating in a way. While not directly AwaOS related yet, I’m documenting my run through of setting up CUPS to share a Canon printer on my LAN here and configuring the client on both Linux (Ubuntu 10.04 running LXDE) and Windows XP. The HOW-TO above is worth reading for general information, but it is probably not necessary to edit the config file with a text editor for most people as the HOW-TO suggests. Rather, simply use the Web interface. I’ve listed the pertinent steps below:
First, obviously, install cups.
sudo apt-get install cups
Then it is perhaps not a bad idea to do as the HOW-TO suggests and backup the default config file and make it read only. Don’t do what I did and accidentally make the actual config file read only….
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original sudo chmod a-w /etc/cups/cupsd.conf.original
Then you can basically skip the rest of the HOW-TO and just add your user account to the allowed printer users. Remember to add each user in this manner:
sudo usermod -aG lpadmin username
where username is your username.
Then open up your browser and browse to http://localhost:631/admin where you can add and remove printers, check error and print logs, and configure your cups server.
As far as I know, for a Linux client you basically have to install cups on the client as well and go through the same process, which is what I did. However, when you add your printer, you add the one on the other machine (over the network) rather than a local one.
To continue, I will note how I set up my printer, a Canon Pixus iP2200 (known as the Pixma iP2200 outside Japan) on a headless Ubuntu 10.04 server, an Ubuntu client running LXDE, and a windows XP client. The process for installing the driver will be different for your printer, if in fact there is even a Linux driver for it. Of course, before you do this, make sure your printer is connected to the server machine and turned on. Also note that the process is the same for a single machine environment, in which case the “server” and “client” are the same.
- Install cups on both the server and the Ubuntu client
- Find and install the printer driver. This is far easier said than done. Often, Linux drivers provided by the manufacturer do not work because they are old, designed specifically for other distros, or for whatever other reason. This is precisely the case with the Pixus/Pixma drivers. Both the manufacturers drivers and some hacked third party drivers are old, unmaintained, and fail to get a response out of the printer. Luckily, a Japanese programmer has written his own which I obtained here:
http://mambo.kuhp.kyoto-u.ac.jp/~takushi/
(Update: Canon also provides a list of drivers for their printers now including .deb format at http://cweb.canon.jp/drv-upd/bj/other.html. However note that all of these are older and have the libcupsys2 problem below.)Unfortunately, this driver was written for Debian/Ubuntu before the switch from libcupsys2 to libcups. This is likely the case for most Linux printer drivers you can lay your hands on, so you need to force install the older libcupsys2.
Navigate your browser to http://security.ubuntu.com/ubuntu/pool/universe/c/cups/ and click on the libcupsys2_1.3.9-17ubuntu3.9_all.deb link (or the latest version of that file if it has changed – the link has changed since this post was originally written and the post now reflects the current as of 2010.12.20) to download the last .deb package originally created for Jaunty. This installed fine for me on the headless Lucid server and my client running LXDE. Then I added the repository provided by Takushi at Kyoto University and installed the printer driver, which installed without incident. - Then configure cups on the server to use the printer. If you are on your server in a desktop environment or a console with Links or other text browser, navigate to http://localhost:631/admin. Otherwise, on another machine, navigate to http://<hostname or ip address of the server>:631/admin. In any case, you first have to configure cups to accept connections from the LAN when accessing from another machine, which is done by first accessing the web admin interface at http://localhost:631/admin, checking “Allow remote administration” and clicking “Change settings“. As my server is headless, I did that by logging in to a shell with ssh and running links, which worked fine. From then on I could access remotely. Either way, once you have the admin page in front of you, click on Add Printer. You will be ‘upgraded’ to an SSL connection and some browsers will warn you that the SSL certificate cannot be verified. Ignore that and click through. You will then be asked to log in with the user account that you added above to the lpadmin group. Hopefully then your printer will be listed under Local Printers, so check in and Continue. Enter in the name, title, and location with whatever values suit you, and make sure to check “share printer”, then Continue.
On the next page you will choose the driver for the printer. You can select an existing driver from the dropdown menu or load a printer driver file. The process you use here will depend on your driver. In my case, when I tried the manufacturers driver I had to select the driver file and load it, but in the case of Takushi’s Debian/Ubuntu driver (installed with apt-get), the driver showed up in the drop down menu because it was installed in a way Ubuntu expected. Finally click Add Printer. Try a test print: go back to the top page of the admin section, click manage printers, select your newly installed printer, and select Print Test Page from the Maintenance drop down menu. Also recommended is to make this the default printer for the system. Under the Administration menu on the same page and select Set as Server Default. - To add the printer to a Ubuntu client, you follow almost the same process on the client, unless you use the standard Gnome desktop in which case I suppose you should use the GUI tools available to avoid conflicts. I am using LXDE, so no GUI tool. So in the case of anyone not using Gnome or probably KDE as well, this method is valid. Install cups, add yourself as a user to the lpadmin group, install the printer driver locally in the same way, and navigate to http://localhost:631/. Here, you want to check Show printers shared by other systems, and then click Add Printer. If you are lucky, your printer already shows up, otherwise select either Internet Printing Protocol (http) or Internet Printing Protocol (ipp). You will be asked for the URL of the printer. To find that, open another browser window, browse to http://<hostname or ip address of your server>:631/printers/ to see a list of printers, click on the one you want to add, and note or copy the URL for it. Also note that if you use IPP to access your server, the URL starts with ipp://, and if you use HTTP, it is obviously http://. Personally, I don’t know the pros and cons of either protocol. Note that checking the printer URL this way is a simple but important step that I find most HOW-TO’s have left out, and it is the number one reason why people have trouble sharing a Linux based printer with Windows (they get the URL wrong and don’t know how to look it up). Click Continue (don’t share the printer on the client side by the way!) and then the remaining steps are pretty much the same as above. Do a test print to make sure you are connected.
- For a windows XP client (process should be similar for other Windows variants), you simply go through the normal add-a-printer process. Make sure you already have the Windows driver for the printer installed. Note that in some cases you may need to physically connect the printer to the windows client via USB in order to do so, but once the driver is installed you should, in many cases, be able to move it back to the server and access it over the LAN whether or not the manufacturer intended it to be used that way. When adding the printer, select the third radio button down for connection over the LAN and type in the *same* URL that you noted above. You will be asked to select the driver. Again, since you have already installed it, it should show up in the driver list. Once the printer shows up on your system, you can do a test print by right clicking its icon, selecting Properties, and a button will be there to run a test print.
And that is basically all I had to do, not including all the trial and error to finally understand this process.







