Jump to content



Setting Up Smb Shares From Linux Box

  • Please log in to reply
15 replies to this topic

#1 [emblym]


    X-S Senior Member

  • Members
  • PipPip
  • 172 posts
  • Xbox Version:v1.0

Posted 09 July 2004 - 04:37 AM

I wasnt sure where to put this, but i think this is the best place for it.

Ok, Im going to start off with this before i get started
SMB= Protocol (Server message block)
Samba= Client that uses SMB protocol to connect and share with window systems

I know of a few people who were having troubles setting up SMB shares from a linux system. So after I figured it out, I thought I would make a tutorial on setting one up. Ive looked all over this forum, but couldnt really find anything on setting one up from a Linux system. To let you know before hand I am running Redhat9 with no GUI. I also have webmin installed to make things easier. To use webmin you must have a webserver up and running. I would highly recommend using webmin. Get it by typing this command in the konsol...

wget http://prdownloads.s...50-1.noarch.rpm

then install with...

rpm -U webmin-1.150-1.noarch.rpm

you can now go to http:///www."YOURDOMAINorIP".com:10000

First things first see if you have samba already set up and enabled on your linux box. Type in the folling command in the linux konsole

/etc/init.d/smb start

-If you dont have samba installed then it will say bash file not found.

-If you do have samba installed then you will see it starting with a green [OK] you should then try the following....

Type in your servers IP adress in the browser bar to see if any shares come up. For example mine is...


If a shared folder shows up it may just show a home folder or it may ask for a user name and password.

If nothing shows up go to step 1
If it ask for a user name and password go to step 2


To install samba do ONE of the folling steps...
a. Install samba from your sytem install disc (which is hard with no GUI)
b. Install all the RPM's in this directory
c. Install samba by using the following commands
wget http://www.emblym.co...-7.9.0.i386.rpm
rpm -U samba-2.2.7a-7.9.0.i386.rpm

wget http://www.emblym.co...-7.9.0.i386.rpm
rpm -U samba-client-2.2.7a-7.9.0.i386.rpm

wget http://www.emblym.co...-7.9.0.i386.rpm
rpm -U samba-common-2.2.7a-7.9.0.i386.rpm

After installing samba you must configure it. So on to step 2...


Your samba config file is located at /etc/samba/smb.conf
You are more than welcome to take my config and use it as an example or just replace yours with mine. Always make sure you make a backup of the original. Here is my config file. You can copy paste it and save it as smb.conf


# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors.
#======================= Global Settings =====================================
log file = /var/log/samba/log.%m
smb passwd file = /etc/samba/smbpasswd
load printers = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
map to guest = bad user
encrypt passwords = yes
printer admin = @adm
dns proxy = no
server string = Samba Server %v
printing = cups
workgroup = MSHOME
os level = 20
printcap name = cups
security = user
max log size = 50

  comment = Home Directories
  browseable = no
  writable = yes
