[Samba] Desiring to set up Windows Vista and Linux Fedora Core 4

Michael Wood esiotrot at gmail.com
Sat Oct 10 07:45:17 MDT 2009


Hi Barry

2009/10/10 Barry L. Bond <bbond at cfl.rr.com>:
> Hi Michael!
>
>     Thank you for your fast reply!
>
> On Sat, Oct 03, 2009 at 04:35:50PM +0200, Michael Wood wrote:
>
>> From what you say above, I assume that the Windows machine is on
>> either 192.168.1.x or 192.168.2.x networks?  Don't forget to use a
>> full stop after them like:
>>
>> hosts allow 192.168.1. 192.168.2.
>>
>> or you could write it like:
>>
>> hosts allow 192.168.1.0/24 192.168.2.0/24
>
>     Hmmmm... I have "hosts allow = 192.168.1., 192.168.2., 127."

That looks fine as long as the Windows machine is on 192.168.1.x or
192.168.2.x.  According to the documentation you can use either commas
or spaces (or both) to separate them.

>     I have a space between the IP address excerpts (I presume that's what
> you mean by the full stop), though I also have a comma.  I'll remove the
> commas...

By "full stop" I mean what Americans like to call a "period" :)  i.e.
a dot.  In other words I just wanted to make sure you had something
like:

hosts allow 192.168.1., 192.168.2., 127.

and NOT:

hosts allow 192.168.1, 192.168.2, 127

although to be honest I don't know if Samba would accept the latter.

>> What does your smb.conf look like?  And what happens when you try to
>> connect/print from the Windows machine?  What errors to you get?
>
>     Here is my current smb.conf file:
>
> <<>>
> # Samba config file created using SWAT
> # from 127.0.0.1 (127.0.0.1)
> # Date: 2009/10/03 00:37:16
>
> # Global parameters
> [global]
>        server string = Windows in Linux - VMware
>        interfaces = eth0, vmnet1, vmnet8

I see you are restricting Samba to the above interfaces.  Which
interface is your Windows machine plugged into?  Your hosts allow line
leads me to suspect you might have another ethernet interface in the
machine (unless the other 192.168.x.y network is allocated to VMware.)

>        guest account = barry
>        username map = /etc/samba/smbusers
>        log file = /var/log/samba/%m.log
>        max log size = 50
>        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
>        printcap name = /etc/printcap
>        preferred master = Yes
>        dns proxy = No
>        idmap uid = 16777216-33554431
>        idmap gid = 16777216-33554431
>        guest ok = Yes
>        hosts allow = 192.168.1. 192.168.2. 127.
>        cups options = raw

Are you using cups?  The "printcap name" above leads me to believe you
are not using cups.

> [homes]
>        comment = Home Directories
>        read only = No
>
> [printers]
>        comment = All Printers
>        path = /var/spool/samba
>        printable = Yes
>        browseable = No
>
> [HostFS]
>        comment = VMware host filesystem
>        path = /
>        read only = No
>
> [barry]
>        path = /home/barry
>        valid users = barry
>        read only = No

This should not really be necessary because of the [homes] section
above, but should not cause any trouble either.

> [HP9110]
>        comment = Hewlett-Packard OfficeJet 9110
>        path = /var/spool/samba
>        read only = No
>        printable = Yes
>        printer name = HP9110
>        oplocks = No
>        share modes = No

Your [printers] section should automatically set up a share for any
printers defined in your /etc/printcap file.  So this should also not
be necessary.

> <<>>
>
>     There are a LOT of comments in my original smb.conf file, but since I
> tried to modify a couple of things using SWAT, I see it removed the
> comments.

Yes, unfortunately SWAT does not preserve the comments, but they just
get in the way when you post your config to the list anyway.

>     Much of what is in this file is what I had, years ago, when I had
> Windows 98 which I could access through VMware, which was running on my
> Linux system.  (I want to do exactly what I did with that, be able to
> submit a print job or transfer a file either direction.)
>
>     After I removed the comments in my "hosts allow" line, I typed
> "service smb restart" in my root window:
[...]
>     On the Windows computer, I clicked Start and then Network.
>
>     I double-clicked OFFICE-WINDOWS.
>
>     I double-clicked "Add a Printer".
>
>     Then an "Add a printer" came up near the top of my explorer, after
> Organize and Views.
>
>     Clicking "Add a printer", I choose "Add a network, wireless or
> Bluetooth printer" in the dialog box that comes up. ("Add a local printer"
> is the only other choice here.)

Yes, Network printer is the correct option.

>     It says "Searching for available printers..."
>
>     After a delay, it says "No printers were found."
>
>     I click "The printer that I want isn't listed" and out of the three
> choices ("Browse for a printer", "Select a shared printer by name" and
> "Add a printer using a TCP/IP address or hostname"), I choose the second
> one, as the printer is connected to my Linux system with a parallel port,
> and it does not have an IP address.

Well, actually the IP address in this case would have been the IP
address of the Linux box.  If the printer was plugged directly into
the network then of course this would be the IP address of the printer
itself.  But the option you chose should work if the name resolution
(WINS) etc. are working properly.  You might try the third option to
see what it does.  I can't test that myself right now.

>     I click in the "text box" and type "\\barrycon\hp9110"

Try using HP9110 as the share name instead of hp9110.  Not sure if it
makes a difference.  Also try Bruno's suggestion of using the Linux
machine's IP address instead of the name.

>     The hostname is barrycon (and that is exactly what worked in the
> Windows 98/VMware I did years ago), and if I type "lpstat -v" the first
> line says "device for HP9110:".

What does the following give you:
rpm -qf /usr/bin/lpstat

or maybe:
rpm -qf /usr/sbin/lpstat

(I haven't run an rpm-based distribution in a while...)

>     Another dialog box says "Connecting to hp9110 on barrycon" and after
> a short delay it says "Windows cannot connect to the printer.  The server
> print spooler service is not running.  Please restart the spooler on the
> server or restart the server machine."

See if the Windows box can resolve the name of the Linux box:

C:\>nbtstat -a barrycon

It should show the IP address and then a "NetBIOS Remote Machine Name Table".

Also try:

C:\>nbtstat -A 192.168.x.y

(with the IP address of the Linux machine.)

Also see if this works from the Windows box:

C:>ping barrycon

>     Michael, in the extremely limited time I've given this, I don't
> appear to be communicating at all.  I thank you that you and others are
> trying to help me, so I believe I will just see if you or anyone else
> replies before I mess something up worse!  :-)
>
>     Thank you again!

Something else you might like to try is backing up your smb.conf file
and starting very simply based on this:

http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/FastStart.html#id2554870

See also the other examples on that page, but do not bother with the
domain member and domain server sections.  They are most likely much
more complicated than is necessary for what you want to know.

Of course that does assume you're using CUPS, so you might have to
modify it a bit if you're not using CUPS.

-- 
Michael Wood <esiotrot at gmail.com>


More information about the samba mailing list