bloody SAMBA!

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Postby Nigel » Mon Aug 01, 2005 12:07 am

Now there's interesting... After a reboot (to make sure everything was reset and the firewall was properly started), a thought occured, and I tried the following :

I opened Konquerer, and in the address bar I typed
smb://Vetinari
(Vetinari is one of the Windows XP boxes on the network)
and lo and behold I was browsing the shares from that machine. I tried another of the Windows machines and that also worked.
I still can't browse the entire workgroup, but at least it's a start...

So,bigjohn, to get to this stage :

1. Make sure that samba-client is installed via YAST (it's under Package Groups -> Productivity -> Networking -> Samba).
2. Also in YAST, go to Network Services -> Samba Client and make sure your Workgroup name is correctly set.
3. Make sure you are actually sharing something out from your Win98 machine. To share out your entire hard drive, open WIndows Explorer, right-click on C:, select Sharing and share it out with a sensible name in read/write mode (don't bother with a password unless you also connect the machine to another network where you don't want anyone to browse the C: drive)
4. On your Linux box, open Konquerer and in the address bar enter
smb://name_of_your_Win98_box

And this is WITHOUT LinNeighborhood installed.
Not quite the full "browse the windows network" solution you are looking for, but at least it's a step in the right direction.
Hope this helps,

Nigel.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

Postby bigjohn » Mon Aug 01, 2005 2:58 pm

well I couldn't even find LinNeighbourhood in YAST, I suppose it would have to be from the main site only.

If I try to look with konqueror, I can see the laptop and my pc if I just look at the work group, but if I then try to look at the laptop I get nothing - I'm wondering if theres something else that needs to be enabled somewhere.

Plus I still haven't manage to print anything from the inkjet (parallel ported to the linux machine only the laser on the main hub with it's own IP address). So perhaps theres something else that needs to be enabled or shared there as well!

I'm sure that there must be an easier way than this. I mean, I know that samba is a vvv clever piece of software, but surely there must be a basic way of setting it up, with options to do mega advanced stuff?

Or maybe I'm just too altruistic!

regards

John
"What the large print giveth, the small print taketh away". Tom Waits
User avatar
bigjohn
LXF regular
 
Posts: 393
Joined: Tue Apr 12, 2005 10:19 pm
Location: UK - South Coast

Postby Erin » Mon Aug 01, 2005 7:30 pm

If you have not created a share on the laptop, you want see one. No idea how to create shares in Win9x, Google will provide answers.

If you can browse to the printer on the *nix box with the Win box, you just need to set the printer up in Win as normal but as a network printer. How you do that, see previous Win comment.

Erin
Just beneath my skin I'm screaming. Faithless::Insomnia.
Dual PIII 550 with Ubuntu [semi-bleeding].
User avatar
Erin
LXF regular
 
Posts: 141
Joined: Thu Apr 07, 2005 7:35 pm
Location: The Olde Smoke south of the River

Postby Nigel » Mon Aug 01, 2005 9:44 pm

Hi John,

bigjohn wrote:well I couldn't even find LinNeighbourhood in YAST

Hmm, it's on DVD1 of SuSE 9.2, maybe they dropped it for 9.3. Anyhow, it seems to have been a red herring - you don't need it.

bigjohn wrote:If I try to look with konqueror, I can see the laptop and my pc if I just look at the work group, but if I then try to look at the laptop I get nothing - I'm wondering if theres something else that needs to be enabled somewhere.

If you look at the pc do you see your samba shares ?

Two things you need to have set up on the Win98 laptop (these are both necessary for Windows networking as well as Samba).
1) Right-click on Network Neighborhood and go to Properties. Look at the tab where you have the protocols (TCP/IP etc) defined and you should see an option for something like "File and Printer sharing" (sorry, it's been a while since I used Win98) , under which you have checkboxes for allowing others to see your files and use your printers. Make sure these are checked.
2) You need to actually share something out, as described above, by right-clicking on a drive or directory and selecting the Sharing option. Allow others to use the drive/directory in read+write mode (again, it's been a while since I did this on Win98 so I don't remember the exact sequence).

bigjohn wrote:Plus I still haven't manage to print anything from the inkjet (parallel ported to the linux machine only the laser on the main hub with it's own IP address). So perhaps theres something else that needs to be enabled or shared there as well!

This will be the next step. I'll write something about this from work tomorrow if I get a chance, as I've got printers shared out from my Linux boxes there via Samba.
In preparation, can you confirm that you have the inkjet printer set up so you can print to it from Linux (graphics as well as text) ?
What model printer is it ?
Do you have the Win98 drivers for that printer to hand ?

