One of the best ways to share folders and files on Ubuntu is to use the free open source software, Samba.
Once installed and setup, any Windows Computer will be able to easily connect and copy files to and from your Ubuntu system just like it was another Windows Computer.
With Samba, you are not limited to just file sharing. Printer sharing can also be setup allowing Windows computer to access and print to an installed printer on your Ubuntu computer.
To get started, first check to see if Samba is installed (by default Samba usually is installed during installation).
Open a Terminal window (Applications \ Accessories \ Terminal) and at the prompt enter the following command:
Example:
apt-cache search samba
If Samba is installed, you will see an output similar to the following:
samba - a LanManager-like file and printer server for Unix
samba-common - Samba common files used by both the server and the client
samba-dbg - Samba debugging symbols
samba-doc - Samba documentation
samba-doc-pdf - Samba documentation (PDF format)
smbclient - a LanManager-like simple client for Unix
smbfs - mount and umount commands for the smbfs (for kernels >= than 2.2.x)
If Samba is not installed, just enter the following command at the prompt in a Terminal window:
sudo apt-get install samba smbfs
You can also check to see if Samba is installed using Synaptic.
Now that Samba is installed, it's time to configure and make it accessible for Windows Computers, with the step by step procedure in the following video. Don't worry if you miss something, you can check out the steps listed below after the video.
NOTE: installation of Samba in video used Ubuntu 6.10 but still applies to later versions as well.
Steps to enable and configure Samba in Ubuntu:
Configure Samba
- Open System \ Administration \ Networking and enter password. In General tab, enter your hostname (this is your Computer name)
- Open System \ Administration \ Shared Folders then click on General Properties tab and enter a name for Domain\Workgroup.
- Open Applications \ Accessories \ Terminal and at prompt enter sudo gedit /etc/samba/smb.conf
- Uncomment the line browseable = yes (don't forget to use find and search for browseable)
- Uncomment the line writable = no and change "no" to yes
- Save the file and close
- Go back to the Terminal window and enter the following command (remember you can use any name you want): sudo smbpasswd -a username
- When prompted, enter a password and confirm it.
- Reload the Samba services using the following command: sudo /etc/init.d/samba reload
Sharing Folders (on Ubuntu)
- Open Places \ Home Folder
- Create a new folder, then right click on it and select Share Folder
- In Share Folder dialog box, set Share through: to Windows networks (SMB) and give folder a name. (if you want the share to have write access, uncheck Read only
- From your Windows Computer, see if you can connect to the folder share.
If you want to connect to shared printers from Ubuntu to Windows, check out our step by step guide on connecting to Windows shared printers from Ubuntu.
For more Ubuntu information, check out our Ubuntu tips and how-to.
Comments on Ubuntu Guide For Windows Users: Enable File Sharing In Ubuntu Using Samba
Mossback 4ever @ 2:40 pm
In which particular version is Samba installed by default?
The latest (as of 2/29/8) version of Ubuntu Desktop, after a "default to everything" "vanilla" install, not only does NOT install Samba, but also does not (with the CD never removed from the drive) provide any installation source for the "how I installed Samba on mine" directions.
The error in your reasoning is in assuming all Linux versions all work all the same. Apparently Linux is still not finding any kind of "standardized behaviour" in any distro. It's like switching to Vista every time a new version comes out. So sad. I want "Big Plaid" to go away too, but business reality won't let you guys in the back door with random lameness like this.
You at least need to provide a link to a "What If" — as in "What if it doesn't work that way on mine?" — at each appropriate point.
@Mossback 4ever
If you are that frustrated with Linux and Vista, there is always the Mac ; -)
charlie cheng @ 8:20 am
when you want share home directory, you need to modify [homes] section to make :
browseable=yes
writable=yes //uncomment and change value
valid users=%s //uncomment
Nathan @ 10:45 pm
It says to go to System => Administration => Shared Folders but I see no such option.
Ed @ 3:54 pm
@Nathan: System => Administration => Network, General tab
Also, ubuntu automatically installed nautilus-share when I installed samba. This utility lets you go to Places => Computer, browse to the folder containing the folder you want to share, right-click on the folder you want to share and choose Sharing Options from the menu that comes up. It was soooo much easier…
Amy @ 1:41 pm
In the following step this is not visible in my recent Ubuntu 8 install. There is no Shared Folders link under Administration.
- Open System \ Administration \ Shared Folders then click on General Properties tab and enter a name for Domain\Workgroup.
James O'Donnell @ 10:45 pm
So easy to use!
Spannerotoole @ 4:36 pm
@Watching The Net:
Why even bother with a mac, that's just another case of headaches to open right there. There's the overpriced tag, the fact that OS X won't load 24bit audio samples instead it elects to crash because of a poor implementation in CoreAudio drivers. It's quite strange that Darwin BSD will allow it, why did apple go and break something that worked???
Apples current war with flash, if apple say that flash is buggy why don't they come up with a compatible alternative for their systems. It seems that they just steal stuff from others anyway.
Apple can go and eat my pips.
Jason @ 9:52 am
In ubuntu 9.10, Karmic; try PLACES, Connect to Server, choose SMB for you're service type, then put in the IP address for the shared folder. This worked great for my WD MY World Book network drive.
Hope this helps.
Jason @ 9:53 am
Almost forgot, then choose Make Bookmark. You'll find the shared folder listed under Places.
Salik Mahmud @ 3:28 am
I have a Good News to Add, Whenever I install SAMBA Services in my Laptop [Dell Inspiron 1564 with Broadcom 413 Series Wifi Internal Card) to Share Files with my Desktop the Laptop looses Wireless Network after a restart. The Wireless Network Goes Disabled even though the Driver is Active for Wifi Card. Nothing helps in getting it back until I remove all SAMBA Services and restart my Laptop. Both My Laptop and Desktop are running on Ubuntu 10.04 amd64 Version. Ubuntu is Competing very Well in Bugs' Race with Microsoft.
Everyday I wakeup a New Bug Hits My Computer Right in The Bed. I Call Them A Good Morning Bug (Can be Friendly Nick Name to that 🙂
SagnaB @ 4:04 am
I have samba set up and working quite well, but I have several shared directories containing multiple directory trees, and for some reason the directories inside the shared one are not shared.
Is there a way do set them to shared automatically rather than having to go through and set share for each and every one?
Habib @ 8:26 am
Hello,
It didn't work for me, may be because I have installed Ubuntu in a virtual PC.
Some one can help?.
kince @ 8:33 am
i am using ubuntu 10.10…i can't find System \ Administration \ Shared Folders
what should i do pls help
Thnx in advance
Dileep R @ 6:18 am
Thank you very much for the info.
Really helped in sharing between ubuntu and windows.
dave @ 9:42 pm
fail. i installed samba and nothing works still. I installed samba4 and nothing worked still after that. I complete removed both, started back at samba, then samba4 again. It NEVER sees my windows shares. This is really sad.
steve @ 3:06 pm
the way you need to restart samba is now this way:
sudo service smbd restart
sudo service nmbd restart
Carlos @ 4:23 am
It's wonderful that you are getting ideas from this article as well as from oour dialogue made here.