The solution is to work around the buggy smb mounting code in XBMC that creates these hangs and also, in general, doesn't play so nicely with Windows 7 shares. Instead, we use 'autofs' to mount the shares locally into a mount point within the XBMCLive Ubuntu outside of XBMC itself - this way the shares appear to XBMC as local folders, and the hangs disappear!
Here's the solution:
In a terminal (e.g. a putty connection), you must:
Create an entry in /etc/hosts for your server
eg.
192.168.1.51 homeserver
Then:
sudo apt-get install smbclient
sudo apt-get install smbfs
sudo apt-get install
(this installs the appropriate packages for automounting shares)
Add to /etc/auto.master
Code:
/smb /etc/auto.smb --timeout=60
Create /etc/auto.smb.yourservername
Code:
username=yourusername
password=yourpassword
Restart autofs
Code:
sudo service autofs restart
Your shares can now be accessed via /smb/yourservername/...
(That is, to list them, you need to 'ls /smb/youservername/' - if you just 'ls /smb/' you won't see the shares as they are mounted on demand!)
You must also remove ANY references to your old smb shares in XBMC.
Goto the folder: /home/#XBMCUSER/.xbmc/userdata, Edit sources.xml
Remove any source that has "smb://" in it. In my case I did a replace of smb://#USER@..../ to /mnt/share/.... since I've mounted all my shares on my box.
Then edit passwords.xml
Remove your smb passwords
Last edit mediasources.xml
And also remove the share there.
This solution completely eliminates the hangs. It is needed for Dharma as well as the hanging issue remains as of Beta2 for Dharma.
Another nice thing about this solution is that browsing to shares seem quicker in general this way.
You just browse for the source as it's local - should be right there...
ReplyDeleteHave you confirmed you actually have autofs installed and running? You need it to be running, the config files alone aren't enough. autofs doesn't come by default with XBMCLive.
ReplyDeleteI managed to configure the above and I can see the shared from my server. Only when I try to open the share I receive the message: "No such file or directory".
ReplyDeleteI addition of above I did install autofs as well and the shares are visible. Even after service restart or server reboot, no luck.
I tried the above on XBMC-Live Beta 4, as the idle hanging problem still remains in this version.
Nice tip. In my experience seem to reduce the xbmc (dharma rc2 installed on debian sid) latency on big directories. Sadly the tip doesn't remove completely this latency that it's a bit annoying
ReplyDelete@Kwa-Si-Mo if u still experiencing problems please take a look at http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs
Seemed to have "somewhat" similar issues as @Kwa-Si-Mo. I just can't see anything on the machine with the shares. Autofs is installed. I posted a thread over at XBMC forums to help me with the issue:
ReplyDeletehttp://forum.xbmc.org/showthread.php?t=89513
I need some additional help to make this work because I get No such file or directory if I use the ls /smb/GYULA-PC/Anime command to test.
ReplyDeleteSome troubleshoot maybe hepls
you wrote :
Create an entry in /etc/hosts for your server
eg.
192.168.1.51 homeserver
Can this be any ip address or a specific one ? If yes how do I determine mine ? I've used the one that the cmd ipconfig gave me ( Local area Connection ipv4 address)
-----------------
you also wrote
Create /etc/auto.smb.yourservername
Code:
username=yourusername
password=yourpassword
I've created /etc/auto.smb.GYULA-PC
and wrote the admin and pass i'm using for logging in at my main PC where the shares are
-------------------------
I've edited the sources.xml too
until now it looked like that :
Videos
/home/xbmc/Videos/
TV Shows
smb://GYULA-PC/TV Shows/
and after replacing smb://GYULA-PC to mnt/share it looks like that :
Videos
/home/xbmc/Videos/
TV Shows
mnt/share/TV Shows/
Where is the problem Dear Sir ?
Not sure - what can you see under /mnt/smb/ ?
ReplyDeleteYou might be best off taking this to the XBMC forum as I no longer use Live, I use openelec, which works differently (and much easier).