SMB: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Mediaguru
mNo edit summary
m (type-o)
(46 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{XBMC faq toc Inline}}
{{mininav| [[File sharing]] }}
__NOEDITSECTION__
{|class="infobox" style="width:210px"
|-
|
Return to:
* '''[[HOW-TO:Create_Music_Library|Music Library Guide]]'''
* '''[[HOW-TO:Create_Video_Library|Video Library Guide]]'''
|}
__TOC__
__TOC__
==Introduction==
:'''Windows File Sharing''', (also known as Common Internet File System [CIFS] and previously known as Server Message Block [SMB]), is probably the most flexible of all of the options for sharing media between your computer or a [[NAS|NAS (Network Attached Storage)]] device and XBMC.


* On Mac OS X it's called [[Macintosh File Sharing using SMB (Windows File Sharing)|Windows Sharing]].
= Introduction =
* On [[samba|Linux/UNIX/BSD]] its counterpart is [http://www.samba.org SAMBA].
<section begin="intro"/>Windows File Sharing, aka Server Message Block (SMB), is the standard client-server protocol used by Windows to share resources over a network. SMB is available on all Windows computers and can be easily setup by the home user. SMB can also be accessed by other operating systems, which makes SMB the most commonly used network protocol to access content on a NAS or other remote hardware.<section end="intro"/>


:SMB/SAMBA/CIFS sharing has many advantages over the other options, mainly:
'''Note:''' SMB v1 is not supported in {{kodi}}. SMB v2 or higher must be used.
* It is already incorporated in Windows, eliminating the need for additional software and services to be installed on your PC
* It allows for authentication by Windows username and password, making it good for use on public networks
* Once properly configured, it will allow your network shares to be seen and accessed by not only XBMC, but also any Windows machine on your network.<br /><br />


==Windows Filesharing (on Windows)==
This page will detail how to add a network source to {{kodi}} using SMB. It assumes you have already correctly set up your SMB network. If you have not set up your SMB network, a Google search will return numerous online guides. The following links may help also.
:'''Windows 7 (x64) users''' : You must uninstall Windows Live Sign-in Assistant for sharing to work. Reasons are unclear as why you need to do that.
<big>Configuring Windows File Sharing With Open Access (Simple File Sharing)</big>
:Right click the Drive or Folder you wish to share. Choose “Sharing and Security” from the drop down menu. If you are sharing the root of a drive, Windows will warn you about sharing a whole drive. Click '''“I understand the risk...”''' If you aren't sharing the whole drive, the warning will not appear.  


:There may be a link saying '''“If you understand the security risks...”''' in the lower portion of the window. Click it to get the sharing options.
* Android : [https://www.howtogeek.com/191378/how-to-access-shared-windows-folders-on-android-ipad-and-iphone/ How-To Geek]
* Linux : [http://www.samba.org SAMBA].
* Mac : [https://support.apple.com/en-au/guide/mac-help/mh17131/10.15 macOS User Guide site]
* Windows : Multiple guides available via Google.


:If the option to set the folder to shared is greyed out, and the option to make this folder private is checked, you need to uncheck it. If it's greyed out too you need to find which parent folder it's checked on. If the folder you want to share is on your desktop, it's probably '''/Documents and Settings/(Your username)''' that's been made private. It's normally on the same drive as your Windows installation.


:The first time you set up sharing, Windows will ask you if you want to use a wizard. The wizard will enable the Windows firewall to prevent internet users from accessing your files. If you have SP2 it's probably enabled already. ''Note:The Windows firewall can stop filesharing from working.'' After you have chosen whether or not to run the wizard you must choose a name for your share. This is the name that will be visible on the network.


:If you want other computers to be only be able to read your files ''uncheck'' '''“Allow network users to change my files.”'''
= Method =
SMB (remote or network) server locations can be accessed with either of the following methods:


:Alternatively you can create '''hidden shares'''. Hidden shares are created when you add the $ to the end of the share name. (ie. '''share''' becomes '''share$''') A hidden share will not show up in the list. You must already know the name of the share to access it. (in windows: "\\COMPUTER_NAME\share$") Details on accessing hidden shares below.
; IP address
: If using the IP Address method, ensure you reserve a DHCP address (static IP) for your NAS or other hardware. This ensures that your router will always allocate the same IP address to the server. If you choose not to do this, then you may find that the router has allocated a different address to your NAS and {{kodi}} will no longer be able to access the media files.


:Click OK. That's it, you should be done. If you have a lot of files and folders inside the folder you shared, you might get a progress box while windows changes the permissions of the files inside that folder.
: To reserve a static IP address, log into your router and add the MAC address of the hardware to the Reservation list in your Router. If you do not know the MAC address, you should see it in the list of connected clients.


:Make sure your xbox is on the same network(ie connected to the same router) or hooked up to your computer with a crossover cable(xbox link cable will do). If you have any trouble, double check that all software firewalls are off, including the Windows Firewall. If you still have problems often times restarting your computer can fix it. Always try restarting, even a router/switch or your xbox. Enjoy. TaeBoX
; Device Name
: If using Windows PC's you can use the Device Name of the PC.


<big>Configuring Windows File Sharing With Secured Access</big>
: The Device Name can be found in ''Settings > System > About'' on your Windows PC.
:'''Note:''' ''This setup can only be accomplished in Windows XP Professional (XP Home doesn't work).''




:The first step is to create a user on your computer called '''xbox.''' This can be done by navigating to ''Start->Control Panel->User Accounts'', select ''Create a new account'' and give it the following settings:


:''Name:'' '''xbox'''
= Adding Remote Sources =
:''Password:'' '''xbox'''
The images will guide you through the process of adding an SMB Source to {{kodi}}.
:''Account Type:'' '''Limited Access''' (not an administrator)


:This account will be used for file sharing purposes only. If you want to hide this user from the Welcome Screen, see this [http://www.tweakxp.com/article36754.aspx link].
Depending on which method you have chosen to use, choose either Step 4 or Step 5, not both


:Now we need to pick a few folders to share. On my computer I have two shared folders... One is '''C:\SHARED\''' and the second is '''C:\Music\'''. Inside my SHARED folder I have 3 subfolders called ''Music, Pictures,'' and ''TV Shows''. I recommend using a directory right on the C:\ drive to make things simple (unless its something you don't want others to find).
'''Note''': SMB v2 and later does not support Browse. You must type the folder name in steps 4.2 or 5.2 below.


:The next step is to set up sharing privledges for these folders. To do this, right-click the folder you want to share (ie C:\SHARED\) and chose ''Sharing and Securit''y.... Next click on the ''Permissions'' button. If you do not see a Permissions button, then you need to disable Simple File Sharing (see the next step).


<big>To Disable Simple File Sharing</big>
<gallery mode="packed" widths="500px" heights="283px">
:In any explorer window, click on Tools->Folder Options.... Select the View tab and in the Advanced Settings pane scroll to the bottom of the list and uncheck '''Use Simple File Sharing (Recommended)'''.
File:Add-Network-Location.png |Image 1- Select '''Add network location...''' from the '''Browse for new shares''' list.
File:Add-Network-Location_2.png|Image 2- Select '''Windows network (SMB)''' for '''Protocol'''.<br>Then select '''Server Name'''.
File:Add-Network-Location_3.png|Image 3- Type in either the '''IP Address''' or the '''Device name''' of your server.
File:Add-Network-Location_4.png|Image 4- Using '''IP Address'''<br> '''4.1''' Browse is not supported. <br> '''4.2''' In the '''Shared folder''' section, type in the name of the folder to add.<br> Add the drive letter ''eg f/Movies''.<br>'''4.3''' If your share requires a '''Username''' and '''Password''' enter them in the appropriate sections.<br>'''4.4''' Select '''OK'''
File:Add-Network-Location_5.jpg|Image 5- Using '''Device Name'''<br>'''5.1''' Browse is not supported. <br> '''5.2''' In the '''Shared folder''' section, type in the name of the folder to add <br>The drive letter is not required.<br>'''5.3''' If your share requires a '''Username''' and '''Password''' enter them in the appropriate sections.<br>'''5.4''' Select '''OK'''
File:Add-Network-Location_6.jpg|Image 6- Your share should appear in the '''Browse for new share''' list. <br>The share will show either the IP Address or Device Name depending on which method you used.
</gallery>


:Now select “Share this folder” and give it a name. You should probably just call it whatever the folders name is (ie I called mine SHARED). Just avoid calling it PORN or ILLEGAL STUFF because anyone browsing your network will see the folder names (they just won't be able to see anything inside of them). The user limit should be set to '''Maximum Allowed.'''


:Next, click on the '''Permissions''' button and click '''Add'''.... Now click '''Advanced...''' and hit the '''Find Now...''' button. This will find all of the users and user groups on your computer. There will probably be a bunch of users you have never seen before – those are for things like Remote Assistance and other Windows related stuff so don't worry about them. What we want to do is give our '''xbox''' user permission to view this folder over the network.


:To do this, find '''xbox''' in the list and click '''OK'''. It should appear in the list as YOUR-COMPUTER-NAME\xbox. Click OK and you should be back at the Share Permissions window with '''xbox (YOUR-COMPUTER-NAME\xbox)''' selected from the list. We want to give this user Read Only access, so make sure that only '''Read''' is checked under the allow column. If you want to be able to delete files on your computer from your xbox, you can give them full control, but I would not recommend this because you never know whos going to start deleting stuff (little sibblings, drunk friends, etc...). Before we forget, go ahead and remove the “Everyone” users group from the list.


:Save it and repeat for the rest of the folders you want to share.
{{top}}


:'''Note for the power users:''' ''You do not need a seperate share if the folders are nested (ie C:\SHARED\Movies\, C:\SHARED\TV Shows\, etc) because you can set the source path to the Movies folder inside the SHARED folder.''


:Ok... so now you should have one or more folders shared. If you want to test it, go to another computer on your LAN, and you should be able navigate to your computer in “My Network Places” and find your computer in ''Entire Network -> Microsoft Windows Network -> WORKGROUP'' , and log in as xbox/xbox and see your shares. It might not let you access the network due to some screwy stuff Windows does, so if it doesn't work don't worry about it.
{{updated|18}}
 
[[Category:Karellen]]
:Now lets create the source on your xbox....
[[Category:File sharing]]
 
:Go to your xbox and choose the folder type you shared (ie go into “My videos” if you want to add your computer's videos folder). Press the white button on the controller (or title if you are using the remote control). Then navigate to '''Add Source.''' Select '''Browse,''' chose ''Add Network Location...'' and use the following settings...
 
:'''Protocol:''' ''Windows Network (SMB)''
:'''Server Name:''' ''(click browse and find it). If you can't find it, then see the troubleshooting part below.''
:'''Server Folder:''' ''(should be filled in when you clicked browse)''
:'''Username:''' ''xbox''
:'''Password:''' ''xbox''
 
:Then click OK. For some reason the version of XBMC I am using loses the path, so you have to browse for it again, but this time it should show up in the list after you hit browse. Rename it if you wish. This is just your xbox's source name, so if you have shared folders from several different machines you might want to call it Videos (Bob's Computer).
 
:'''Note for the power users:''' ''You can add all of these sources in the [http://wiki.xbmc.org/?title=How_to_Edit_Bookmarks#Through_Sources.xml Sources.xml] file. Just follow their example for SMB/SAMBA/CIFS shares.''
 
:If you are having trouble finding your computer, you can just type your computers name into the '''Server Name''' field. Your computer's name can be found by right-clicking on ''My Computer'', and navigating to the ''Computer Name'' tab and its next to ''Full Computer Name''. You will also need to enter the Server folder, which is the name you gave to the shared folder (ie SHARED/), or it can be a path (ie SHARED/Movies/).
 
:If it still doesn't work, you can give your computer a static IP address and enter the static IP address in the Server Name field.
 
:You're done! I have this set up to share my music as well so that iTunes doesn't have to be running. And obviously, your computer needs to be on in order for you to stream movies onto your xbox from it.
 
:If you're really cool, you can even get the WOL (wake on LAN) script and have it power on your computer for you from your xbox. That guide is for another day...
 
:Hope this helped!
:Cyre
 
<big>How to Configure Hidden Shares</big>
:To create a hidden share. Add $ to the end of the share's name. You must know the name of the hidden share to gain access to it.
 
:For each list (Files, My Videos, etc.) you will have to add a source for your hidden share(s). You can add a source directly to your xbmc.xml file or you can use the XBMC interface. If you add it to the file manually, you can add it to all appropriate sections of XBMC at once. There is a section for each list. More info on [[Media Sources]]
 
:Example:
<pre>
<xml>
    <source>
    <name>share$</name>
    <path>smb://COMPUTER_NAME/share$/</path>
    </source>
</xml>
</pre>
:The following information is more or less a duplicate from [[Media Sources]].
 
:If you choose to add it through the interface, first you need to open the section you want to add the source to. (Videos, Music, Etc.). For this example I will use Videos, but they are all basically the same.
 
:First open Videos, then make sure the highlight is on one of the existing sources.
:Press the white button on the controller to open the menu.
:Select '''Add Source''' from the menu.
 
:'''Note:''' You can enter the SMB/SAMBA/CIFS link manually at this point if you wish. To do so, highlight the box that has <none> in it, and press A. (syntax: smb://COMPUTER_NAME/sharename$/)
 
:If you would rather not type it manually continue reading.
:Choose '''Browse''' on the dialog.
 
:Scroll to the bottom, this can likely be accomplished by pushing up once.
:Select '''Add Network Location...'''
 
:Press the '''Browse''' button, it should be to the right of the '''Server Name''' box. Open '''smb://.'''
:Now find your computer's name, but don't push A yet.
 
:If you can't find it, go back and type it in manually in the Server Name box. (smb://COMPUTER_NAME/)
:Once you find your computer's name, move to the right and highlight OK then push A.
 
:Verify that the '''Server Name''' box has '''smb://YOUR_COMPUTER_NAME/'''
:Now move down to the '''Shared Folder''' box, push A to edit it.
:Type the name of your shared folder, and don't forget to include the '''$'''.
:Move down and highlight '''OK'''
 
:You should be back at the list you were in earlier where you picked Add Network Location...
:Choose the share you just created from the list, move to the right, select '''OK''' and push A.
 
:Enter a name for your new source at the bottom (PM3-default) or the top (MC360) of the dialog.
:Now move to the bottom and select '''OK''' once more.
 
:If you add the same source to some of the other lists you shouldn't need to add a network location again, it should be waiting in there for you already.
 
:That's it, you should be good to go. Enjoy. TaeBoX
 
==Windows Filesharing (on Mac OS X)==
<big>Introduction</big>
:'''Windows Sharing''', (also known as SMB or CIFS, is probably the most flexible of all of the options for sharing media between your computer and XBMC. It has many advantages over the other options, including:
* It is incorporated in Mac OS X (OS 10.2 and later), eliminating the need for the installation of 3rd-party software.
* It allows for authentication by your Mac OS X username and password, making it good for use on public networks.
* Once properly configured, it will allow your network shares to be seen and accessed by not only XBMC, but also any Windows system on your network.
* It is is capable of streaming all types of media and gives the option of sharing individual folders (or entire drives - usually configured through the 3rd-party software [http://www.hornware.com/sharepoints/ SharePoints], but can also be achieved through some Terminal trickery).<br><br><br>
 
<big>Configuring Windows Sharing (on Mac OS X 10.2 or later)</big>
:'''Enabling Windows Sharing'''
:Once you have configured your Network Port settings to communicate with XBMC you need to enable '''Windows Sharing''' through '''System Preferences''' by:
* Navigating to the '''Sharing''' panel.
* Selecting the '''Services''' tab.
* Ticking the box next to '''Windows Sharing''' in the '''Select a service to change its settings''' area (and pressing '''Start''' if necessary).
* Click '''Accounts...''' and select the name of the user account that will share files. Enter the password for that user.
 
:A message will then be displayed at the base of the panel:
 
:'''Windows users can access your computer at \\x.x.x.x\youraccountsusername'''
 
:'''Enabled accounts: youraccountsusername'''
 
:You have now enabled Windows Sharing on Mac OS X, giving you access to the enabled accounts (listed in the Services tab) through XBMC. Now you can configure this share in the XBMC GUI.
 
<big>External links to other guides</big>
*[http://www.spywareremoversreview.net/ Malware Scanner]
 
<big>Windows Filesharing (on Mac OS prior to 10.2)</big>
:'''Samba''' (from [http://www.samba.org samba.org]) is an Open Source/Free Software suite that has, provided file services to all manner of SMB/CIFS clients.
 
<big>Sharing an entire drive on Mac OS X using SharePoints</big>
:While enabling Windows Sharing gives you access to the enabled accounts listed in the Services tab, the Mac OS X GUI limits further more advanced configuration that would enable you to share entire drives connected to your system. While this can be configured through editing certain system files through the Terminal, a far easier (and safer) way is by using the 3rd-party software [http://www.hornware.com/sharepoints/ SharePoints].
 
:After installing SharePoints, run it and configure it in accordance with it's manual http://www.hornware.com/sharepoints/SharePoints_Doc_English.pdf<br><br><br>
 
<big>External links to other guides</big>
*[http://www.apple.com/support/tiger/network/ http://www.apple.com/support/tiger/network/]
*[http://www.command-tab.com/2005/03/27/sharing-media-to-xbmc/ http://www.command-tab.com/2005/03/27/sharing-media-to-xbmc/]
*[http://www.macosxhints.com/article.php?story=20040610173559266 http://www.macosxhints.com/article.php?story=20040610173559266]
*[http://www.macosxhints.com/article.php?story=20050324163047299 http://www.macosxhints.com/article.php?story=20050324163047299]
*[http://mackeeper.zeobit.com/mac-security Mac security] software
 
==Windows Filesharing (on Linux, using Samba)==
<big>Introduction</big>
:'''Samba''' (from [http://www.samba.org samba.org]) is a group of Linux/UNIX/BSD programs designed to be able to interact with [[Windows File Sharing (SMB/SAMBA/CIFS)|Windows default file sharing protocol]], also known as [[Windows File Sharing (SMB/SAMBA/CIFS)|Common Internet File System (CIFS)]], which was formaly known as [[Windows File Sharing (SMB/SAMBA/CIFS)|Server Message Block (SMB)]]. The SAMBA package offers a service which can be used to share media on a Linux/UNIX/BSD based machines to both XBMC and your home Windows computer easily. Another type of device that use the SAMBA (or SMB/CIFS) network-protocol is [[NAS|NAS (Network Attached Storage)]] boxes, which are dedicated file-sharing devices available for home/small-office and professional/enterprise environments. All elements are done from a command-line as it reduces confusion.<br>
 
:'''Note!''' This article assumes some basic knowledge of the Linux/UNIX/BSD operating-system interface and environment.
<big>Installing Samba</big>
:Due to the diversity of linux distros only three methods will be covered in this article the standard linux install, the one using Gentoo's emerge package manager and Debian/Ubuntu's [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool Advanced Package Tool].
 
*Installing Samba regardless of distro
:#<code>wget http://us4.samba.org/samba/ftp/samba-latest.tar.gz</code>
:#<code>tar -xvf samba-latest.tar.gz</code>
:#<code>cd samba-{version}</code> (At this time its samba-3.0.22)
:#<code>./configure</code>
:#<code>make install</code>
 
*Installing Samba using Gentoo's [http://en.wikipedia.org/wiki/Portage_%28software%29 emerge]
:#<code>emerge samba</code>
 
*Installing Samba on Debian/Ubuntu:
:#<code>sudo apt-get install samba</code>
 
<big>Configuring Samba shares</big>
:'''Note:''' Currently only the config for a public share will be posted.
 
:Samba's configuration is stored <code>/etc/samba/smb.conf</code>. All the following items should be placed in that file.
 
*Global configuration
<pre>
[global]
workgroup = <workgroup>
netbios name = <name of server>
server string = <title>
log file = /var/log/samba/log.%m
max log size = 50
map to guest = bad user
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
dns proxy = no
</pre>
:;workgroup : Should be set to the workgroup your home pc uses if you planning on accessing this share from a windows PC
:;netbios name : This is the name that will be displayed when browsing the your Network Neighborhood
:;server string : The title of the server that will be displayed in windows(This is not the share name)
 
*Share configuration
<pre>
[public]
path = <dir to share>
public = yes
only guest = yes
writable = yes
</pre>
:;path
::Set this to the path to be shared by samba
 
Run <code>testparm</code> to check your smb.conf for internal correctness.
 
<big>External links to other guides</big>
*[http://www.mini-itx.com/projects/xbmc-ion/module/7 How to enable Windows File-Sharing on your XBMC Live system (mini-itx.com)]
 
[[category:File Sharing]]
[[category:Linux]]
[[category:Mac OS X]]

Revision as of 07:17, 17 October 2020

Home icon grey.png   ▶ File sharing ▶ SMB

Return to:

Introduction

Windows File Sharing, aka Server Message Block (SMB), is the standard client-server protocol used by Windows to share resources over a network. SMB is available on all Windows computers and can be easily setup by the home user. SMB can also be accessed by other operating systems, which makes SMB the most commonly used network protocol to access content on a NAS or other remote hardware.

Note: SMB v1 is not supported in Kodi. SMB v2 or higher must be used.

This page will detail how to add a network source to Kodi using SMB. It assumes you have already correctly set up your SMB network. If you have not set up your SMB network, a Google search will return numerous online guides. The following links may help also.


Method

SMB (remote or network) server locations can be accessed with either of the following methods:

IP address
If using the IP Address method, ensure you reserve a DHCP address (static IP) for your NAS or other hardware. This ensures that your router will always allocate the same IP address to the server. If you choose not to do this, then you may find that the router has allocated a different address to your NAS and Kodi will no longer be able to access the media files.
To reserve a static IP address, log into your router and add the MAC address of the hardware to the Reservation list in your Router. If you do not know the MAC address, you should see it in the list of connected clients.
Device Name
If using Windows PC's you can use the Device Name of the PC.
The Device Name can be found in Settings > System > About on your Windows PC.


Adding Remote Sources

The images will guide you through the process of adding an SMB Source to Kodi.

Depending on which method you have chosen to use, choose either Step 4 or Step 5, not both

Note: SMB v2 and later does not support Browse. You must type the folder name in steps 4.2 or 5.2 below.




Return to top