36 replies on How to enable file sharing (Samba) and set the workgroup in Ubuntu Linux

  • Tom spune: 09/29/2010 at 11:42 pm Reply

    As a newbie, I was really hoping this was the “holy grail” I was looking for. I’m simply trying to get a new Ubuntu box (Lucid) to “act like” one of the Windows 7 machines on the same (wireless) network.

    All went well until:

    sudo service samba restart

    That simply returns, “samba: Unrecognized service”

    Then, I read somewhere else that the command is different for Lucid, so I did:

    sudo service smdb restart

    And that worked perfectly!

    However, still no joy – The machine is not visible to the Windows 7 computers, and it can’t “see” them, either, and I have no idea what to do next!?

    I’ve found dozens (hundreds?) of online posts about setting-up Samba on Ubuntu, and I’m discouraged in that no two are the same, bot one has been thorough, and not one has worked!?

  • Anonymous spune: 10/11/2010 at 5:16 am Reply

    it’s sudo service smbd restart

    not smdb

    • shaquir spune: 01/12/2011 at 2:10 pm Reply

      thank you .very much.the process is running now..so wt further i have to do?
      please kindly reply

  • Foosh spune: 01/30/2011 at 4:45 am Reply

    Alas, another careless, inaccurate, incomplete set of instructions that don’t work even after commenters correct what the author should have known before sitting down to write. Wish I had something constructive to say. Like Tom, I’m all too familiar with this outcome.

    • Ciprian Adrian Rusen spune: 01/30/2011 at 8:37 am Reply

      These instructions don’t work with the latest version of Ubuntu. The tutorial was made using an older version of this operating system. We are working as we speak on an update to the article which will be published in the next week or so. The new instruction set WILL WORK with Ubuntu 10.10.

  • Foosh spune: 01/30/2011 at 2:23 pm Reply

    Many thanks, and my apologies for my late-night snarkiness! Working on a Masters and taking it out on you when I ended up emailing myself .5G of files cos I couldn’t figure it out for myself as I usually do.

    • Ciprian Adrian Rusen spune: 02/01/2011 at 8:58 pm Reply

      The article is now updated to work with Ubuntu 10.10. Please test and confirm if it works for you too.

  • Foosh spune: 02/05/2011 at 3:57 pm Reply

    Thanks for the update and your help. It still does not work for me. My Windows 7 computer and the Ubuntu 10.04 LTS box are both displaying the correct workgroup name, but the Windows 7 machine is connecting via “Homegroup” and can not see Ubuntu. It sees the other Win7 machine, of course.

    Ironically I was separated from my Ubuntu for a few days, through no desire of my own. I suspect I can figure this out this weekend. I thought I should mention it.

    This is a fine site and your attention to updates and accuracy here is to be commended.

    • Ciprian Adrian Rusen spune: 02/05/2011 at 4:09 pm Reply

      You cannot see the Ubuntu computer in the Homegroup. You need to open Windows Explorer and go to Network. There you will see the Ubuntu computer.

      The Homegroup is made to work only with Windows 7 computers. To learn more about it and truly understand how it works, please read this tutorial The HomeGroup Feature & How it Works.

      • ByteTraveler spune: 02/05/2011 at 5:42 pm Reply

        While it’s true that’s the way it’s *supposed” to work, it often does not.

        Set-up identically, I have one Ubuntu box that never appears on the Windows 7 machines, and another box that intermittently “appears” and “disappears.”

        Again – The two Ubuntu boxes are (to the best of my ability) configured identically.

        It’s unclear (to me) if this is a real “bug” in Ubuntu, or just another unnecessarily obscure configuration “quirk” (usability bug), but it is real.

        Worth mentioning – All eight machines on this network are WiFi.

  • Hyperling spune: 05/16/2011 at 3:50 pm Reply

    This guide worked perfectly on my Ubuntu 11.04. Thanks a lot!

  • Greg spune: 06/28/2011 at 8:46 pm Reply

    This didn’t work for me. My W7 machine cannot “see” the ubuntu 11.04 box at all

    • Ciprian Adrian Rusen spune: 06/29/2011 at 2:54 pm Reply

      Double check that the Windows 7 computer has the same Workgroup setup as your Ubuntu one.

  • Matt spune: 08/03/2011 at 4:37 pm Reply

    I followed all the steps but still i have the windows workgroup with the other pcs and a separate one called “WORKGROUP” with the ubuntu pc.
    i can view the pcs from the windows group and can access the ubuntu pc from the windows, they are just in separete workgroups.
    Any advice? thank you in advance.

    • Ciprian Adrian Rusen spune: 08/03/2011 at 5:11 pm Reply

      Did I understand correctly that the Windows computers have the workgroup “workgroup”, in lower case while the Ubuntu computer has the workgroup “WORKGROUP”, written in upper-case?

      If my understanding is correct then you don’t need to worry. All is fine. It is not case sensitive.

  • fernando spune: 08/11/2011 at 8:52 am Reply

    if you are getting errors after clicking “Install Service”, try a “sudo apt-get update” before it.

  • Nonya spune: 11/18/2011 at 3:16 pm Reply


    I followed all directions on this tutorial and nothing worked, still could not see each other. So i tried again today not giving up and found the link above, you have to install Samba directly from software center. the directions given here for installing samba are apparently incorrect or outdated. However i would try the steps on this tutorial and the one above i have the link to. Both machines see each other and i can share folders. I just have to work out some things on windows 7 now to allow my Ubuntu machine to access files on it. I think its my firewall or i need to allow everyone to access the folders etc.

  • Mantolama spune: 04/14/2012 at 2:21 pm Reply

    Really very usefull. Thanks for sharing..

  • Bob Williams spune: 05/02/2012 at 2:02 pm Reply

    Very clear and concise instructions. A good job well-done.

    • Ciprian Adrian Rusen spune: 05/02/2012 at 4:32 pm Reply

      I’m glad you found it useful.

  • kostas spune: 05/05/2012 at 2:03 am Reply

    thank you it worked….my home PC(windows XP) and laptop (Ubuntu Linux) are now connected

  • Marty King spune: 05/16/2012 at 12:43 am Reply

    This half worked. My ubuntu 12.04 can see the windows computers but none of my windows computers can see the unbuntu 12.04. i followed ever step to the exact.

  • jonaldinho spune: 11/05/2012 at 10:50 am Reply


    This worked for me on latest ubuntu 12.10.

    i have asus eee pc 900ha notebook running ubuntu 12.10 and trying to access folders in my workgroup from my 2tb hard drive on my desktop which runs windows 7 home premium.
    now that samba app on ubuntu has my workgroup hopefully it will run smoothly.

  • ryan spune: 12/24/2012 at 1:58 am Reply

    “sudo gedit /etc/samba/smb.conf” came back with Cannot open display. I’m running xbmcbuntu and I’m a linux noob, be gentle.

  • ryan spune: 12/25/2012 at 4:36 pm Reply

    SO now both my win7 and ubuntu pc are both in the same workgroup. I still coudn’t see my ubuntu pc in network, so i went to my win7 run command and typed manually searched for ubuntu pc ip \192.168.*.* and now I can see my shared folders but It won’t let me access them. “Windows cannot access \192.168.*.*shared” any ideas?

  • Melanie Rimmer spune: 12/27/2012 at 4:15 pm Reply

    This is very helpful and easy to follow. It worked for me.

  • rafael spune: 12/28/2012 at 4:32 am Reply

    Excellent guide! It works just as described on 11.04. I had to update my Ubuntu from 9.04 to 11.04 because I kept getting errors when trying to enter my passwd to install sharing in Ubuntu 9.04.
    Many thanks =D

  • santoshbalram spune: 12/30/2012 at 6:59 pm Reply

    thx this was helpful..I was wondering if linux supports file system or sharing on windows 7 and this webpage was helpful thx to all..

  • hilton spune: 03/14/2013 at 12:36 pm Reply

    I have installed ubuntu and have everything working including backups however when I try and share the drives I get the message Package ‘samba’ is virtual after that package ‘libpa-smbpass’ is virtual. What do I do I am almost finish and want to use the drives

  • Roberto spune: 05/20/2013 at 8:14 am Reply

    I do not understand how the connection is handled. When I open a Network folder (with password protected access, I suppose) there is a field to specify the work-group name. Should this specification over-rule the default name?
    It doesn’t in my case. Many thanks

  • P. Stine spune: 06/05/2014 at 6:49 pm Reply

    Awesome! I’ve been wondering how to change the workgroup.

  • Nick spune: 04/11/2015 at 8:40 pm Reply

    Using Ubunut 14.04.
    Trying to get from Ubuntu into Win7
    Installed samba.
    Modified the smb.conf
    Ubuntu can see the Win7, but will not open shares.
    Keep asking username, pass.
    I tried all Win 7 usernames and passwords, I created the same user name as in Ubuntu, just in case, no luck.
    Any ideas?
    I try all users of the

  • Umesh Wakalekar spune: 06/19/2015 at 5:53 am Reply

    I am not able to share folders or drives outside home folder.. is there any tutorial to do the same ?

    • JPDJ spune: 06/24/2015 at 3:11 am Reply

      I was able to send from Win7 to Ubuntu 14.04, after the process to create a folder to share in Ubuntu, install samba and be sure those are in the same work group.
      I searched from Win by the IP of Ubuntu machine and Win got access to Ubuntu, then I was able to copy from Win to Ubuntu.

      Note: From “Share in Network” option by right click on the folder to share from Ubuntu I enable those options:
      “Allow to other users to create and delete files in this folder”
      “Guest access (for people without a user account)”

  • Finn spune: 10/27/2021 at 10:57 am Reply

    Do you know why it’s asking me for a password when the user tries to access the shared folder? I’ve tried both my and the users’ passwords but neither is accepted. Is there a way to find out what this password is?

  • BruceH spune: 12/30/2021 at 8:40 pm Reply

    After following this I can seemingly only share folders but none of the files within the folders. Or to that point, none of the sub folders within the shared folders. When I use X-Plore, it says “INVALID_PARAMETER” when I try to click on the shared folder.
    Normally shared folder with files in it appear to be shared.
    When I create a new folder to be shared, it will access the files within but no shared folders within that newly shared folder. For example, I create a folder called Share1 and include it the smb.conf file, it sees it and files within. When I try to add shortcuts within that folder, they are not seen.
    I don’t want to have to transfer gigabytes of files to that folder in order to view them.
    How do I make other folders or even an attached USB drive viewable and all its subfolders and files?

Leave a comment