bigjohn wrote:I'm sure that there must be an easier way than this. I mean, I know that samba is a vvv clever piece of software, but surely there must be a basic way of setting it up, with options to do mega advanced stuff?

Trouble is, networking like this isn't easy. Even between Windows boxes. OK, so if you have a couple of XP machines it isn't too bad, but try getting a mixed network of 95, 98, NT, 2000 and XP machines all talking to each other - it's caused me major frustrations in the past. Especially NT.
In fact, one of the reasons we run a Linux/Samba machine at work is that it seems to make connections between Windows machines more reliable and more stable.
Samba does the very difficult job of integrating the "trample all over my machine" networking of Win9x with the slightly better security of WinNT/2000/XP and the proper security of Unix.

bigjohn wrote:Or maybe I'm just too altruistic!

Just not as cynical as the rest of us (yet) :wink:

Hang in there - we'll get you up & running eventually :)

All the best,

Nigel.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

Postby bigjohn » Tue Aug 02, 2005 1:27 am

I "think" that I've got it. I went back through all the stages one by one, I'm sure I didn't miss anything but obviously I did, because as a test (and I own a windows licence anyway) as soon as I found that I'd managed to "make" the share I went straight for them. I'll find out if I've got "it" right in the morning - I'm knackered and my eyeballs feel like they've been sanded down by a "60 grit" glass paper!

I'll post back tomorrow with "proper" results.

regards

John
"What the large print giveth, the small print taketh away". Tom Waits
User avatar
bigjohn
LXF regular
 
Posts: 393
Joined: Tue Apr 12, 2005 10:19 pm
Location: UK - South Coast

Postby Nigel » Tue Aug 02, 2005 11:39 am

OK, printers...

First thing to check - you MUST have your printer set up in Linux and be able to print to it from typical Linux applications (print a page from your web browser to test this). If you can't do that, stop here and get that sorted first.

Samba seems to automatically pick up any printer that is properly defined in Linux (well, in SuSE 8.2 & 9.2 anyway) and add it to the list of available printers.

I have two Linux boxes here which each have a printer attached to their parallel port which I print to from the Windows machines. One is a mono laserjet, the other is a colour OfficeJet. They are set up in two different ways because they were done at different times and I learned more about doing this in the meantime. I'll present both here and you can decide which you want to use.

Firstly, the laser printer. In many ways this is the simple one. Looking at the smb.conf file, the relevant section reads :
Code: Select all
[printers]
   comment = All Printers
   path = /var/tmp
   admin users = nigel
   create mask = 0600
   printable = Yes
   browseable = No

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/drivers
   write list = @ntadmin root
   force group = ntadmin
   create mask = 0664
   directory mask = 0775

[lp]
   comment = Hewlett-Packard HP LaserJet 6P
   path = /var/tmp
   admin users = nigel
   printer admin = nigel
   read only = No
   create mask = 0600
   printable = Yes
   printer name = lp
   use client driver = Yes
   oplocks = No


This is pretty much the default settings - I think the only things I altered (via the Printers section of SWAT) was the comment on the "lp" section and the list of admin users in both the printers section and the lp section (so I can cancel print jobs from my Windows machine).
lp, by the way, is the printer queue name in Linux for this printer.
Note that if you use SWAT, it will show you the default settings for many things, but most default settings don't need to be written to smb.conf. So anything not listed here can safely be left at it's default setting.

