Jump to content

Sharing a Printer with Windows


jbuckley2004
 Share

Recommended Posts

I had such a hard time getting my linux box (Mandriva 2007 free) to detect and access the printer on my wife's win2k box (via a wireless router) that I thought I would describe the mistakes I made and the steps necessary to get the setup working.

 

I went through the following sources to find the information: perhaps some of it will help you too -

http://www.biz1.net/cifs_help.htm - all about CIFS

http://www.liv.ac.uk/csd/mobile/myfilestore/cifs.htm - more CIFS details

http://samba.anu.edu.au/cifs/docs/what-is-smb.html - just what is samba, anyway?

http://www.microsoft.com/mind/1196/cifs.asp - The reasons MS has made this so damn difficult...

http://learn.clemsonlinux.org/wiki/Samba_client - If you want to do it the old-fashioned way...

http://www.linux-foundation.org/en/OpenPri...tabase/MainPage - where to find drivers

http://www.linuxquestions.org/linux/answer...nter_using_CUPS - This describes a different configuration, but can be helpful!

 

First of all, it's necessary to have administrator access on the windows box. You'll need to do a couple of things:

1) from start->setup->printer, right click on the printer and select sharing. If it isn't already, make the printer a shared device (check the box) and under the 'sharing' tab give it a name or note the default name. Write it down; you'll need it exactly as written, case sensitive (and if you're giving it a name, it's easiest by far to not use spaces or some special characters. KISS).

2) optional, but highly recommended: from the control panel create an account (users&passwords) with the lowest level of privelges possible and NO password. We'll be letting the linux box 'log into' this account remotely, later (and evermore) to get to the printer. Although you can get to it from any account that is password protected (including the administrator), becasue of a bug in printerdrake, the password is sent over the air in the clear. Broadcasting your password for the administrator account is not a particularly good idea, right?

3) If you don't know it, get the ip of the windows box. From start->programs->accessories bring up the command prompt. From there, type >ipconfig and get the ip address. It's probably something like 192.168.1.2.

4) In theory you should be able to use the name of the windows box (assigned at installation) in place of the ip above (I believe you can find it by right clicking on 'My Computer', properties and digging around a bit), but was totally unable to get it working using that name.

 

Big Mistake #1: If you have a firewall running on the windows box, make sure it's configured to allow the printer to be seen. You have a firewall on your windows box, right?

 

Ok, you're done on the windows box. Assuming the printer is working there, it's good to go.

 

On the Linux box you will need to install drivers and CUPS next. I discovered that the printer I was using (an HP Office Jet) has very good linux support, (as does Epson, I hear) and has linux drivers available from many sources. If you need to find yours, start with http://www.linuxprinting.org - I installed the latest version of lpijs (the driver for my hp printer) using the on-screen directions. This failed the first time because (Big Mistake #2) CUPS needs to be installed first.

 

CUPS has a few dependencies, and when all was said and done the cups packages installed were:

cups-1.2.4-1.mdv2007.0

cups-common-1.2.4-1.1mdv2007.0

cups-drivers-2007-6mdv2007.0

gutenprint-cups-5.0.0-2mdv2007.0

libcups2-1.2.4-1.1mdv2007.0

libcups2-devel-1.2.4-1.1mdv2007.0

libgnomecups-0.2.2-3mdv2007.0

libgnomecups-1.0_1-0.2.2-3mdv2007.0

The packages on your system may be slightly different, of course, if you're not using Mandriva 2007.0 free, and I'm not 100% sure that all the above are necessary. But it appears they are sufficient.

 

