How to share an external USB hard drive from Ubuntu to a Windows network

tux_windowsUpdate 25 July 2015:
I’ve just had to replace my media server and re-perform these instructions. Somewhat surprisingly they hold up under my current Ubuntu 14.02 LTS/Windows 8.1 setup. I’ve also made small changes to the text which now has you launching the Samba Configuration GUI from the command line instead of from the Gnome menus as the original version wasn’t all that much help if you weren’t running Gnome Classic.


I’m in the process of taking an old desktop and turning it into the house’s media server, taking most of the grunt work off of the computer I use to do my “real work” on. The media server is currently running Ubuntu 13.04 and it was sharing the small 80GB internal hard drive across my Windows network just fine. However, when I attached an external 3TB USB drive to the server, it was recognized, and I could right-click on it and tell it to share, but when I tried to access it from the Windows machine in the living room, it would not give me access. Many Google searches later I assembled the correct steps to get it to work. So, as a record for next time, and in hopes of helping someone else with some specific instructions, here they are:

  1. Connect and mount the drive to the Ubuntu computer. (The format of the drive, NTFS vs EXT4, doesn’t seem to matter for this to work so I ended up formatting it as NTFS for future portability.)
  2. Do not right-click on the drive and go into the sharing options via the drive’s properties. This will not work.
  3. Make sure you have Samba installed. (You can find it in the Ubuntu Software Center titled “SMB/CIFS file, print, and login server for Unix”)
  4. Install, if you haven’t already, install the Samba GUI. (Also in the Ubuntu Software Center titled “Samba” with a description of “Create, modify, and delete samba shares”.)
  5. Open a Terminal session and run the Samba GUI from the command line with # sudo system-config-samba
  6. File|Add Share
  7. Browse for the drive you wish to share and select it
  8. Change the share name if you’d like to. (For this example my share name is “Media01”)
  9. Check “Writeable” if you wish to be able to write to this drive from other computers on the network.
  10. Check “Visible” if you’d like others to see the share while browsing the network.
  11. On the Access tab, select “Allow access to everyone” (This will avoid the problems of having to specify usernames and passwords in programs like XMBC and MediaPortal.)
  12. Click OK (You should be done at this point but you’re not. This is what caused me the most headaches to find.)
  13. Back at the command line:
  14. # cd /etc/samba
  15. # sudo pico smb.conf (Feel free to use the editor of your choice. I like Pico.)
  16. Scroll to the bottom of the file. There you should find [Media01] (remember that’s the name of the share I created.)
  17. Add the following new line in that section: force user = username (In my case username is “msauers” since that’s the username I log in to Ubuntu with. Replace with your username.)
  18. Save the edited file.
  19. # sudo restart smbd (restarts Samba)

That should do it. You should now be able to access the shared drive from any Windows computer on your network.

May 21st, 2013 by