Sharing Printer with CUPS

I'm on Ubuntu server 10.10 and I need to connect a HP Laserjet printer via USB and share it to the LAN. I followed some tutorial on the internet to install the HPLIP drivers and configuring CUPS. I have access to the web interface of the server and printing the test page works like a charm.

I can also edit all the default printer options, viewing the queue and so on.

The only thing that I can't do is installing and find the printer from other clients on same the LAN. I tried it with Windows 7's default searching and nothing appears, I tried to install a new TCP/IP port with the server's IP address and add the printer's driver manually but didn't work either.

What I have to do or check to get this to work? The only problem is that the printer isn't visible on the LAN but it's correctly installed on the Ubuntu server.


Do you have a GUI desktop environment installed? You should be able to run /usr/share/system-config-printer/system-config-printer.py and enable sharing connected printers, then on other computers enable show shared printers.


I will help but this is from the top of my head so you might need to change some stuff:

First verify you have the printer connected and samba/cups installed. So if you do a apt-get /aptitude search you should have the packages cups and samba installed. Cups is to handle the printer. Samba is to handle the sharing in case a Windows system will connect to that shared printer (Your case). If you do not have them installed then:

sudo apt-get install cups samba or using aptitude sudo aptitude install cups samba

After that we start with the configuration of them. Since you are on the server version of Ubuntu you do not have any default way of using a GUI solution (I say default since some people install GUI packages) so the following is for pure server:

  1. Edit your samba main configuration. The file is in /etc/samba/smb.conf. To edit the file simply type sudo nano /etc/samba/smb.conf If you are root you do not need the sudo part.

    We want to change the following variables and remove the comment (# or ;) symbols in front of them if they have it. So for example:

    If it looks like this # workgroup = WORKGROUP you would leave it like this
    workgroup = WORKGROUP (Without the # symbol).

    If it looks like this ; guest = yes you would leave it like this
    guest = yes (Without the ; symbol):

    workgroup - Change it to the workgroup you are using on your network. If your network is "xtreme" like in my case it should say:

    workgroup = xtreme (Remember to remove the comment if it has one)

    security - Change it to share. It will save you several issues later on.

    security = share

  2. Edit your samba printer section.

The printer section would look something like this:

 [printers]
    comment = All Printers
    browseable = no
    path = /var/spool/samba
    printable = yes
;   guest ok = no
;   read only = yes
    create mask = 0700

what we want to do is change browseable to yes and guest ok to yes

Should look like this after editing:

 [printers]
    comment = All Printers
    browseable = yes
    path = /var/spool/samba
    printable = yes
    guest ok = yes
;   read only = yes
    create mask = 0700

This is all. Now restart the samba service. you can do it in several ways:

sudo service smbd restart

sudo /etc/init.d/smbd restart

Now go to your windows system or linux system and look for the printer in the network or the server IP.