Mount a Remote Drive via SMBFS

From AwkwardTV
Jump to: navigation, search

This section deals with possible solutions to handle mounting of SMBFS ('Windows shares') on the ATV.

Users familiar with OS X kernel extension will know from experience that a stock 10.4.7 or 10.4.8 smbfs.kext will not load/link against the ATV kernel. This means that SMB shares cannot be enabled simply by copying the smbfs.kext from a Mac onto the AppleTV. Instead, a separate smbfs mounter program will have to be installed.

There are a number to choose from - Sharity 3, DAVE, etc.

Commercial SMB Clients (Ex. DAVE)

Not tested for obvious reasons.

Sharity Light

Here follows the procedure to mount windows shares using Sharity Light:

  • This procedure requires you to work with the command line in Terminal.
  • You can either compile sharity yourself, or download a pre-compiled binary.
  • You will need Developer Tools installed on an Intel Mac in order to compile sharity yourself. If you'd rather avoid compiling from source (or have a PPC Mac, linux box, etc.) use the pre-compiled binary option below.

Compiling sharity from source yourself:

  • Make sure the server you're about to mount exists in the /etc/hosts file on your AppleTV.
  • On your Mac, download v1.3 @
  • Sharity will download as a .tar archive. You can unpack it by clicking on the archive and OS X will unpack the archive for you.
  • Unpack the archive (this has been tested on an Intel 10.4.8 system) and edit the Makefile.
  • The Makefile comes set to compile for NextStep/OpenStep rather than OS X.
  • So you need to switch the Makefile to compile for OS X by commenting out the NextStep section (i.e. putting a # symbol at the beginning of each line of the NextStep section
  • # Uncomment the OS X section by removing the # symbols at the beginning of the CFLAGS, THE_CC and RPC_WARNFLAGS lines of the Makefile section for MacOSX.
  • You will need to do some tapdancing to compile Sharity. Run make. It will bomb out--don't worry. cd to nfs, run make, cd .., run make, and test ./shlight
  • You will now have a compiled binary, shlight

Precompiled binary option:

Once you have compiled or downloaded the binary:

  • sftp, scp or use fugu to transfer shlight from your computer to the AppleTV. You will want to transfer the binary first to your ATV frontrow home directory: /Users/frontrow/
  • After transferring the binary to the AppleTV, SSH into the ATV
  • First make sure your AppleTV drive is mounted read/write.
  • From SSH type: sudo mv shlight /usr/sbin (or /usr/bin)
  • You will be asked for a password. The password is frontrow by default.
  • Then type: sudo chmod +x /usr/sbin/shlight

Mounting your drives as frontrow:

  • Sharity is a userland application. It is not built into the operating system and rather must be placed into running status by you from ssh, or through the use of a script should you wish to automatically mount designated drives upon startup
  • To mount your share, run shlight from the command line. Following the shlight command indicate the share first (use SMB // notation for the server name, followed by the share name) and the sharepoint the SMB share will be mounted to on your AppleTV second. Unlike appleshare or NFS mounting on the AppleTV you do not need to create a mount point using mkdir--sharity will provide the mount point you indicate.

For example:

/usr/sbin/shlight //server/Share /Users/frontrow/Movies/MountedShare

  • Some SMB servers will require you to specify a username and password in the command-line. The username and password needed are those from the account sharing the directory you want to mount. For example:

/usr/sbin/shlight //server/Share /Users/frontrow/Movies/MountedShare -U username -P password

This format is particularly useful in a script. You can automate the mount by placing the above command in the /etc/rc.local file on the AppleTV.

  • Or you can just run:
/usr/sbin/shlight //server/Share /Users/frontrow/Movies/MountedShare -U username
if you don't mind being asked for a password

After mounting your share:

  • Fire up ATVFiles and browse your content
  • Tested for about 12 hours with a variety of clips ranging in size 600Mb-4Gb, bitrates 500Kbps-4.5Mbit, and codecs supported by Perian. No issues yet.
  • Also tested on a linux box running ubuntu Feisty Fawn.