Setup Samba/Windows Shares on XBMC Live

It’s relatively easy to setup samba shares on XBMC Live, but it does require bashing out some commands on the shell. First, you’ll need to install samba using apt-get:

sudo apt-get update sudo apt-get install samba

Then, you’ll want to configure your shares by editing the the file named smb.conf, placed in the /etc/samba/ directory. For example, I added the user folder and media folders to be available shares by running the following command:

sudo nano /etc/samba/smb.conf

Scroll down all the way to the bottom of the file, then paste in the following (use right click in Putty to paste something from your clipboard):

[xbmc]  path = /home/xbmc  public = yes  guest only = yes  writable = yes  browseable = yes  force user = xbmc  inherit permissions = yes  [media]  path = /media  public = yes  guest only = yes  writable = yes  browseable = yes  force user = xbmc  inherit permissions = yes

After that, restart the samba server using:

sudo /etc/init.d/samba restart

Update: It looks like this has changed in the more recent versions of Ubuntu that the XBMC Live distribution is packaged with (10.04). You can restart the samba service using the old method:

sudo service smbd restart sudo service nmbd restart

Note: I updated the samba configuration above to include the ‘force user’ and ‘inherit permissions’ features as I was having trouble with newly created files not getting the right permissions and logging into samba.

Also, when accessing the shares from Windows, if you left the default security options you can use the account ‘guest’ with no password to access the shares. Otherwise, you can play with the settings to force a local linux account to be used in order to access the shares.


Posted

in

by

Comments