Now I went back and installed the driver for the printer successfully. It is, btw, a command line operation, but it is very straight forward (so don't be afraid, newbies!)

 

Big Mistake #3 - CUPS service is NOT started automatically. It's necessary to turn on the system service via the MCC [star/kicker]->system->configuration->configure your computer->(root password)->system->Enable or disable a system service. The CUPS entries are the eighth and ninth ones on the list, in my set up anyway. You probably want to check "on boot" for CUPS and "start", and check "start when requested" for CUPS lpd. If you do not start the service then you will get the error "Connection to CUPS Servicer failed." when you select the print option from most any application, like an editor.

 

From here there are several ways to get the linux box talking to the printer via the windows box, and I went down many unnecessary paths. I'll describe two ways to get to where you want to go.

For Mandriva users, the printerdrake tool works fine now (or, at least it did for me) once I ignored the 'host name' entry and provided an IP for the host machine instead. From the top:

[star/kicker]->system->configuration->configure your computer->(enter root password)(select Hardware)(select Set up the printer(s), the print job queues...).

 

Using the Drake tool:

Select Configure CUPS from the tool bar or menu. Select the check box "Automatically find available printers on remote machines" and click Ok.

Click on the Add Printer icon and select the appropriate check box - for me it was "Auto-detect printers connected to machines running Microsoft Windows"

 

Big Mistake #4: The search *will* return something, even if it's only a generic name that is in reality a 'dummy' file attached to your linux box. Be sure it also returns the correct printer attached to the correct IP address, that is, the IP of your windows box that you found above. (If it doesn't, make sure that your printer is really accessible through the network [is the windows box running??? - I suggest here using ping to be sure that there is some network connectivity].

Select that printer. For me, printerdrake correctly identified the printer, it's make and model and located the driver I had installed earlier.

 

Big Mistake #5: It says "success", but you're not good to go just yet. There is authentication information you may need to provide. If you do not, then if you look in the right place, the smb logs or the CUPS web-based tool's job information tab, you will see the error message "Unable to connect with CIFS host." when you try to print.

 

From Printerdrake, select the tab "Configured on this machine" (isn't this confusing? I thought it was configured on the *other* machine, but nooooo....) and highlight the printer line. Click the edit icon. Select the Printer Connection Type line and Do it! Select the Printer on SMB/Windows server check box.

 

Big Mistake #6: The SMB Printer Options information has to be correct (e.g. the share name hpoffice is *not* the same as HPoffice and it's definitely not the same as "HP Office"), but not all of it is necessary. I think there is a bug here, too. The share name (see above - you wrote it down, right?) is required. The user name and password for the account you set up is required (there is an information box here that says the password is broadcast in the clear, so please please please use something other than the administrator account, and now you know why the password-less, powerless account on the windows box is a better choice). The SMB server host should be the name of your windows box, but I just could not get that to be recognized. Authentication failed for me until I left it blank and used the SMB server IP (the IP of the windows box) instead. I left Workgroup blank with no problem.

 

If you're successful, you should be able to print a test page - it's one of the options. Congratulations! You're done.

 

Using web-based CUPS administrator tool:

From your browser, go to http://localhost:631/ The Common UNIX Printing System configuration tool comes up. I found the interface a little confusing at first, but not too bad once you get used to it. Across the top are tabs for home (the page you're looking at), administration, and helpfully, jobs and printers. If you've configured your printer already using something like the above instructions, click on the printers tab and see if the information there looks right. In particular, the device URI should be the be the IP and sharename that you entered into printerdrake before. The make and model should be correct, as discovered automagically by printerdrake.

 

If you haven't set up the configuration, click on the administration tab and then select Add Printer. The first time you do this it will ask for the root login - use root for the id and the linux root password. For Name, use the share name (exactly!) that was used on the Windows box in Step 1 up top, location and description are free-form entries for you to use. It then wants the same information that printerdrake asks for; I suspect smb://localhost/yourexactsharename or smb://192.168.1.(?)/yourexactsharename (where (?) completes the IP of your windows box) works, but did not for me for reasons stated below. Click continue, and select your printer, make and model from the list. If your drivers were successfully installed before, then you will have an indication that you can use CUPS.

 

But I have NOT been able to find where to enter the authentication (windows account name and password) in this web-based interface. If someone can find it, please tell us! Without a proper authentication, when you try to print you'll soon see a message that reads "Unable to connect with CIFS host (retrying in 60 sec.) when you click on the printer tab. This was, unfortunately, my only clue (at first) that it was CIFS authentication that was failing.

 

I found it very handy to check the status of print jobs, and easy to clear away all my mistakes building in the printer queue, by clicking on the jobs tab and deleting all jobs.

 

Hope this helps.

Edited by jbuckley2004
Link to comment
Share on other sites

  • 2 months later...
Guest Beril the Dwarf

The uri you want is:

smb://username:password@workgroup/hostname/sharename

I'm not a Mandrake user, but this is universal for the CUPS web interface.

Best,

Beril the Dwarf

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...