17.7 Client Driver Installation Procedure

As Don Quixote said: " The proof of the pudding is in the eating ." The proof for our setup lies in the printing. So let's install the printer driver onto the client PCs. This is not as straightforward as it may seem. Read on.

17.7.1 First Client Driver Installation

Especially important is the installation onto the first client PC (for each architectural platform separately). Once this is done correctly, all further clients are easy to setup and shouldn't need further attention. What follows is a description for the recommended first procedure. You work now from a client workstation. You should guarantee that your connection is not unwittingly mapped to bad user nobody. In a DOS box type:

 net use \\  SAMBA-SERVER  \print$ /user:root 

Replace root, if needed, by another valid printer admin user as given in the definition. Should you already be connected as a different user, you will get an error message. There is no easy way to get rid of that connection, because Windows does not seem to know a concept of logging off from a share connection (do not confuse this with logging off from the local workstation; that is a different matter). You can try to close all Windows file explorer and Internet Explorer for Windows. As a last resort, you may have to reboot. Make sure there is no automatic reconnection set up. It may be easier to go to a different workstation and try from there. After you have made sure you are connected as a printer admin user (you can check this with the smbstatus command on Samba), do this from the Windows workstation:

  1. Open Network Neighborhood .

  2. Browse to Samba server.

  3. Open its Printers and Faxes folder.

  4. Highlight and right-click on the printer.

  5. Select Connect (for Windows NT4/200x it is possibly Install ).

A new printer (named printername on Samba-server) should now have appeared in your local Printer folder (check Start Settings Control Panel Printers and Faxes ).

Most likely you are now tempted to try to print a test page. After all, you now can open the printer properties, and on the General tab there is a button offering to do just that. But chances are that you get an error message saying Unable to print Test Page. The reason might be that there is not yet a valid Device Mode set for the driver, or that the " Printer Driver Data " set is still incomplete.

You must make sure that a valid Device Mode is set for the driver. We now explain what that means.

17.7.2 Setting Device Modes on New Printers

For a printer to be truly usable by a Windows NT/200x/XP client, it must possess:

  • A valid Device Mode generated by the driver for the printer (defining things like paper size, orientation and duplex settings).

  • A complete set of Printer Driver Data generated by the driver.

If either of these is incomplete, the clients can produce less than optimal output at best. In the worst cases, unreadable garbage or nothing at all comes from the printer or it produces a harvest of error messages when attempting to print. Samba stores the named values and all printing related information in its internal TDB database files ( ntprinters.tdb , ntdrivers.tdb , printing.tdb and ntforms.tdb ).

What do these two words stand for? Basically, the Device Mode and the set of Printer Driver Data is a collection of settings for all print queue properties, initialized in a sensible way. Device Modes and Printer Driver Data should initially be set on the print server (the Samba host) to healthy values so the clients can start to use them immediately. How do we set these initial healthy values? This can be achieved by accessing the drivers remotely from an NT (or 200x/XP) client, as is discussed in the following paragraphs.

Be aware that a valid Device Mode can only be initiated by a printer admin , or root (the reason should be obvious). Device Modes can only be correctly set by executing the printer driver program itself. Since Samba cannot execute this Win32 platform driver code, it sets this field initially to NULL (which is not a valid setting for clients to use). Fortunately, most drivers automatically generate the Printer Driver Data that is needed when they are uploaded to the [print$] share with the help of the APW or rpcclient.

The generation and setting of a first valid Device Mode, however, requires some tickling from a client, to set it on the Samba server. The easiest means of doing so is to simply change the page orientation on the server's printer. This executes enough of the printer driver program on the client for the desired effect to happen, and feeds back the new Device Mode to our Samba server. You can use the native Windows NT/200x/XP printer properties page from a Window client for this:

  1. Browse the Network Neighborhood .

  2. Find the Samba server.

  3. Open the Samba server's Printers and Faxes folder.

  4. Highlight the shared printer in question.

  5. Right-click on the printer (you may already be here, if you followed the last section's description).

  6. At the bottom of the context menu select Properties (if the menu still offers the Connect entry further above, you need to click on that one first to achieve the driver installation as shown in the last section).

  7. Go to the Advanced tab; click on Printing Defaults .

  8. Change the Portrait page setting to Landscape (and back).

  9. Make sure to apply changes between swapping the page orientation to cause the change to actually take effect.

  10. While you are at it, you may also want to set the desired printing defaults here, which then apply to all future client driver installations on the remaining from now on.

This procedure has executed the printer driver program on the client platform and fed back the correct Device Mode to Samba, which now stored it in its TDB files. Once the driver is installed on the client, you can follow the analogous steps by accessing the local Printers folder, too, if you are a Samba printer admin user. From now on, printing should work as expected.

Samba includes a service level parameter name default devmode for generating a default Device Mode for a printer. Some drivers will function well with Samba's default set of properties. Others may crash the client's spooler service. So use this parameter with caution. It is always better to have the client generate a valid device mode for the printer and store it on the server for you.

17.7.3 Additional Client Driver Installation

Every additional driver may be installed, along the lines described above. Browse network, open the Printers folder on Samba server, right-click on Printer and choose Connect... . Once this completes (should be not more than a few seconds, but could also take a minute, depending on network conditions), you should find the new printer in your client workstation local Printers and Faxes folder.

You can also open your local Printers and Faxes folder by using this command on Windows 200x/XP Professional workstations:

 rundll32 shell32.dll, SHHelpShortcuts_RunDLL PrintersFolder 

or this command on Windows NT 4.0 workstations:

 rundll32 shell32.dll, Control_RunDLL MAIN.CPL @2 

You can enter the commands either inside a DOS box window or in the Run command... field from the Start menu.

17.7.4 Always Make First Client Connection as root or " printer admin "

After you installed the driver on the Samba server (in its [print$] share, you should always make sure that your first client installation completes correctly. Make it a habit for yourself to build the very first connection from a client as printer admin . This is to make sure that:

  • A first valid Device Mode is really initialized (see above for more explanation details).

  • The default print settings of your printer for all further client installations are as you want them.

Do this by changing the orientation to landscape, click on Apply , and then change it back again. Next, modify the other settings (for example, you do not want the default media size set to Letter when you are all using A4 , right? You may want to set the printer for duplex as the default, and so on).

To connect as root to a Samba printer, try this command from a Windows 200x/XP DOS box command prompt:

 C:\> runas /netonly /user:root "rundll32 printui.dll, PrintUIEntry /p /t3 /n \\SAMBA-SERVER\printername" 

You will be prompted for root's Samba-password; type it, wait a few seconds, click on Printing Defaults , and proceed to set the job options that should be used as defaults by all clients. Alternately, instead of root you can name one other member of the printer admin from the setting.

Now all the other users downloading and installing the driver the same way (called " Point'n'Print ") will have the same defaults set for them. If you miss this step you'll get a lot of Help Desk calls from your users, but maybe you like to talk to people.

Official Samba-3 HOWTO and Reference Guide
The Official Samba-3 HOWTO and Reference Guide, 2nd Edition
ISBN: 0131882228
EAN: 2147483647
Year: 2005
Pages: 297

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net