Sunday, 2 October 2011

Installing Samba on the Pogoplug

The Pogoplug can be turned into a dedicated Samba server by following the steps below.


1. PREREQUISITES
As a prerequisite of this article, please complete the steps described in my previous post here in order to prepare your Pogoplug so you can install packages using the IPKG package management system.


2. INSTALLING THE SAMBA PACKAGE
To install the Samba server, SSH to your Pogoplug and perform the following:

# Install samba server
/opt/bin/ipkg install samba2

3. CONFIGURING THE SAMBA SERVER
The Samba server should now be installed.  At this point we need to modify the configuration file.  Perform the following:

# Navigate to the samba config directory
cd /opt/etc/samba/
# Backup the default configuration file
cp smb.conf smb.conf.backup 
# Edit the configuration file
vi smb.conf
My config file is as follows (you can copy, paste, edit as required):

[global]

workgroup = PARKNET
server string = Pogoplug Samba2 Server
hosts allow = 192. 127.
null passwords = yes
guest account = root
log file = /opt/var/log/samba/log.%m
max log size = 50
security = share
encrypt passwords = yes
smb passwd file = /opt/etc/samba/smbpasswd
dns proxy = no
preserve case = yes

[HD1]
comment = HD1 Network Share
path = /tmp/.cemnt
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes


4. RUNNING THE SAMBA SERVER
To start the Samba, run the following:

# Start the Samba Server
/opt/etc/init.d/S80samba start

If all goes according to plan, you should be able to perform the following (from a Windows PC):
  • Go to the Run prompt (Windows key + r)
  • Type "\\pogoplug\" and press enter (where pogoplug is replaced with the IP address of your device)
  • If prompted, enter your root username and password to authenticate
You should now be able to browse your device from Windows Explorer, map drives as network shares etc.



