Kodi Community Forum

Full Version: Streaming video between 2 xbmc Linux boxes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to stream video from a dedicated Linux xbmc box in one room to another on a laptop in another room. Both are using v12 on Ubuntu 12.04.

I can stream LiveTV fine.

I've tried upnp but have found it flakey and unreliable not to mention buggy and insecure and I really don't want upnp turned on in my network.

I've tried and failed to get smb and nfs working. Neither method seems to be able to find the source. The only method that works is ftp but that really isn't designed for streaming.

Can anyone point me in the direction of a method that will work, I'm kind of all Googled out. I'm thinking NFS would be the easiest way but I haven't been able to get it to work. Thanks in anticipation.
Some Linux NFS server + client hints here: http://forum.xbmc.org/showthread.php?tid...pid1308706

How to use autofs for mounting from client here: http://forum.xbmc.org/showthread.php?tid...pid1332046

Lemme know if this helps.
Thanks I'll check them out.
This is what I have did:

ON THE SERVER
Code:
sudo apt-get install portmap nfs-kernel-server

sudo nano /etc/default/nfs-kernel-server
    NEED_SVCGSSD=no                    

sudo nano /etc/default/nfs-common
    NEED_IDMAPD=yes                 # added this
    NEED_GSSD=no                    

make these directories + chown them for user xbmc
     /exports
     /exports/share

sudo nano /etc/exports    
    /exports 192.168.1.0/24(rw,fsid=0,insecure,async,no_subtree_check)        
    /exports/share 192.168.1.0/24(rw,nohide,insecure,async,no_subtree_check)

sudo nano /etc/fstab
    /home/xbmc/<share>    /exports/share none bind 0 0

<using ufw currently disabled, will add port rules later>

sudo exportfs -ra
sudo service portmap restart
sudo service nfs-kernel-server restart
sudo exportfs -v

ON THE CLIENT
Code:
sudo apt-get install portmap nfs-common autofs

<added nfs to /etc/modules>

<make directory /mnt/shr>

sudo mount -t nfs4 192.168.1.75:/exports/share /mnt/shr

mount.nfs4: mounting 192.168.1.75:/exports/share failed, reason given by server:
  No such file or directory

Any ideas, can you spot where I've gone wrong? Thanks.
(2013-03-22, 01:26)jonhen Wrote: [ -> ]This is what I have did:

ON THE SERVER
Code:
sudo apt-get install portmap nfs-kernel-server

sudo nano /etc/default/nfs-kernel-server
    NEED_SVCGSSD=no                    

sudo nano /etc/default/nfs-common
    NEED_IDMAPD=yes                 # added this
    NEED_GSSD=no                    

make these directories + chown them for user xbmc
     /exports
     /exports/share

sudo nano /etc/exports    
    /exports 192.168.1.0/24(rw,fsid=0,insecure,async,no_subtree_check)        
    /exports/share 192.168.1.0/24(rw,nohide,insecure,async,no_subtree_check)

sudo nano /etc/fstab
    /home/xbmc/<share>    /exports/share none bind 0 0

<using ufw currently disabled, will add port rules later>

sudo exportfs -ra
sudo service portmap restart
sudo service nfs-kernel-server restart
sudo exportfs -v

ON THE CLIENT
Code:
sudo apt-get install portmap nfs-common autofs

<added nfs to /etc/modules>

<make directory /mnt/shr>

sudo mount -t nfs4 192.168.1.75:/exports/share /mnt/shr

mount.nfs4: mounting 192.168.1.75:/exports/share failed, reason given by server:
  No such file or directory

Any ideas, can you spot where I've gone wrong? Thanks.

Not sure if it is a cut and paste error but in your /etc/fstab you show:
/home/xbmc/<share> /exports/share none bind 0 0

Try instead:
/home/xbmc/share /exports/share none bind 0 0

I would suggest executing the "df" command to see if /exports/share is mounted.
On server what does 'sudo exportfs -v' say?

Also, +1 to what winestock said...make sure fstab correct.
Don't confuse UPnP AV with UPnP settings on a router. UPnP settings on a router can be insecure, but UPnP AV is pretty dang safe (unless you are trying to hide your porn collection on your local network).
(2013-03-22, 05:00)Ned Scott Wrote: [ -> ](unless you are trying to hide your porn collection on your local network).

Technical advice on that will cost extra. Rofl
Ah yes <share> that was a typo in my notes and wasn't in the script.

xbmc@xbmc:~$ sudo exportfs -v
/exports 192.168.1.0/24(rw,async,wdelay,insecure,root_squash,no_subtree_check,fsid=0)
/exports/share 192.168.1.0/24(rw,async,wdelay,nohide,insecure,root_squash,no_subtree_check)

df doesn't show /exports/share mounted but nano /etc/mtab shows this at the end:

/home/xbmc/share /exports/share none rw,bind 0 0
rpc_pipefs /run/rpc_pipefs rpc_pipefs rw 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0

I could only get upnp to work with it enabled in the router and even then it was flakey. My "porn" collection only exists on laserdisc anyway and probably wouldn't be classed as porn today LOL.
I think I've found the problem, sending nfs instead of nfs4 returns no errors:

sudo mount -t nfs4 192.168.1.75:/exports/share /mnt/shr

returns the error

sudo mount -t nfs 192.168.1.75:/exports/share /mnt/shr

doesn't.

Will check to see if this all works as expected.

EDIT: can now share files just have to sort out why it freezes my client xbmc when trying to exit the share directory,.

Thanks for the help guys.
(2013-03-21, 16:35)jonhen Wrote: [ -> ]I'm trying to stream video from a dedicated Linux xbmc box in one room to another on a laptop in another room. Both are using v12 on Ubuntu 12.04.

I can stream LiveTV fine.

I've tried upnp but have found it flakey and unreliable not to mention buggy and insecure and I really don't want upnp turned on in my network.

I've tried and failed to get smb and nfs working. Neither method seems to be able to find the source. The only method that works is ftp but that really isn't designed for streaming.

Can anyone point me in the direction of a method that will work, I'm kind of all Googled out. I'm thinking NFS would be the easiest way but I haven't been able to get it to work. Thanks in anticipation.
i have an acer revo (running fc-15) upstairs in my office.
down stairs i have another revo running xbmc live-usb connected to my pc.
both are wi-fi'd to my router.

i use sshfs (with keys) to stream mkv's from the fedora pc to xbmc-live. for the few times i try to stream a dvd iso it tends to buffer alot.
@jonhen - glad you got it working, however, the 'nfs' vs 'nfs4' subtlety could point in direction of error.

Directions I gave you are for NFSv4 ... 'nfs' mount type typically implies NFSv3. 'cat /proc/mounts' from the client should show you details on mounting of shares from the client.

Make sure any previous NFS config you had is disabled and the NFSv4 notes I gave should work.
Just to add I have found why xbmc was hanging when exiting the share, was running mistakenly running v11 Eden not V12 on the client, although the server is running V12.

Upgraded to v12.1 and it no longer hangs on exiting and all is sweet. Smile

A note about adding/changing a source to share in fstab, I needed to do mount -a to update the change, I don't think rebooting was enough.

Once again thanks for pointing me in the right direction.

Thanks thethirdnut points noted. Must be running nfs3 then, somehow thought I was running nfs4 but obviously not.