13 responses to “Setup Samba/Windows Shares on XBMC Live”

  1. greg Avatar
    greg

    man this site is full of great stuff. this just might mean i dont have to buy a NAS (as uPNP on XBMC Live is hell)

  2. xbmc Avatar

    XBMC live is a bitch from hell

  3. john mish Avatar

    I think this article done a great job.What a best way to describe your view. Thanks for sharing with us. Really like your informative article. Hopefully we will get more interesting topic from you in future.This is an awesome list and I have used many of these ideas in marketing my home based business and got results.

  4. barry Avatar
    barry

    Thank you, works excellent. Now I can finally browse the folders of Asrock ION3D XMBC from my Macbook.

  5. Mike Avatar
    Mike

    Thank you very much for providing this information. You rock! 😉

  6. Markosjal Avatar

    Yes this works however the problem with this is that it shows on Windows client with the free space as only the free space available on the OS drive.

    Since I am running XBMClive from a 4 gig memory stick with 2 gig available, when I plug in a 800 gig external disk , it still shows only 2 gig available.

    Therefore this is not a solution for a pendrive install of XBMC live, which is what I was hoping for. I would never be able to copy a DVD file to it.

    I have the same behaviour with my Airlink 101 ANAS350. It as well only shows available space on primary disk, ands once full does not allow me to copy to connected USB disks.

  7. typo guy Avatar
    typo guy

    sudo service smbd restart
    sudo service nmbd restart

    whats nmbd?

  8. Gadget Avatar
    Gadget

    Ok, stupid question maybe, but being new to Linux, i am most likely doing something wrong….

    The problem I have is that I logged into putty using root etc but when I type the “sudo apt-get install samba” command it seems that it does want to install samba, but throws out errors and says that it wasn’t successful. The only thing i could think of looking at the script is that my gateway/router is maybe blocking the request….. Or could there be something wrong with my install of the OS??? Below is the Description:

    login as: root
    [email protected]‘s password:
    Linux XBMCLive 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux
    Ubuntu 10.04.2 LTS – XBMCLive Dharma

    Welcome to Ubuntu!
    * Documentation: https://help.ubuntu.com/
    Last login: Sun Aug 21 17:13:19 2011 from gaming-1.mem-tech.co.za
    root@XBMCLive:~# sudo apt-get install samba
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following extra packages will be installed:
    libfile-copy-recursive-perl samba-common samba-common-bin update-inetd
    Suggested packages:
    openbsd-inetd inet-superserver smbldap-tools ldb-tools ufw
    The following NEW packages will be installed:
    libfile-copy-recursive-perl samba samba-common samba-common-bin update-inetd
    0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
    Need to get 11.5MB of archives.
    After this operation, 31.6MB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    WARNING: The following packages cannot be authenticated!
    libfile-copy-recursive-perl samba-common samba-common-bin update-inetd samba
    Install these packages without verification [y/N]? y
    Err http://archive.ubuntu.com/ubuntu/ lucid/main libfile-copy-recursive-perl 0.38-1
    400 Bad Request [IP: 91.189.88.31 80]
    Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main update-inetd 4.35ubuntu0.1
    400 Bad Request [IP: 91.189.88.31 80]
    Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main samba-common 2:3.4.7~dfsg-1ubuntu3.4
    400 Bad Request [IP: 91.189.88.31 80]
    Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main samba-common-bin 2:3.4.7~dfsg-1ubuntu3.4
    400 Bad Request [IP: 91.189.88.31 80]
    Err http://archive.ubuntu.com/ubuntu/ lucid-updates/main samba 2:3.4.7~dfsg-1ubuntu3.4
    400 Bad Request [IP: 91.189.88.31 80]
    Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libf/libfile-copy-recursive-perl/libfile-copy-recursive-perl_0.38-1_all.deb 400 Bad Request [IP: 91.189.88.31 80]
    Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/samba/samba-common_3.4.7~dfsg-1ubuntu3.4_all.deb 400 Bad Request [IP: 91.189.88.31 80]
    Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/samba/samba-common-bin_3.4.7~dfsg-1ubuntu3.4_i386.deb 400 Bad Request [IP: 91.189.88.31 80]
    Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/u/update-inetd/update-inetd_4.35ubuntu0.1_all.deb 400 Bad Request [IP: 91.189.88.31 80]
    Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/samba/samba_3.4.7~dfsg-1ubuntu3.4_i386.deb 400 Bad Request [IP: 91.189.88.31 80]
    E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?
    root@XBMCLive:~#

    Any help would be appreciated

  9. josh Avatar
    josh

    @Mr Gadget-
    I should have put it in the article, but did you run a [code]sudo apt-get update[/code] before running the install command? Try running the [code]apt-get update[/code] then try to run through the rest of the commands in the article.

    Alternatively, you may want to look at the other command they recommended which is to run: [code]sudo apt-get update –fix-missing[/code]

  10. josh Avatar
    josh

    @typo guy-
    The reference to nmbd is not a typo – it’s one of the services that should be restarted after changing the samba configuration. (It’s one of the samba daemons)

  11. Gadget Avatar
    Gadget

    @ Joshua

    Thank you very much for the quick reply, I did originally try the “sudo apt-get update” but all I keep getting is the errors saying “Failed to fetch bad request: ip etc” so i think it might be the proxy/router blocking putty from my windows box. Anyway, im order to get that sorted out I will have to get a friend of mine over here tosee where the problem is with that because that’s waaaaaay above my pay grade, LoL!!!

    Thank you again for the reply and apologies for the stupid questions.

  12. Gadget Avatar
    Gadget

    Thank you josh, i decided to connect the XBMC directly to the switch, power down the server and the router (Just in case) and then removed the settings from the xbmc box to get the ip automatically, which then worked as far as the “sudo apt-get update” and “samba ” was concerned. It then installed all the missing updates/packages and installed samba which is now working, so that is working very well thank you.

    The only problem i have now, is that now when i try access the “XBMCLIVE” in windows, it allows me to see the two folders that have now been shared, but it reports “Access Denied” when i select the folders to browse the contents. Is there something that i could have done wrong, or is it just Win7 being anal about the security (I did actually even add the XBMCLIVE to the “Store Credentials For automatic Logon” and tried bot the admin as well as the root option, but still no luck getting access to the two folders shared!!!

    Thanking you again for the help and apologize for the “Maybe” stupid questions.

  13. Pravin Avatar

    Thanks for sharing…..
    Below link is easy to understand,
    http://www.redhatlinux.info/2011/11/configure-samba-server.html

Leave a Reply

Your email address will not be published. Required fields are marked *