17 comments:

  1. This works wonderfully, though it may be worth noting that (I assume) as this is using Samba version 2.x, it will only handle file transfers smaller than around 2GB. Attempting to copy a file any bigger than this will cause issues as apparently the free space on the drive is incorrectly reported. I tried following this guide, and a couple of others on line, and attempted to install Samba 3.5, however it looks like the Pogoplug doesn't have enough free memory for this to work.

    In general use, this installation is fine however. Thanks again Aaron :)

    ReplyDelete
    Replies
    1. old post but maybe some traffic...by saying smaller than 2GB to transfer, does that also mean 2GB or smaller to stream to xbmc or another program like it?

      Delete
    2. Hi,

      What I meant was that when attempting to copy a file from my Windows PC to a Samba shared drive on my Pogoplug, there seems to be a problem if the file I'm copying is more that 2GB in size.

      When that happens, Windows halts the copy around the 2GB mark and gives a message that there isn't enough free space on the drive. In cases such as these, I usually copy to the Pogoplug by plugging a USB flash drive straight in.

      Files bigger than 2GB seem to stream from the Pogoplug via Samba with no problem.

      Delete
    3. Sorry, replying to myself here. My previous description was incorrect in that I claimed the file transfer halted around 2GB. What actually happens is that when trying to copy files larger than 2GB, Windows (Windows 7 at least) won't start the file copy. It immediately says there isn't enough free space on the drive, but leaves behind a 0-byte file of the same name.

      Delete
  2. Thanks for direct instructions on installing Samba on Pogoplug. I've been searching for such clean and precise steps with explanations that you have given. Have you thought about describing how to install Netatalk or AFP for Time Machine support on the Pogoplug for Mac Users?

    ReplyDelete
    Replies
    1. Hi Anonymous :)

      Thanks for the great feedback. I haven't used AFP, but if it is something you are interested in I could always investigate and maybe write my next blog post about it?

      Cheers,

      Aaron

      Delete
    2. Hi Aaron, thanks for this blog. I ran into problems when trying to connect the share from mac (mountain lion). I have read that Apple has removed SMB shares support (probably those which do not use their new authentication method). If you have any thoughts about it, do let us know.

      Delete
    3. Hi there!

      Please see this comment on my (new) blog:

      http://aaronrandall.com/blog/installing-samba-on-the-pogoplug/comment-page-1/#comment-232

      This blogspot blog isn't active anymore, all new posts and comments go to aaronrandall.com/blog

      Cheers,

      Aaron

      Delete
  3. Aaron, you are amazing. After months and months of trying to find a good tutorial i finally gave up. It was just today that I decided to give it another go and I seem to be doing much better with your guides so thank you! A few questions I have are VERY noob as I have never dabbled in terminal until this pogo plug, and up to this point it has been copy past :)

    1.I am using a mac so editing the smb.conf doesn't make sense. Do mac's use a workgroup? also my ip's are 10.0.x.x because i am using a time capsule. how should my smb.conf file look? Any thoughts?

    2. My main objective is to get my pp streaming content from a connected HDD to my jailbroken Apple TV. (i know i am an Apple fan boy) I have xbmc and a few other programs like it installed. Have you tried anything like that before?

    3. And last I would like to access my media from anywhere by streaming and not have to download it like you would through my.pogoplug.com. is that what all of this will accomplish?

    Thank you for your time in reading this lengthy post. You are an inspiration to all of us noobs out there :)

    ReplyDelete
    Replies
    1. Hi Dan-I-el!

      Thanks very much for your kind words! In response to your questions:

      1. You can probably ignore the workgroup settings - I haven't found them to affect whether I can access the drive from a Mac. To allow access from your IP address range, you will want to set the "hosts allow" line to something like:

      hosts allow = 10.

      That should allow everything from within your network to access the drive.

      2. I haven't tried this setup, but XBMC should probably work (via UPnP) if you enable the settings as described in this post:

      http://www.pogoplugged.com/article/13369/How-To-Enable-Pogoplug-Media-Streaming-to-your-XBOX-360-PS3-or-FreeAgent-Theatre/

      3. Yes, this does allow for that. Installing Samba allows for mapping the HD connected to the Pogoplug as a shared network drive (without the use of the Pogoplug software). It's worth noting that the Samba setup described above will not work with the very latest version of OS X (Apple disabled access to older Samba shares due to security concerns). If you are running the latest version of OS X, you will probably want to install the Pogoplug software (available from here - http://download.pogoplug.com/install/mac/pogoplugbrowser.pkg) instead of following the tutorial and installing Samba. This will allow for accessing your Pogoplug drive(s) without having to download files via my.pogoplug.com, and works with the latest version of OS X.

      Let me know how it goes :)

      Cheers,

      Aaron

      Delete
    2. Hi, I've found this comment on another forum about Samba and Mac OS Lion:

      "My experience is that Lion has upgraded the smb protocol stack and is using a more secure authentication procedure. I asked Apple's fine engineers for instructions on how to deprecate Lion's smb security protocol back down to Snow Leopard's level. They suggested using the following command that needs to be run in a terminal window everytime Lion boots:

      sudo sysctl -w net.smb.fs.kern_deprecatePreXPServers=0
      To restore the smb protocol stack back to Lion's original state either reboot or run in a terminal window:

      sudo sysctl -w net.smb.fs.kern_deprecatePreXPServers=1"

      Gianluca

      Delete
  4. HI,

    I have successfully installed samba and all other necessary tools (as far as I understood). I use your file as it is for smb.conf(removed all other stuff, just whatever you posted above) I just changed the workgroup to my work group.

    Samba starts OK, but can not reach reach from my PC.

    When I do:
    -Go to the Run prompt (Windows key + r)
    -Type "\\pogoplug\" and press enter (where pogoplug is replaced with the IP address of your device)

    Windows7 says it can not reach to the destination.

    What else I can try? I think I am very close but can not figure out what else I can check?

    Info:
    - Pogoplug pro
    - using a memory stick (mounted at /opt - /tmp/.cemnt/sdd is the actual mount point)
    - Installed ipkg and samba2 and followed all of the other steps.

    ReplyDelete
  5. Hi Aaron, thank you very much for the clear explanation, Samba is running but I cannot log in. I guess I did something wrong with edditing the cfg file. It opens in putty with a lot of #text. And then? What must I do, copy your cfg file, changing the workgroup name, but how save it? I closed the putty windows and reopend and run samba, but I cannot login. As you can read: this is my first linux session :-)

    ReplyDelete
  6. One more remark: after a "busybox reboot" the sambaserver is not starting automaticly, can we fix that?

    ReplyDelete
  7. Please add the command for saving the conf.smb file, it took me hours to find it :-)

    ReplyDelete
  8. download plink...part of putty donwnload.
    create a batch file.

    when you hit the file below it will auto restart your pogoplug when its repowered on.

    I heard of creating this file in the rcf file...but you can brick ur unit..this is a safe way whenever you repower your pogoplug

    oh.,change ur ip address and put in your password


    plink -v -ssh root@192.168.0.165 -pw password mount -o remount,rw
    plink -v -ssh root@192.168.0.165 -pw password mount /dev/mtdblock3 /opt
    plink -v -ssh root@192.168.0.165 -pw password /opt/etc/init.d/S80samba start

    ReplyDelete
  9. If you want to see this under Windows as true separate drives so you can copy and move files you need to setup each hard drive. Sda1, Sbd1,...etc.

    If you just make it one drive, you can still pull data for streaming, but to get full access so you move or copy files where windows will pull up the right size of the drive. Otherwise, windows will give odd number on the file size of USB drive..

    [disk1]
    path = /tmp/.cemnt/mnt_sda1/
    browseable = yes
    available = yes
    public = yes
    writable = yes
    printable = no
    create mask = 0777
    guest ok = yes
    browseable = yes
    [disk2]
    path = /tmp/.cemnt/mnt_sdb1/
    browseable = yes
    available = yes
    public = yes
    writable = yes
    printable = no
    create mask = 0777
    guest ok = yes
    browseable = yes

    ReplyDelete