Windows – Printing from Windows to Ubuntu Shared Printer

network-printerprinterUbuntuwindows-vista

I have two printers, a Dell V715w and a HP LaserJet P2015, connected by USB to a computer running Ubuntu for sharing to all of the laptops in my house with CUPS. I installed both printers locally on the Ubuntu computer, configured CUPS, started it, and tested printing locally, with no problems.

I connected to the HP printer on all of the laptops fine, and tested printing from all of them, also with no problems.

I've tried connecting to the Dell printer on two of the four laptops, running Vista, unsuccessfully. It errors with:

Windows cannot connect to the printer. Make sure that you have typed the name correctly, and the printer is connected to the network.

The Dell printer has wireless networking built in, but I would prefer to use USB. I'm mostly sure that I've installed it correctly, because it does print, just not over the network. The "server" computer and one of the laptops I've tried it on are directly connected to my wireless router through Ethernet. Is there anything that could be causing it to go wrong?

cups error log, as requested:

E [13/Jun/2011:16:23:06 -0400] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
E [13/Jun/2011:16:33:22 -0400] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
E [13/Jun/2011:16:46:31 -0400] [cups-driverd] Bad driver information file "/usr/share/cups/drv/sample.drv"!
E [13/Jun/2011:17:01:42 -0400] [cups-driverd] Bad driver information file "/usr/share/cups/drv/sample.drv"!
W [13/Jun/2011:17:25:41 -0400] Duplicate listen address "0.0.0.0" ignored!
W [13/Jun/2011:17:25:41 -0400] Duplicate listen address "::" ignored!
E [13/Jun/2011:17:25:42 -0400] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
E [13/Jun/2011:17:25:42 -0400] Unable to bind socket for address 0.0.0.0:631 - Address already in use.
E [13/Jun/2011:17:25:42 -0400] Unable to bind socket for address :::631 - Address already in use.
E [13/Jun/2011:17:25:42 -0400] Unable to bind broadcast socket - Address already in use.
W [13/Jun/2011:17:26:28 -0400] Duplicate listen address "0.0.0.0" ignored!
W [13/Jun/2011:17:26:28 -0400] Duplicate listen address "::" ignored!
E [13/Jun/2011:17:26:28 -0400] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
E [13/Jun/2011:17:26:28 -0400] Unable to bind socket for address 0.0.0.0:631 - Address already in use.
E [13/Jun/2011:17:26:28 -0400] Unable to bind socket for address :::631 - Address already in use.
E [13/Jun/2011:17:26:28 -0400] Unable to bind broadcast socket - Address already in use.
E [13/Jun/2011:17:27:22 -0400] Missing printer-uri, job-uri, or ppd-name attribute!
E [13/Jun/2011:17:27:22 -0400] Returning IPP client-error-bad-request for windows-ext (no URI) from 192.168.1.2
E [13/Jun/2011:17:30:20 -0400] Missing printer-uri, job-uri, or ppd-name attribute!
E [13/Jun/2011:17:30:20 -0400] Returning IPP client-error-bad-request for windows-ext (no URI) from 192.168.1.6
E [13/Jun/2011:17:33:39 -0400] Missing printer-uri, job-uri, or ppd-name attribute!
E [13/Jun/2011:17:33:39 -0400] Returning IPP client-error-bad-request for windows-ext (no URI) from 192.168.1.3
E [13/Jun/2011:17:37:16 -0400] Missing printer-uri, job-uri, or ppd-name attribute!
E [13/Jun/2011:17:37:16 -0400] Returning IPP client-error-bad-request for windows-ext (no URI) from 192.168.1.5
E [13/Jun/2011:18:01:11 -0400] [cups-driverd] Bad driver information file "/usr/share/cups/drv/sample.drv"!
E [13/Jun/2011:18:02:08 -0400] [cups-driverd] Bad driver information file "/usr/share/cups/drv/sample.drv"!
E [13/Jun/2011:18:03:25 -0400] [cups-driverd] Bad driver information file "/usr/share/cups/drv/sample.drv"!
E [13/Jun/2011:18:57:20 -0400] [Job 3] 
E [13/Jun/2011:18:57:25 -0400] [Job 3] 
W [13/Jun/2011:18:58:45 -0400] Duplicate listen address "0.0.0.0" ignored!
W [13/Jun/2011:18:58:45 -0400] Duplicate listen address "::" ignored!
E [13/Jun/2011:18:58:45 -0400] Unable to remove temporary file "/var/spool/cups/tmp/.hplip" - Is a directory
E [13/Jun/2011:18:58:45 -0400] Unable to bind socket for address 0.0.0.0:631 - Address already in use.
E [13/Jun/2011:18:58:45 -0400] Unable to bind socket for address :::631 - Address already in use.
E [13/Jun/2011:18:58:45 -0400] Unable to bind broadcast socket - Address already in use.
E [13/Jun/2011:19:01:54 -0400] [cups-driverd] Bad driver information file "/usr/share/cups/drv/sample.drv"!
E [13/Jun/2011:19:06:25 -0400] Missing printer-uri, job-uri, or ppd-name attribute!
E [13/Jun/2011:19:06:25 -0400] Returning IPP client-error-bad-request for windows-ext (no URI) from 192.168.1.2

cupsd.conf, also as requested:

LogLevel warn
MaxLogSize 0
SystemGroup lpadmin
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
Listen 631
# Share local printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseRemoteProtocols
BrowseAllow all
BrowseAddress @LOCAL
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
<Location />
  # Allow shared printing...
  Order allow,deny
  Allow @LOCAL
</Location>
<Location /admin>
  # Restrict access to the admin pages...
  Order allow,deny
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  # Restrict access to the configuration files...
  Order allow,deny
</Location>
<Policy default>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  <Limit Create-Job Print-Job Print-URI>
  AuthType Default
  Order deny,allow
</Limit>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job CUPS-Get-Document>
AuthType Default
Require user @OWNER @SYSTEM
Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
  AuthType Default
  Require user @SYSTEM
  Order deny,allow
    </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
      </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
      AuthType Default
      Require user @OWNER @SYSTEM
      Order deny,allow
        </Limit>
  <Limit All>
        Order deny,allow
          </Limit>
</Policy>

Best Answer

Trying to print over Samba has always given me nothing but headaches. I suggest you use the Internet Printing Protocol (IPP) instead.

First make sure your have IPP enabled in CUPS on your print server:

  1. Browse to http://localhost:631/ on the print server machine.
  2. Go to the Administration tab.
  3. Make sure Share printers connected to this system and Allow printing from the Internet are checked.
  4. Click the Change Settings button.
  5. CUPS will restart to allow your changes to take effect.

Then, set up the printers on the Vista machines thusly:

  1. Go to Start > Devices and Printers.
  2. Click Add a printer on the toolbar.
  3. Click Add a network, wireless, or Bluetooth printer
  4. Click The printer I want isn't listed
  5. Select Select a shared printer by name
  6. Enter http://<hostname>:631/printers/<printer-name> where <hostname> is the hostname or IP address of your Ubuntu machine hosting the printer and <printer-name> is the Queue name revealed by the CUPS admin interface.
  7. Windows should connect to your printer.
  8. You'll now be prompted to select a driver for your printer. You can select the Generic manufacturer and MS Publisher Imagesetter printer driver, which will just have Windows send print jobs to CUPS in PostScript format and allow CUPS to use its driver instead, or select the driver for your printer if you need to use any advanced features it offers. (The former generally works better, IMHO.)
  9. Click OK.
  10. Windows verifies that you have successfully installed the printer. Click Next.
  11. You are given the option print a test page to verify that everything works if you'd like.
Related Question