# You can enable VFS recycle bin on a per share basis:
# Uncomment the next 2 lines (make sure you create a
# .recycle folder in the base of the share and ensure
# all users will have write access to it. See
# examples/VFS/recycle/REAME in samba-doc for details
;  vfs object = /usr/lib/samba/vfs/recycle.so
;  vfs options= /etc/samba/recycle.conf
# You may want to prevent abuse of your server disk space, and spread of virii
;  veto files = /*.eml/*.nws/*.dll/*.mp3/*.MP3/*.mpg/*.MPG/*.vbs/*.VBS/

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;  comment = Network Logon Service
;  path = /var/lib/samba/netlogon
;  guest ok = yes
;  writable = no

#Uncomment the following 2 lines if you would like your login scripts to
#be created dynamically by ntlogon (check that you have it in the correct
#location (the default of the ntlogon rpm available in contribs)
;root preexec = /usr/bin/ntlogon -u %U -g %G -o %a -d /var/lib/samba/netlogon/
;root postexec = rm -f /var/lib/samba/netlogon/%U.bat

# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;    path = /var/lib/samba/profiles
;    browseable = no
;    guest ok = yes
;    writable = yes
# This script can be enabled to create profile directories on the fly
# You may want to turn off guest acces if you enable this, as it
# hasn't been thoroughly tested.
;    root preexec = PROFILE=/var/lib/samba/profiles/%u; if [ ! -e $PROFILE ]; \
;    then mkdir -pm700 $PROFILE; chown %u.%g $PROFILE;fi

# NOTE: If you have a CUPS print system there is no need to
# specifically define each individual printer.
# You must configure the samba printers with the appropriate Windows
# drivers on your Windows clients. On the Samba server no filtering is
# done. If you wish that the server provides the driver and the clients
# send PostScript ("Generic PostScript Printer" under Windows), you have
# to swap the 'print command' line below with the commented one.

[your share name]
writable = yes
printable = no
public = yes
create mode = 777
path = /var/your_share_folder/at_where_ever
directory mode = 777

You only need to worry about the share at the very bottom. You can name the share anywhere you want. The only other thing you need to change is the path of the share on your linux box. Mine for example is located at \var\www\html\downloads. So thats what I put for my path. After you have everything set up start up samba with the folling command

/etc/init.d/smb start

Go to \\YOUR_SERVERS_IP and see what happens. Your shares should show up. If not PM me or AIM me and ill get you through it.


After you have your shares set up its time to configure XBMC to read them. As a default samba uses MDKGROUP as its domain. so inside the paths tags enter this into your smb share located in the XBMC xml..

smb://MDKGROUP;guest@SERVER_IP/"share name"

you can also browse all shares from WORKGROUPS (SMB)

Load up XBMC and test it out and see what happens. This took me many many long nights to figure out so dont get frustrated. Sorry if the tutorial doesnt help or just makes matters worste. I just tried helping the best i knew how. I would be MORE than happy to help anyone having troubles, or to even set it up for you. PM, AIM, or email me with any questions.

#2 SigTom


    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,215 posts
  • Xbox Version:v1.0

Posted 09 July 2004 - 04:42 AM

Good work. This is how I also always set up a Nix box, thru Webmin. Can I make a suggestion tho? You can do all of this thru the Webmin interface if you go to Servers->Windows File Sharing. That way you can tell if Samba is running already and you can set up shares thru the web interface as well, all point and click. It may be a bit less intimidating for new users to Linux than the command line.

Edited by SigTom, 09 July 2004 - 04:43 AM.

#3 [emblym]


    X-S Senior Member

  • Members
  • PipPip
  • 172 posts
  • Xbox Version:v1.0

Posted 09 July 2004 - 04:46 AM

yea defintally but as i mentioned i dont have a GUI on my box. i also didnt want to scare people off by mentioning webmin because you must have a web server up and running to use it. but yea webmin is amazing. it makes things very easy.

#4 SigTom


    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,215 posts
  • Xbox Version:v1.0

Posted 09 July 2004 - 04:47 AM

Ahh I thought you were accessing your RH box thru http on another box with a GUI (Windows, X, etc).

#5 [emblym]


    X-S Senior Member

  • Members
  • PipPip
  • 172 posts
  • Xbox Version:v1.0

Posted 09 July 2004 - 02:35 PM

my box is a dedicated server so i thought running no GUI was the best way to go

#6 JayDee


    X-S Legend

  • Head Moderators
  • PipPipPipPipPipPipPipPipPip
  • 5,750 posts
  • Gender:Male
  • Location:Sweden
  • Xbox Version:v1.1
  • 360 version:v2 (zephyr)

Posted 09 July 2004 - 02:38 PM

Added to sticky smile.gif

#7 [emblym]


    X-S Senior Member

  • Members
  • PipPip
  • 172 posts
  • Xbox Version:v1.0

Posted 10 July 2004 - 09:55 PM

thanks i appreiciate that

#8 dmm


    X-S Enthusiast

  • Members
  • 2 posts

Posted 20 July 2004 - 10:41 AM

I have samba set up, pretty much like this. I created bookmarks for the relevant shares, and as I'm behind a firewall made them guest accessible and browseable.
I can read from them, and play media off them just fine.

Can XBMC (latest cvs release) write to samba shares?

Sounds simple, but I can't find any of the samba shares as destination directories in the XBMC filemanager!

I should take my windows laptop home and test, but then if someone can confirm this should work, i'll keep hacking at it a bit more.

#9 dmm


    X-S Enthusiast

  • Members
  • 2 posts

Posted 21 July 2004 - 12:06 AM

More on the issue of whether XBMC can write to samba file shares.
I tried connecting to a share using my regular username and password.
Still couldn't get any of the file shares to come up as destination directories sad.gif

#10 tobbenet


    X-S Enthusiast

  • Members
  • 4 posts

Posted 07 August 2004 - 07:43 PM

I've read through your excellent tips, but as some in this thread I also had problems getting my files to show up.

I use webmin also and the key to getting the shares to show up is to check the box guest only for the share. All other options results in the files not beeing displayed.

I solved this by making a new share of the same directory and selected the guest only on this and it all worked fine.

#11 [emblym]


    X-S Senior Member

  • Members
  • PipPip
  • 172 posts
  • Xbox Version:v1.0

Posted 13 August 2004 - 04:57 AM

sorry i havent check this thread in a while....but i would of thought making the share "public" as i mentioned in teh config would of automatically set up guest users. are you guys still haveing troubles?

#12 hal9000mx


    X-S Enthusiast

  • Members
  • 3 posts

Posted 18 September 2004 - 04:27 AM

I followed the tutorial and my media center is working now with my linux box. I have only one question, i don't want to let the shared public, how can i protect them with a user and a password?


#13 angrypants


    X-S X-perience

  • Members
  • PipPip
  • 359 posts

Posted 07 October 2004 - 03:20 AM

Thanks for the tutorial it worked liek a charm, but like the other guy said can you write an idiot proof tutorial like you just did about how to secure it with a password? I have used linux for years but never reallly botherd with samba I have just stuck to ftp which is ok but it would be nice to get things really working properly.

#14 Delusions


    X-S Member

  • Members
  • Pip
  • 118 posts
  • Xbox Version:unk

Posted 07 October 2004 - 05:52 AM

Nice tut I was wondering about this because I am going to build a new comp soon and set my current pc up as a linux server

#15 jake_junk


    X-S Enthusiast

  • Members
  • 10 posts

Posted 29 July 2005 - 06:10 AM

Quick question....

I have 2 smb shares that I would like to access, but I would like the contents of the shares to show up when I select SMB Share in XBMC. I can get both shares to come up if I only define one of them, but I can't get them to show up at the same time.

Basically, I have 2 movie shares and I don't want to have to create 2 shares in Xbmc. I would like to be able to select "SMB Shares" and have both listed so I one big list of movies, instead of 2 smaller lists.

Is this even possible? I have tried to seperate the shares with a comma (like how you can if you want to define more than one location for Games, etc.), but haven't had any luck.

If someone has any clue how to do this I would greatly appreciate any help.

Thanks in advance.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users