How to mount NFS share in XBMC Live? (Asrock ION/ Synology Diskstation)
#16
I edited my sources:

Code:
sudo nano /etc/apt/sources.list

Then inserted this, found in this topic http://forum.xbmc.org/showpost.php?p=445161&postcount=9
Code:
deb http://it.archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse

# Custom repositories
deb http://it.archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse                                                                                          
deb http://www.lonelycoder.com/debian hts main                                              
deb http://it.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ karmic main                              
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/ karmic main

Then I tried again and again got the same. Also rebooted, but still only get this:

Code:
xbmc@dhcppc3:~$ sudo apt-get install nfs-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package nfs-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package nfs-common has no installation candidate
xbmc@dhcppc3:~$

I checked my sources again and the sources seen above are in there. I think I am close now...but help greatly appreciated! Should I do a "sudo apt-get update"?
Reply
#17
Did
Code:
sudo apt-get update

, and afterwards I could finally do

Code:
sudo apt-get install nfs-common

without errors. I ran the mount command and got

Code:
xbmc@dhcppc3:~$ sudo mount -t nfs 192.168.1.30:/private /media/misc
mount.nfs: access denied by server while mounting 192.168.1.30:/private

I Thinkmaybe I do need to give the password in there somewhere? Googled on the error but can't find anything useful.
Reply
#18
I can't help you with the password. NFS is based on file permissions and IP access AFAIK. I tell my NFS server which IP addresses can connect to what shares and setup file permissions. Maybe read some documentation on how to do that on your nfs box?
Reply
#19
Thanks for getting me this far. I also feel it is the nfs server now. I use a Western Digital Mybook World II which supports NFS out of the box.

I enabled NFS on my "private" share and I also added the ip addresses of my linux box and my other pc. Will google more on how to test it in my windows pc first, before continuing in Linux.
Reply
#20
Another step!

Here I am again! turns out my path wasnt correct, found out in windows using showmount command that I had to add DataVolume in between

this command now returns no errors!
Code:
sudo mount -t nfs 192.168.1.30:/DataVolume/Private /media/misc

I tried to see the files with LS and I get this:

Code:
xbmc@dhcppc3:~$ ls /media/misc
ls: cannot open directory /media/misc: Permission denied

Which is correct I guess, as my shares have a password. Only question left now is how I tell the logon and password? Do I need to? My shares have passwords and the ip is allowed (is ip enough?) I also tried browsing to it in XBMC (it is still /media/misc) but that doesn't work.
Reply
#21
try

Code:
sudo ls /media/misc

if this works then change permissions to your misc folder by

Code:
sudo chmod 777 /media/misc

this will make folder misc available to read, write and execute for everybody however the files in the folder (your NFS box) will still have their own permissions so you may need to adjust it for user xbmc or whatever you xbmc user is
Reply
#22
Almost there! first tried
Code:
sudo ls /media/misc

And it didn't work. I then read your last part and decided to make a user xbmc on my NAS. Granted it access to the Private share, ran again, and I see a list of folders woohoo! Will check it out on XBMC next.

If I see it working downstairs I'll also changed the files made initially to run this at boot.

lastly I'll wrap up what I did for my own reference and for future readers/searchers.

EDIT: IT WOOORRKS!!! Thanks all for helping out.

It just doesn't work automatically now. In the startup file I now have
Code:
mount -t nfs 192.168.1.30:/DataVolume/Private /media/misc

but when I boot, and use putty the ls command doesn't work. I tried this command above again but it needs root acces rights (sudo before it). should I add sudo in the file as well? don't want to enter logon and password for sudo during boot though.
Reply
#23
you don't need to add sudo to the file
try to run that file after login and see if it actually works

Code:
sudo /etc/rc2.d/S99nfs_startup

try to list your misc folder after that

if it works then:
1) maybe your file is not executable, check that by doing:
Code:
ls -la /etc/rc2.d/S99nfs_startup
you should see something like:
Code:
-rwxrwxrwx 1 root root 40 2009-11-02 19:21 /etc/rc2.d/S99nfs_startup
only first rwx is important,first x means is executable for owner (root)

2) increase sleep time to 10 in the script in your home folder, maybe it needs to wait longer for network to come up

