Ubuntu Karmic Koala Windows File Sharing

So, when you install Karmic Koala [9.10], you still don’t get Windows File sharing [SAMBA], and setting it up is still a few undocumented and obscure steps. I covered this before for Gutsy, but things are a little different with Karmic, so I’ve redone the screen shots and directions.

If you could Google for “Ubuntu Samba Install” and get a page that told you what you wanted to know, then I wouldn’t do this post, but you don’t get a good page. This page is not that helpful. It looks it was written in the dark ages and it does not configure WINS so that you can PING the other systems on your network.

So here’s the real scoop, which is a modified version of this post I did for Gutsy.

First you need to install WINBIND. So use the package manager at SYSTEM > Administration > Synaptic Package Manager. Search for WINBIND and mark for install. This picture shows what you need to have – or at least what I have installed. I think if you search successively for WINBIND, SAMBA, SMBCLIENT and SMB you will find these. Many of the things in this picture are probably dependencies that will be pulled in automatically.

Now you need to edit the /etc/nsswitch.conf file to change the order to allow wins to work.

This change allows winbind to find the other computers on the network. This allows PING to work, which allows you to diagnose issues, and allows SAMBA to find other systems on the network using the wins protocol. You don’t need to restart anything or reboot after you edit this file. When this is working, you should get the following when you use System > Administration > Network Tools > Ping:

Ok, the next step is to configure SAMBA by editing the /etc/samba/smb.conf file. The system that I upgraded worked fine after the upgrade from Gutsy to Karmic because this file was preserved, and because the upgrades [ 4 of them] all preserved the packages already installed. But if you are installing a new system, then you will need to change the smb.conf file since it does not work out of the box, as far as I can tell. Here’s a terminal session that shows what to do to edit the file. I’m not going to describe the whole Sudo thing, you can find that elsewhere.

Notice that Samba needs a restart after any changes to smb.conf. I’m not going to go through all the details like I did last time, you can refer to the previous post.  Here’s a copy of the file that I’m using now.

smb_conf

There is one more thing to do. Since we are using security = user with samba, we must set a samba password for every account that we are going to use with samba. I believe this results from the fact that windows users md4 for password hashing, and passes this hash across the network to authenticate users. Since linux [unix] uses a stronger password hash, you must save the MD4 hash of the password in a samba database to allow authentication for samba. Here’s the process from the other post:

darrell@squall-ubuntu:/etc/samba$ sudo smbpasswd -a darrell
[sudo] password for darrell:
New SMB password:
Retype new SMB password:
darrell@squall-ubuntu:/etc/samba$

Ignore the following material, it is fixed by the above smbpasswd fix.

There are still problems that I cannot solve:

With this configuration I get two way file sharing with Vista x86 x64 and Win xp on the system that was upgraded. But when I installed a new system, and followed these steps, including using exactly this smb.conf file, the newly installed system would not allow Vista x86 or x64 clients to access Ubuntu. Win XP as the client worked just fine. Ubuntu as the client worked for Vista x86, x64 and Win XP. Read only. I only allow read-only file shares on my network to avoid the spread of worms should I get them.


Looking into a Vista x64 machine
Looking into a Vista x64 Machine

Here’s an example of an error when trying to connect to Ubuntu from Vista.

This is the network as seen from a Vista x86 machine. You can see that both Ubuntu machines, Squall-Ubuntu and Blue-Diamond are visible.

Network as Seen from Vista x86
Network as Seen from Vista x86

You can connect to Squall-Ubuntu, but not to Blue-Diamond.

It doesn’t matter whether you put in darrell, or blue-diamonddarrell, you get the same error. But if you connect to squall-ubuntu, which is the upgraded machine, then it works just fine. I have no clue what the differences are between the configurations. Recall that I’m using the same smb.conf file on both machines and that both have the same nsswitch.conf file.

No clue what’s wrong.

But the Ubuntu machines can see all the Windows machines so I can pull files from them if I like. I pulled the pictures from those machines and did this post from Squall-Ubuntu.

So Karmic can play nice with windows, almost. But it’s still not that way out of the box.

– windy