Vista & Samba: Browsing and Mapping Vista Shares in Suse/openSUSE

Summary: All that is needed to make Vista and Suse talk to each other using Samba, in the same manner as XP and Suse talk to each other, is to have the RPM for Samba version 3.0.25b-1.1.72 or later installed. There is no need to adjust the default NTLMv2 authentication that comes with Vista (i.e. "NTLMv2 responses only" in secpol is just fine). There is no need to adjust the default authentication that comes with Samba for NTLMv2 (i.e. "ntlmv2 auth = no" is just fine).

Introduction: Vista and Suse didn't work together without assistance until openSUSE 10.3. Earlier releases at time of typing don't have Samba versions capable of dealing with Vista. OpenSUSE dot org have made available RPMs for Suse openSUSE 10.x that contain Samba versions capable of dealing with Vista. These RPMs aren't in the standard media for release openSUSE 10.2 and earlier. This tutorial is really a few tweaks and recipes for openSUSE 10.2 distribution to enable Vista interoperability. It should work on 10.x; x>2 (and 10.0, 10.1 if smbfs is used instead of cifs). This is a SOHO/Workgroups scenario.

That's really the end of the short answer. But I notice some users are having trouble browsing Vista shares and mounting Vista shared drives in Suse clients. So I've written down the long answer below for those who need more information.

Prerequisite Software: You should have basic Samba packages installed. Check in Yast --> Software --> Software Management. Use the search facility on the LHS with "samba". Install kdebase3-samba, libsmb-client, samba-client, samba, samba-doc, yast2-samba-client, yast2-samba-server. If you want to map network drives then also search on "cifs" and install cifs-mount and pam-cifs.

Check Samba version: The shell command rpm -qa samba issued in a root terminal will tell you whether a Samba version upgrade is needed. Here's what I got in 10.2 before upgrading:

username@suseclient:~> su
Password:
suseclient:/home/username # rpm -qa samba
samba-3.0.23d-19.7
suseclient:/home/username #

That version 3.0.23d-etc comes in the 10.2 regular repositories and it's not recent enough to cope with Vista, which for me seems to need 3.0.25b-1.1.72 or later. You can add the URL for Samba RPMs to your Suse installation sources: goto Yast --> Software --> Installation Source and choose to Add --> Specify URL, where you copy this URL and paste it in: http://ftp.suse.com/pub/projects/samba/3.0/10.2/. For 10.x other than 10.2 adjust the URL accordingly & check the link I gave you.

Then use the openSUSE updater applet to install whatever is offered. The applet's located in the menu at Start --> System --> Desktop Applet --> openSUSE Updater Applet.

Check netBIOS over TCP/IP in Vista: Make sure this is switched on. GoTo Control Panel --> Network & sharing --> Manage network connections. R-click the adapter icon --> Properties --> Internet protocol version 4 --> Properties --> Advanced --> WINS --> Enable netBIOS over TCP/IP. Phew!.

See your Vista server. You should now be able to browse to the Vista server, using either the address network:/// in Nautilus or the address smb:// in Konqueror. I'm not talking about seeing the files and other resources. I just mean the server itself at this stage. If you can't even browse to the Vista server then check these two networking areas first:

Switch on Vista Sharing: Here's how to create the sharing environment on Vista: GoTo Start --> Control Panel --> Network & Sharing Centre --> File Sharing ON. That's all! Note however while you're there that you can have the "Password Protected" parameter either ON or OFF. You can choose either. If you choose "Password Protected = OFF", anyone on a Linux machine can read/write the Vista shares that you create. If you choose "Password Protected = ON", anyone on a Linux machine who knows the Vista {username,password} pair for the owner of a Vista share can read/write the share.

Create a Vista share: Now share a folder: R-click any folder --> Properties --> Sharing --> Select "Everyone". For "Allow" you can select one or all (recommend all) of "Full Control", "Change" and "Read". Reboot, that's all.

Browse a Vista share: Suppose for illustration that your Vista server has netBIOS name vistaserver with an IP address 192.168.22.16 and that your Vista share has netBIOS name vistashare. You can browse the share with Nautilus or Konqueror with addressing like so: smb://192.168.22.16/vistashare or smb://vistaserver/vistashare. Of course the easy way is to type nothing. Simply drill down by clicking in the File Browser onto the workgroup name. If you selected in Vista network environment to have no password protection then the world will have unchallenged access to the Vista share. If you selected "Password Protected = ON", simple supply the Vista owner's username and password when asked.

Map a Vista share as a Network Drive: You can have temporary mounts created with a shell command or permanent mounts created by an entry in the file system table located at /etc/fstab.

Temporary mounts: You must supply the {username,password} pair for the real user on the Vista machine. It's not necessary for that user to also be a user on the Suse machine. Here's a root terminal session that mounts the shared folder "vistashare" in the target directory "/path_to/destination" in a Suse client (note that line 3 is all-one-line):

username@suseclient:~> su

Password:

username@suseclient:~> # mount -t cifs -o username=vistauser,password=vistapassword //192.168.22.16/vistashare /path_to/destination

username@suseclient:~> #

The folder "destination" will automagically assume permissions read/write for all (rwxrwxrwx) when the command executes.

Permanent mounts: If you want the mapped drive to be always present then you don't use the on-the-fly command line approach detailed above. Instead you mount the drive at boot by adding a line to fstab, like this, all one line:

//192.168.22.16/vistashare /path_to/destination cifs username=vistauser,password=vistapassword,_netdev,uid=a_user_name,gid=users 0 0

When the Suse machine boots, the drive will map into the folder "destination" which will automagically transmute to ownership by the user defined in fstab and with read/write permissions for all (rwxrwxrwx).

Any Linux user on the Suse machine who chooses to view the file fstab can of course read the {username,password} credentials of the Vista user. If this is undesirable, you can put the credentials in a hidden file, e.g. ".creds". Change the permissions on ".creds" to be "readable only by owner" (rw-------). The entry in fstab then becomes:

//192.168.22.16/vistashare /path_to/destination cifs credentials=/path_to/.creds,_netdev,uid=a_user_name,gid=users 0 0

And the contents of ".creds" are like this:

username=vistauser
password=vistapassword

There it is, hope it helps.
Swerdna: 16 September 2007