Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-12-2007, 05:09 PM   #1
Registered: Dec 2006
Posts: 45

Rep: Reputation: 15
I have print and file sharing to XP boxes working

# Feburary 15, 2007
# This is my SAMBA configuration file, along with a lot of configuration tips and explanations
# The target configuration is for
# 1) a home networking setup using a Windows workgroup (as contrasted with a Windows domain),
with some number of boxes running Windows XP
# 2) with a single LINUX box with printers attached to it
# 3) the LINUX box functioning as a file and print server, using SAMBA and CUPS (Common Unix Printing System)
# 4) printer drivers installed on the XP boxes locally (not using LINUX box as source of XP drivers), so
# LINUX box gets sent "RAW" printer data (that is, native format for printer)
# 5) No authentication of users to access printers/shares, no software firewalls (I trust what I have in my router
# and the ISP also squelches everything but http packets)

# This configuration works, which I define as
# A) Other computers on the home network can read and write to shared files
# B) The LINUX box shows up in Network Neighborhood on Windows XP
# C) The shared files and printers show up in Network Neighborhood
# D) You can print from XP onto the printers attached to the LINUX box
# E) Using XP, you can see the print queues in the LINUX box

# I have notes at the end of this file for how other configurations might be accomplished
# I am running Fedora 6 version 2.6.19-1.2895 (do not know SAMBA and CUPS versions, but I suspect they are recent)

# In addition to this ssmb.conf file, you need
# w) To make sure that the printer software is installed on the LINUX box
# x) To deal with file permissions and SELINUX for the file share and print queue areas (see below)
# y) To make sure cups will know how to process "raw" printer data
# z) To make sure SAMBA/CUPS are installed and running
# (see below for all of this)


workgroup = Your_workgroup_name
netbios name = Your_LINUX_box_name
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
server string = Samba Server
security = share
guest ok = yes
guest account = samba_user
load printers = yes
cups options = raw
log file = /var/log/samba/%m.log
max log size = 50
domain logons = yes
wins support = yes
dns proxy = no

comment = All Printers
path = /var/spool/samba
browseable = yes
printable = yes
writeable = yes
printing = cups
printcap name = cups
printer admim = samba_user, root
disable spoolss = yes
show add printer wizard = no
use client driver = yes

comment = a shared area
path = /file_shares
writeable = yes
browseable = yes
create mask = 0777

# Load Printers parameter exposes to the network all printers defined on the system (I have all printers marked as "shared"
# - I am somewhat unclear as to whether this is necessary)
# The Wins proxy, DNS proxy and Domain Logons are recommended settings that I suspect have little impact on my target
# configuration
# The log file parameter creates separate log files for each machine
# Printer admin is a parameter required for the print queues to be visible by the XP boxes (supposedly this parameter is
# due to be deprecated in upcoming SAMBA releases, but I have no clue as to how the replacement will work).

# I have mine off. Additionally both the CUPS and SAMBA servers can have Host Allow and Host Deny settings that
# permit you to screen out computers that should not have access (I do not have such setting in my configuration).

# When you go to add a printer to the XP system, the Add Printer dialog will (hopefully) work.
# XP will try to find a driver (and in this configuration will not try to look on the LINUX box - see below for why)
# XP will try to see if the appropriate printer driver was previously installed in it, or if the correct driver
# was part of the Windows distribution files. Otherwise you will need the printer install CD.
# Installing an XP driver in this was will install software elements on the XP box which will create a binary stream
# ("raw" in this lingo) of data directly interpretable by the printer, it is this stream which get queued in the LINUX box.
# To have cups correctly process the raw data, you need
# a) a version of SAMBA with a direct interface to CUPS (recent versions have this)
# b) the cups options = raw line above
# c) the file /etc/cups/mime.type to have an uncommented line like "application/octet-stream"
# d) the file /etc/cups/mime.convs to have an uncommented line like
# application/octet-stream application/vnd.cups-raw 0 -
# FYI - the alternative (not used in this configuration) to the raw data streams is to have XP send an Enhanced MetaData print file which
# would get converted to raw by the LINUX box.
# The disable spoolss, use client driver and show add printer wizard options are configured this way as I am putting no XP
# printer drivers on the LINUX box (If you wanted to go in the opposite direction and have XP download the print drivers when
# needed from the LINUX box, you would need to set up a [PRINT$] file share and do a lot of configuration work. Good luck.