3) XBMClive is not calling the files in /etc/rc2.d directory at startup - this is actually very possible, I am not running live version
in this case you need to to put content of S99 file somewhere else
try
Code:
sudo pico /etc/rc.local
and add content of S99 file there
Reply
#24
Thanks uomiarz, I appreciate the help. Got to head for work but will check later.
Reply
#25
kees667 as another Synology user you know you can use the Synology UPnP/DLNA built in media server with XBMC, it should provide sufficient speed boost over samba (at least thats what I've read).

The Synology media server supports most of the common formats, avi, mp4, mkv etc & more.
Reply
#26
Just tried it. The fist command works, and the second seems okay as well. I get:

Code:
-rwxr-xr-x 1 root root 31 2009-11-28 17:46 /etc/rc2.d/S99nfs_startup

I will now increase sleep time, test that, and if that doesn't work I'll add the contents in the other file.

Wil the sleep command actually delay booting? Or will the rest of the booting continue? My NAS has a standby function so it could very well be that sleep thing.

@Starstream: I don't have a Synology but a Western digital Mybook. The topic starter did have a Synology though so I see the mixup. My WD also has a media server, but if this works I'd prefer it.

[Edit] Sleep 10 doesn't help, 15 neither.

Edited the file /etc/rc.local to this, should I leave the exit 0 there? Don't really understand the default text in the file.
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#/bin/bash
sleep 15
~/nfs_share
exit 0

[Edit 2] Unfortunately this also doesn't work. Can I also put the mount command in /etc/rc.local ? It would seem that now /etc/rc.local calls /nfs_share in which I mount, but I wonder if I can't do that directly?

I jusr ran nfs_share manually (needed sudo), after that "ls /media/misc" works, so the only thing left is to run this correctly at boot somehow. Very close now!

[edit 3] Just put the mount line directly in /etc/rc.local, rebooted, ran "ls /media/misc" and I see my folders! Just need the final proof in xbmc now, but it seems like I am there! Thanks to all the help!
Reply
#27
Looks like you have good understanding of what is going on now.

For future use maybe you can out some quick how to with NFS and LiveXBMC
Reply
#28
Thanks to your help! yesterday evening I made a draft for a full guide on my pc upstairs, will post it here later as a chronological guide for other noobs like me (and for my own future reference!).
Reply
#29
Noob guide for using NFS on XBMC LIVE (installed on harddisk)

Credits
All credits for this information goes to uomiarz, who helped me patiently through all my problems in setting this up. Since it now finally works I decided to do a chronological tutorial, both for my own future reference if I reinstall, but also for others as this thread has grown and I ran it to very specific problems that others might not run into.

Mounting an NFS drive in XBMC Live 9.11 beta 1 (installed to harddisk on Asrock 330)
Using a Western Digital Mybook World II 1 TB nas specifically, for other NAS the NAS setup part might be different

To enter all the commands either use CTRL-ALT-F2 on your XBMC machine or go to another pc and use putty to logon to XBMC machine. I preferred the last option as it allowed me to copy paste stuff from this thread

Getting ready - NAS
The NAS needs to be set up correctly
-On your NAS: create a user that matches your XBMC user/password, and allow it access to the share you want to see in XBMC
-Under settings allow the XBMC machine's ip-address access
-Find out the full path to your NFS share. I stumbled here. My ip is 192.168.1.30, and my share name is "Private" but when I combine the two they are not my NFS path, there was a diskname in between. I found my correct path using "showmount -e 192.168.1.30" from a windows machine, which just showed me the paths available on the NAS. My path was "192.168.1.30:/DataVolume/Private" and will be used in the rest of the guide. I think it is case sensitive!

Getting ready - XBMC
XBMC machine needs to have NFS support installed. If your machine is set up correctly this command will do that for you:
Code:
sudo apt-get install nfs-common

For me it didn't. My sources file was empty (bug in 9.11 beta 1). I expect that to be solved so read this full thread if you need to edit it. Secondly I then also needed to do the command "sudo apt-get update" before nfs-common which I think tells the machine what software and updates are available for download.

Secondly also need to specify a location where the drive is mounted. Basically after mounting this is where you browse to. I used location /media/misc which I created with
Code:
sudo mkdir /media/misc
Other locations should also work, this is not a mandatory name.

First try - Mounting manually
Try this:
Code:
sudo mount -t nfs 192.168.1.30:/private /media/misc
If there are any errors look carefully what they are. I got access right errors because initially I hadn't created an XBMC user on my NAS. If you get nothing, just a new prompt, then it worked

First try - Testing if it worked
Code:
ls /media/misc
should show what is in your NFS share. You might need to add sudo before it
Code:
sudo ls /media/misc


First try - how do I open this location in XBMC?

In XBMC when you select add source and browse you see mostly network paths, but you need to browse to /media/misc. Do "add source" and then instead of "browse" just type /media/misc in the window that says <none>. Give it a name you want on a bottom window and you are all set

Getting your machine to do this everytime at boot
Use this command to open a file which is run every time at boot:
Code:
sudo pico /etc/rc.local

The last line should read "exit 0" - before that insert these two lines so that it looks like this:

Code:
mount -t nfs 192.168.1.30:/private /media/misc
sleep 10
exit 0

Sleep 10 might not be necessary, but it works for me. If you mess up while editting just quit without saving. Reboot and try if you can browse the share using:
Code:
ls /media/misc
or in XBMC. My NAS has a standby mode so in XBMC sometimes I don't see anything right away, try again after 10 seconds

That's it. Once more a great big thanks to uomiarz and others for helping me get this done. If I missed anything in this guide - please let me know, I'll edit it.
Reply
#30
Hi,

anyone know how it works with "windows home server/windows services for unix" ?
Reply

Logout Mark Read Team Forum Stats Members Help
How to mount NFS share in XBMC Live? (Asrock ION/ Synology Diskstation)1