Now, this needs a little jiggery-pokery on the WIndows front. Basically, this defaults to using cups on the Linux box as it's print engine, and cups expects to be fed Postscript.
So, in Windows you have to set the printer up as a Postscript device (even though it isn't).
Bearing in mind that I don't have a Win98 box in front of me, so these instructions won't be word-perfect, what you need to do is this :

Go into the Printer management window (from Control Panel ?) and select Add a Printer. Tell Windows it is a network printer. You should be given the opportunity to browse the network to find the printer (in my case I look for my samba server and find "lp" as one of the shares).
Now you need to tell Windows what sort of printer it is - you need to select a suitable Postscript printer here. My Laserjet does have a Postscript driver available (HP LaserJet 6P/6MP Postscript) so I select that. In your case, for a colour inkjet (ANY A4 colour inkjet driven by cups) I would recommend the HP Color LaserJet PS driver (that's the XP name - it might be something like HP Color LaserJet 5M PostScript in Win98 - either way, look for a Color LaserJet with either PS or Postscript in the name). This is in the standard set of drivers provided by MS in most versions of Windows, including Win98.
Send a test page, and sit back and wait...

Now on another Linux box I have an HP OfficeJet 1150C. This produces multiple print devices under Linux, each with specific settings for colour or grayscale and draft, normal or high-res output. To be honest I only ever use the "normal" setting, so this is all I have played about with in Samba.

The relevant section of smb.conf looks like this :

Code: Select all
[printers]
   comment = All Printers
   path = /var/tmp
   printable = Yes
   browseable = No

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/drivers
   write list = @ntadmin root
   force group = ntadmin
   create mask = 0664
   directory mask = 0775

[normal]
   comment = HEWLETT-PACKARD OFFICEJET PRO 1150C
   path = /var/tmp
   printer admin = nigel
   read only = No
   printable = Yes
   printing = bsd
   print command = lpr -oRAW -r -P%p %s
   printer name = normal
   use client driver = Yes
   oplocks = No


Spotted the difference yet ?
The crucial lines are
Code: Select all
   printing = bsd
   print command = lpr -oRAW -r -P%p %s

This means that I am bypassing cups when printing and using the low-level print command instead. So I have to supply Samba with a Linux print command to use, which breaks down as follows...
lpr is the command line print command.
-oRAW says use the RAW option - in other words just send the data to the printer as you receive it without attempting to do any processing at all (because Windows will produce the correct code for the printer).
-P%p - the %p gets replaced with the printer name by Samba, the -P parameter to lpr tells the lpr command which printer to use
%s gets replaced by Samba by the name of the file it receives for printing (yes, the printer output from Windows gets put into a temporary file on the Linux machine and printed from there).
-r says delete the (temporary) file after you have printed it - remember, this is the copy on Linux, not anything on your Windows machine.

Now, to set this printer up in Windows the procedure is the same right up until I choose the printer driver. Instead of a Postscript driver, I now need to use the correct Windows driver for this printer (the OfficeJet 1150C driver in this case).

So, which method should you use ?

That will depend on your printer and the use you are going to make of it. If the Windows driver provides lots of printing options you want to use (like for different print qualities & different media types), then use the second method.
If you just want to bang out documents with the least possible hassle, and you can put up with your fancy inkjet being referred to as a Color Laserjet by Windows, go for the first method.

Give it a go, and let me know what problems you encounter - I'm sure we can sort them out, and maybe even explain how and why :wink:
Hope this helps,

Nigel.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

Postby bigjohn » Tue Aug 02, 2005 11:56 pm

Once I re-read your instructions, I went back through the steps that you suggested I try.

I got everything I needed working i.e. the shared access to the laptops C: drive etc.

The only thing that really foxed me was why the inkjet printer still didn't want to work.

So I took the "newbie way out", and deleted all the printer references/links etc from the laptop, except the one for the laser printer. Then I did the "add printer" wizard, and when it went to the select printer section I just banged the HP disc in for it and bingo, it works.

I now even have all my fonts changed to my fav', Tahoma!

It all works, so now all I have to do is try to get my head round the samba guide, but I'm gonna use my smb.conf as a reference, to try and understand why I have to use the options that I do. Obviously while it's probably OK, I do like to think of the security aspects, especially as Clares laptop is running W98SE - maybe if it was XP I wouldn't worry so much because when I still had XP in my main machine, I'd got her trained up to only use the user accounts.

Like I said Nigel, if you're down on the south coast anytime (West Sussex area) give me a shout, and if I'm not working, I'll see about getting some beer down your neck!

I wouldn't have had a hope in hell of sorting all that lot out on my own!

regards

John

p.s. when/if I ever understand samba better I think I might have a go at making a check list type doc for publication - whether it ever sees the light of day is a different matter.

Again, many, many thanks.
"What the large print giveth, the small print taketh away". Tom Waits
User avatar
bigjohn
LXF regular
 
Posts: 393
Joined: Tue Apr 12, 2005 10:19 pm
Location: UK - South Coast

Postby Nigel » Wed Aug 03, 2005 9:19 am

You're welcome :)

It's been a useful exercise for me, too - I don't set up Samba very often, and I usually either "borrow" a working smb.conf from another machine or spend ages trying to remember how to do it from scratch - now I can just refer to my notes here (until they change the forum software again :evil: )

All the best,


Nigel.
User avatar
Nigel
LXF regular
 
Posts: 1141
Joined: Fri Apr 08, 2005 8:03 pm
Location: Gloucestershire, UK

Previous

Return to Help!

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests