Being both a Linux and Xbox fan makes for an interesting time. One of the best features of the Xbox is its streaming from a PC on your LAN. There are various features that the Xbox provides for seamless media streaming (be it videos, music or pictures) but it’s not as straightforward as it may seem (at least from what I’ve seen from various searches).
Xbox media streaming uses the DNLA protocol to receive content from a peer on a network. Using ushare, you can setup streaming to your Xbox on any Linux machine quite easily. All that’s needed is libupnp2 (if you’re running Debian, you may have to install libupnp via the Ubuntu deb as only version 3 is available and the uShare package depends on it explicitly), a minor configuration change and a quick hack to the init script. All of which I’ll explain now.
Installation (for Debian Sid)
Note: for Ubuntu, you’ll just need to run ‘sudo apt-get install ushare’ in a shell. Then skip to the configuration section below.
uShare depends on libupnp2 and unfortunately only version 3 is available (at least in sid). Therefore, you’ll need to obtain a deb for version 2 (I got the Ubunutu equivalent from here and it works fine). Once you’ve downloaded a .deb for your architecture, fire up a shell (or ‘terminal’) and enter the following (filenames will differ depending on your arch):
sudo dpkg -i libupnp2_1.4.3-2_amd64.deb
Now that libupnp2 is installed, you’ll need to get a deb for uShare or alternatively (and best, because you’ll get updates via apt) is to add the uShare apt repository to your sources.list. Open /etc/apt/sources.list as root (using sudo):
sudo vi /etc/apt/sources.list
Now add the following line at the bottom of sources.list:
deb http://www.geexbox.org/debian/ unstable main
Save and close sources.list. Finally, update your package list:
sudo apt-get update
Now you’ll have uShare available via apt. To install it, run the following:
sudo apt-get install ushare
Configuration
Once finished, you’ll have uShare installed and ready for configuration. Out of the box, it won’t provide much apart from a daemon listening on a random port (defined as part of IANA Dynamic Ports range). You’ll need to edit /etc/ushare.conf to enable Xbox compatibility as well as define the standard port – 49200. Open /etc/ushare.conf as root and change the following lines:
USHARE_PORT=49200
USHARE_DIR=/path/to/your/media
ENABLE_XBOX=YES
Before these changes will take effect, you’ll need to restart ushare using its init script. However, an issue I’ve noticed is that the last line (‘ENABLE_XBOX=YES’) does not always work. So before we restart uShare, we’ll need to make a small change to the init script that resides under /etc/init.d/ to force Xbox compatibility:
sudo vi /etc/init.d/ushare
and add the following line at the beginning of the script:
USHARE_OPTIONS=-x
This tells uShare to start with Xbox compatibility. Now restart uShare using the init script:
invoke-rc.d ushare restart
And you’re done. Almost. :) You may need to restart your Xbox for it to recognise your Linux machine (although the use of UPnP – Universal Plug ‘n’ Play – would suggest otherwise). Once you’ve done that (or if you’re brave), navigate to ‘My Xbox’ and then select ‘Videos’ and finally you should see ‘uShare’ at the bottom (computer icon). Selecting that will connect to your Linux box and you’ll be able to browse your media just as you would on your PC. Awesome!
39 Comments
If you use Debian Lenny then you probably want to use mediatomb or gmediaserver UPnP mediaservers instead of ushare.
This is how you can install those, you need just one of those:
# apt-get install mediatomb
# apt-get intsall gmediaserver
miksuh: I wasn’t aware of either of those tools. Searching the web proved to be difficult because there was so much bloat in the results. Very helpful, thanks for posting.
Works perfectly! I trued twonky and had no look. The steps were simple and straightforward which I appreciate because I am still new to linux. Thank you for your post.
@Josh: glad it helped, thanks for reading :)
I can’t seem to get it to work. Seems to start up fine, but my xbox can’t see it. Get the “Interface wlan0 is down.
Recheck uShare’s configuration and try again !”, but ifconfig says otherwise.
I seriously have been trying to do this for a week. I finally got down to your entry in the Google results. Thank you! It’s the first one that worked. Why I don’t know, but probably the magic -x in the config file.
Cheers.
@matt: Glad it helped. It’s the reason I posted it here.
@John: are you running ushare daemon as root?
for some reason i get a permission denied error when trying to edit ushare.conf any suggestions?
Nice, tried for Fedora 7, worked well. Installation on FC7 only required “yum install ushare”. Also needed to open firewall, then it was running.
@Manny, are you editing it as root (or using sudo?). You need to be root as it’s owned by root and not yourself.
Nice guide atc. I cant see to get it to work on my ubuntu. I get this error:
“Interface eth0 is down.
Recheck uShare’s configuration and try again !
ioctl: Cannot assign requested address
”
Not sure what i have done wrong :/
@laredo: You must map the interface in ushare’s configuration file for it to communicate with the network. Is eth0 the interface that you’re connected to the network with? run ‘ifconfig’ in a shell and see what interfaces it lists. Find one with an assigned IP address (assuming you’ve got only one NIC associated with the network) and set that in /etc/ushare.conf.
Hey there,
I have been struggling with uShare and ubuntu 8.10 for a little while now, and at this very moment, it if start my xbox 360 up and browse to media, it takes a few minutes to recognize my ushare server. It can see it but when I try to connect, it times out and gives me a firewall suggestion. I tried adding the option to force xbox support but nothing. Is this common?
Any help much appreciated!
Thank you. :)
Great little tutorial! Works like a charm. Thanks alot!
i am very new to ubunto and have followed the instructions through but i cannot seem to edit the script please can i have more detail on this thanks
This works great. Thanks for the help!
This worked right away. I can see all of my videos. The only issue is that ushare only sees the first folder I add in the config file. I have it as: “USHARE_DIR=/home/me/Desktop/Media,/home/me/Music,/home/me/Pictures”. I tired separating the dirs with spaces, but that made ushare not read anything. I also tried “/home/me” to see if it would find the files, did not work. Any Ideas in getting my xbox to see my music and pics? Thanks for this great guide.
@wisd0m: Thanks for reading.
I’ve noticed that ushare can be quite temperamental with regards to music files. I think it also has something to do with how you view them in the xbox menus.
I’ve often seen it not listing music at all, or videos, in which case I’ve just restarted ushare then restarted my xbox.
i feel like i am so close! i have 2 NICs associated with my network eth0 and lo. when i try and start ushare neither of them work!
@Jordon: ignore lo, it’s just a loopback device. You need to configure ushare in /etc/ushare.conf to use the eth0 device.
I configured as above, and set USHARE_IFACE=wlan0, which is the right NIC, but ushare still tells me that “Interface wlan0 is down.” Not sure where to go from here
Works like a charm!
Thanks a lot dude.
I just can’t get this installed for some reason. Ubuntu 7.10 – doesn’t show up for apt by default, adding in the geexbox repo to the sources.list results in a 404.
Any ideas?
OK, only available for 8.04 upwards had to do a release upgrade for it.
Great tutorial, this is the best I’ve seen yet, though I’m still having a little trouble. I’ve gotten far enough that the xbox sees ushare but when I try to connect to it it fails and suggests that its behind a firewall which I’m pretty sure I’m not running. I’m wondering if anyone else has encountered this problem and solved it…
@rchrd: I’ve not had that issue – have you tried restarting the xbox after ushare’s started on your linux machine? Sometimes the two don’t work very well together from what I’ve seen – a restart of the xbox gets things back in order.
I’ve used this for quite some time to watch videos, which worked like a charm… I never got music to work properly though, it always just showed a huge list of songs, without recognizing artists, albums, etc….
Finally back to having a proper MythTV machine with MPD installed now :)
Thanks a ton man
USHARE_OPTIONS=-x, seemed to fix everything for me!
Thanks! Worked like a charm!
Thanks for sharing this. I’ve been a big fan of linux for a long time, but the only reason I don’t have it installed is because I could not (or at least thought I couldn’t) stream media to the 360.
This article will make go to a full blown linux OS on my pc.
Cheers :)
awesome tool. had to refresh my root terminal skills but it works pretty well even with music!
I get to the point that I try to start ushare by
“invoke-rc.d ushare start”, and get the following response:
.: 369: 3: Too many open files
invoke-rc.d: initscript ushare, action “start” failed.
I just haven’t been able to figure out how to begin debugging it.
Very nice, it’s work .
Thanks, worked right out of the box per your instructions.
I configured ushare as described, and I still get “Interface eth0 is down.” Don’t understand why this is happening.
I am unable to have my 360 see the videos in my directories. Also, when I add additional mount points, I continually get permissions errors. I double checked and all the drives have the same permissions. Any help is greatly appreciated. Thank you.
Hmm…. after restarting the ushare, it says that “no shares available”, even thought the folder it is pointing to, is full of videos. I am confused.
Perfect directions. A few variable names have changed with the current package (1.1a-0ubuntu5), but regardless the setup went easily and worked right away for my Xbox, thanks to your tips! Cheers.
This method no longer works as the ushare dev removed the debian repo:
http://hg.geexbox.org/ushare/rev/65cdfa92a3f0
Post a Comment