Originally Posted by
Mugatu
I just had this error on a Server 2008 R2 machine. I don't know if this will help you or not, but this is what I did to fix it:
Start --> Run --> gpedit.msc --> OK
Computer Configuration --> Administrative Templates --> Printers --> Always render print jobs on the server --> right-click --> Edit --> Disabled --> OK
OMG!!! THANK YOU FOR THIS!! I've been working on getting a printer share via samba+cups working for weeks now, and this fixed it!
For posterity (because I really hope nobody ever has to struggle with this again):
I kept getting various errors such as these hideously unhelpful ones:
"windows cannot connect to the printer 0x000006d1"
"Cannot install printer. The print processor does not exist."
"There are no Print Processors"
Reason for Problem:
Samba only supports 'winprint' Print Processor and 'RAW' Data Type. HP printer I was trying to install had a custom print processor: 'hpzpplhn.dll', and kept complaining about it.
Steps to fix:
- I configured drivers for samba using this guide (and also this guide) and running:
- (Optional) I installed this windows update(KB2647753) (not sure if this was completely necessary, but could also fix other potential windows printing problems?)
- Deleted the offending printer from my system via:
Start --> Run [Super+R]
Code:
printmanagement.msc
--> OK
Print Management --> Print Servers --> (Local machine name) --> Printers
Select printer, right click & delete! - Deleted the related printer driver via printmanagement.msc
Print Management --> Print Servers --> (Local machine name) --> Drivers
Select the related printer driver, right click & delete! - Start --> Run --> --> OK
Computer Configuration --> Administrative Templates --> Printers --> Always render print jobs on the server --> right-click --> Edit --> Disabled --> OK - Start --> Devices and Printers --> Add a printer --> Add network printer --> Select printer shared via linux samba server --> next..next..finish SUCCESS!
Additional Troubleshooting Info
I ran into various permissions issues along the way. Make sure your /etc/samba/smb.conf has these settings when you are trying to use cupsaddsmb, or you are remotely adding printer drivers:
Code:
[global]
security = user
username map = /etc/samba/smbusers # You may need to configure this to map your linux username to your windows one if they're different
load printers = yes
printing = cups
printcap name = cups
[printers]
comment = All Printers
browseable = yes
path = /var/spool/samba
printable = yes
writeable = no
; guest ok = no
; read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /etc/samba/drivers
browseable = yes
writeable = yes
read only = no
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
write list = root, @lpadmin ## You may also need to explicitly add your usernames here if you have problems. For Example: root, @lpadmin, linuxusername, windowsusername, Administrator)
Helpful commands to troubleshoot:
rpcclient: Used to explore the samba shared printers, drivers, etc...
For help, run
Code:
rpcclient localhost -N
help
help <some-command>
adddriver --help
exit # exits out of rpcclient shell
create a tmp file with your samba credentials like this:
Code:
echo -e 'username = your-username\npassword = your-password\ndomain = your-workgroup-name' >> /tmp/smbauth
Code:
#List all shared printers:
rpcclient localhost -N -A /tmp/smbauth -c 'enumprinters'
#List all drivers installed on server:
rpcclient localhost -N -A /tmp/smbauth -c 'enumdrivers'
#List all print processors/datatypes on server (right now samba only supports 'winprint' & 'RAW'):
rpcclient localhost -N -A /tmp/smbauth -c 'enumprocs'
rpcclient localhost -N -A /tmp/smbauth -c 'enumprocdatatypes'
#Get info about your printer:
rpcclient localhost -N -A /tmp/smbauth -c 'getprinter your-printer-name'
#Get lots of info about your printer:
rpcclient localhost -N -A /tmp/smbauth -c 'getprinter your-printer-name 2'
#Get info about installed driver:
rpcclient localhost -N -A /tmp/smbauth -c 'getdriver your-driver-name'
Help for adddriver command:
Code:
Usage: adddriver <Environment> \
<Long Printer Name>:<Driver File Name>:<Data File Name>:\
<Config File Name>:<Help File Name>:<Language Monitor Name>:\
<Default Data Type>:<Comma Separated list of Files> \
[version]
smbclient: Used to connect to samba shares, upload drivers, etc...
Code:
#Copy x64 driver files from windows to ~/mydrivers/ first
cd ~/mydrivers/
smbclient //localhost/print$ -N -A /tmp/smbauth -c "$(for f in $(ls -1 .); do echo "put /home/your-username/mydrivers/${f} x64/${f}; "; done)"
#Install a new driver (I tried manually installing Windows 7 x64 driver for HP PSC 1300 series in samba)
rpcclient localhost -N -A /tmp/smbauth -c 'adddriver "Windows x64" "psc-1300-series-driverhack:unidrv.dll:hpo1300t.gpd:unidrvui.dll:unidrv.hlp:LIDIL hpzlllhn:RAW:hpzevlhn.dll,hpzstlhn.dll,hpzuilhn.dll,hpz3rlhn.dll,hpzlalhn.dll,hpzsslhn.dll,hpo13x0t.gpd,hpz3clhn.ini,hpzsmlhn.gpd,hpz3mlhn.gpd,hpo1300t.xml,hpzsclhn.dtd,hpfres50.dll,hpfime50.dll,hpfiglhn.dll,hpzprlhn.dll,hpzlelhn.dll,unires.dll,stdnames.gpd,stddtype.gdl,stdschem.gdl,stdschmx.gdl"'
rpcclient localhost -N -A /tmp/smbauth -c 'setdriver psc-1300-series psc-1300-series-driverhack'
printmanagement.msc: Windows tool for administering print servers.
If you have allowed remote management in samba, you can add drivers more easily using this tool. Just add your server by clicking: Print Servers --> right click --> Add/Remove Servers --> Browse --> Select Server --> Add to list --> Apply --> OK
To add drivers: Drivers --> right click --> Add Driver --> select arch (x64 or x86) --> next --> select manufacturer & printer model --> next --> finish
regedit.exe: Edits windows registry (so we can look for the printer-related registry keys)
To see what your printer driver's settings are (these are what to input into the rpcclient -c'adddriver' command) look under:
(x64-bit): HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Environments\Windows x64\Drivers\Version-3
(32-bit): HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Environments\Windows NT x86\Drivers\Version-3
Installed Print Processors are under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Environments\Windows x64\Print Processors
Print Monitors are under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Monitors
Bookmarks