Sharing folders between Windows and Linux

Updated: July 22, 2008

This is a task that bothers many Windows users turned Linux newbies. How to share data between these two completely different operating systems. The experience usually goes like this: accessing Windows share from Linux is a simple thing. But accessing Linux files from a Windows machines is a pain.

Well, I'm going to show something that would have been considered almost a blasphemy three years ago. I'm going to demonstrate how you can (easily) share folders between Windows and Linux - using Graphical User Interface (GUI) only!

Furthermore, I'm going to do this with the Linux distro running a firewall - which will have to be configured to allow the sharing. And again, to achieve that, I'm going to use GUI only! Lastly, the distro in question will be Wolvix, a Slackware-based beauty that amazes with its simplicity. No, you are not mistaken. It's not a typo. I will use a Slackware-based distro to do all this, with not a second spent on the command line!

If you are wondering what this last sentence is all about: Slackware is a distribution aimed at medium to well-experienced Linux users - definitely not new users! It is not a 'friendly' distro or one where you fiddle with GUI when you want things done. However, most pleasantly surprisingly, Wolvix brings about a delightful revolution that is almost too hard to grasp. You will see that in a few moments. Meanwhile, if you want to refresh your memory, you can try reading Installing Wolvix Linux - Full tutorial to learn more about Wolvix.

Some other useful articles are:

Installing Slackware Linux - Full tutorial

Highly useful Linux commands & configurations

Now, let's get to business.

Sharing service, part one

To share files and folders (called directories in Linux) with non-UNIX operating systems, you will have to run Samba (for more about Samba, please read the Wikipedia article). Luckily, Wolvix comes with Samba installed so it is only a matter of seconds before you can get the service running. First, let's take care of the firewall.

Firewall, part one

Like all Linux distributions, Wolvix uses the iptables to filter network traffic. The firewall is enabled by default and will block unsolicited incoming connections. The firewall can be easily controlled via the command line, but it can also be configured using a frontend. One of the more intuitive and friendly GUIs for iptables is Firestarter.

Now, we would like to be able to use Firestarter every time we boot the machine. To do that, we will have to add it to the list of Autostarted Applications. This can be done through the Xfce Settings Manager or via the Menu (the wolf paw icon), Settings, Autostarted Applications.

Just remember that Xfce desktop is extremely friendly. There is always more than one way of doing things; a right click on the desktop would also work - please refer to Wolvix tutorial for more details.

Wolvix Firestarter autostart

This will ensure our frontend is up and running all the time - although this is not necessary. You can simply fire it up any time you need to add a rule. We do not know how to use it yet, but we'll get there soon. Now, let's get back to sharing.

Sharing service, part two

Samba functionality in Wolvix is provided by GSAMBAD, a cleverly named application. Again, you can add it to the startup list to make sure it is always available.

You can find GSAMBAD under Menu > Network. If you want to add it to startup, its binary is located under /usr/sbin/gsambad. This means you will have to have root privileges to get this done.

If you're asking yourselves how to find the path to the server executable, reading my older articles can definitely help. In the meanwhile, here's how you do it: power up a command line window (terminal), switch to the root of the filesystem (cd /), perform system wide update of file and directory names to make searches faster (updatedb) and lastly look for gsambad (locate gsambad).

Wolvix GSAMBAD server

Now, we need to configure our sharing server.

Server settings

Here, we need to define which hosts (or networks) are allowed, a simple list of IP addresses. Furthermore, we also need to define the connections that our server will handle. Again, this is a list of IPs or network ranges, which can be defined using the Classless Inter-Domain Routing (CIDR) notation. See image above for more details.

Users

Sharing in Linux requires that a valid, existing user be specified for authentication whenever a remote request is sent. This can be any user, although, most likely, you will use your own. You simply need to add one or more users that are allowed to enjoy the Samba services. The options are rather self-explanatory.

Wolvix GSAMBAD users

Shares

Furthermore, we need to specify which directories can be shared with remote hosts. This is done via the Shares tab. Again, the image is self-explanatory. Simply add any which directory you wish to make available for sharing.

Wolvix GSAMBAD shares

This completes the Samba functionality. Now, let's configure the firewall to allow the relevant incoming connections.

Firewall, part two

Add rule

In the Firestarter menu, click on Policy > Add rule - or click on the Policy tab for a more detailed list of rules.

We're interested in the inbound traffic policy. Rules can be specified for hosts, IP addresses, network ranges, as well as specific ports. You can also use service names rather than specify their ports. This allows both a more tighter control policy - as well as allows you to avoid mistakes by misconfiguring port numbers or allowing only a subset of the necessary range of ports.

Firestarter add rule hosts

Firestarter add rule service

Go ahead and simply click away! Add the IP addresses and the relevant services that you wish to allow. Once finished, it's time to test the setup. 

Test setup

Here's our IP:

IP address

And here's the share, accessed from a Windows machine:

Shares via Windows

Conclusions

Wolvix is a whole load of fun. And it's simple. A few years back, Linux was the newbie nightmare. But here we are, today, enjoying the frills and thrills of GUI in one of the more challenging, more advanced Linux distros available.

Wolvix is just another example of a plethora of excellent, extremely friendly Linux distros that flood the computer market, making the transition, the change, the trial, the experience so much easier, so much more enjoyable. Best of all, you'll hardly ever need use the 'dreaded' command line. If the command line were your greatest excuse for not making the leap, then you're out of excuses!

Happy Linuxing!