Use an SMB printer in Xubuntu
If you want to print to a windows printer in Xubuntu, you may notice you are missing a "Manage Printers" application. We walk through using the simple CUPS web admin instead to setup a printer in Xubuntu.The CUPS printing system has a web interface for setting up printers, which provides an easy method of adding printers to Xubuntu (not just for SMB printers, and not just in Xubuntu)
Setting up permissions
Firstly, in order for the CUPS web admin to add a printer it verifies your username and password, which means we need to give it access to the shadow password file so it can do this verification. This is done by adding thecupsys
user account to the shadow
user group.You can either do this from a terminal window with the command
sudo usermod -G shadow -a cupsysOR ... you can use the Users and Groups application from the Applications Menu by selecting System -> Users and Groups. Click on the Groups tab, then tick the Show all users and groups checkbox. Select the Shadow group and click on the Properties button. Then select the cupsys user from the left hand list and click Add to add them to the group, then click OK to close the Settings for Group Shadow window, then OK to close the users-admin window.
You see the command line is sometimes quicker ;-)
CUPS Web Admin
Now that the cupsys user has the correct permissions, you need to restart the CUPS service, again easier from a terminal window, with the commandsudo /etc/init.d/cupsys restartNow start a browser (Firefox) and go to the URL http://localhost:631/admin Click on Add printer Enter a name, location and description for the printer, keeping the name short and simple as it is this name that will appear when you click an applications print button. Click continue Now choose how the printer is connected, for a SMB printer, choose Windows printer via SAMBA Now enter the URL for the printer. If it needs a username and password to access the windows shared printer, then use
smb://username:password@servername/sharename
, if it allows anyone to print, then smb://servername/sharename
will suffice, obviously replacing the generic username,password,servername,sharename with the actual values for your SMB shared printer.Now pick the make of your printer. If you are adding an HP printer, then you probably wand to pick HP not Hewlett Packard as they have different lists of models available.
Now select the model number, and if there is more than one line for the model, then pick the one with the recommended driver. And now, if everything has gone to plan, your printer should be added. At this stage I was once prompted for my username and password, but not on subsequent times I added printers. You should now be able to print to your smb printer. Most applications should print fine, though I had couldn't get MousePad (the default text editor) to print, but everything else (firefox,abiword,gnumeric etc) printed fine (even thelpr
command).