# My LINUX distribution did not install SAMBA. Using Terminal, YUM *SAMBA* did what I needed

# You need to satisfy both of these schemes for both (a) the file shares storage and (b) the print queue storage
# Focussing first on the each of the file shares, you need
# i) to make the shared folder updatable by others - a permission string of 0777 will do this,or - if you are using the properties pane
# give "others" the "create and delete files" permission
# ii) to make sure the SELinux is not blocking access, you must either (x) disable SELinux, or (y) change the SELinux policy for
# the folder to permit other users access. For instance, the "root_t" policy - the default for folder at the top of the file system -
# works. Conversely, default policy for the /Home folder, or its subfolders, are the "User Home" or "User Data", and these do not work.
# iii) if there are files existing in the shared folders, you will want to make them updateable by others (same as (i) above)
# iv) the "create mask" parameter has the 0777 value in order to have files added by XP users created with an updateable status
# Now, focussing on the /var/spool/samba folder, you should (or so I read) fix the permissions and check the SELinux policy
# "samba_var_t" works for me

# I use a specific guest account (as opposed to the default "Nobody" user name) as various documentation warns about some
# incompatibilites with the default user name
# SAMBA runs under its own user id (and I have some recollection of confirming that some LINUX component knew that SAMBA
# was a trusted service)

# If you want to use a Domain Controller (in an XP box, or one running on the LINUX box), you have a lot of configuration work to do.
# Good luck

# This configuration does not have the setup somewhat customary to small enterprise configurations, where users log in to
# their Windows machines, and their log-in names and passwords are used to select and validate their access to specific
# file shares or printers. You may see examples of this in the [HOMES] section of various other sample smb.conf files.
# These configurations generally run with the Security parameter set to the value of USER as opposed to SHARE.
Old 02-14-2007, 06:04 AM   #2
Registered: Apr 2004
Location: Europe:Salzburg Austria USA:Orlando,Florida;
Distribution: Debian
Posts: 643

Rep: Reputation: 32
Nicely done.....
Old 02-14-2007, 06:34 AM   #3
Registered: Dec 2006
Posts: 45

Original Poster
Rep: Reputation: 15
thanks ....
Old 02-23-2007, 01:23 PM   #4
Registered: Sep 2006
Distribution: Slackware 12, Fedora Core 5
Posts: 38

Rep: Reputation: 15
how do you do it in the opposite as in have printers connected to a windows xp box and have the linux box print to those printers?
Old 02-24-2007, 10:43 AM   #5
Registered: Dec 2006
Posts: 45

Original Poster
Rep: Reputation: 15
To print to a Windows-hosted printer from a LINUX box, you can try following which worked for me.

I run Fedora6 and use the GUI, so you may have a different process to deal with -

1) Install SAMBA (yum *samba*)
2) Configure samba.conf as described above (actually, you have not need to do much more than type the workgroup name in)
3) Using the Fedora6 GUI, go to Systems, Administration, Printing and push the New Printer button
4) This will bring up the New Printer Wizard, the first screen of which just gets the name you want to assign and descriptive text
5) Hit Forward (and be prepared to wait for a while)
6) Select "Windows Printer via SAMBA"
7) I cannot get the Browse function to work, but I can type in the workgroup_name/computer_name/shared_printer_name
8) Hit foward again, and get a driver installed by selecting manufacturer and then model number

That should do it



cups, file, printer, samba, sharing

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
file and print sharing gwc Linux - Newbie 3 06-03-2005 03:59 PM
Mandrake, XP Pro Help with file/print sharing m-gordon Mandriva 1 01-01-2005 12:51 AM
file and print sharing bdika Mandriva 6 10-09-2004 03:46 AM
Printer Sharing RH9 Boxes Not Working geogecko Linux - Networking 1 12-18-2003 04:12 PM
File-Sharing 2 Suse-boxes. Caeda Linux - Networking 3 11-20-2003 01:43 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration