Xbox 360 Debian/Ubuntu Linux – Media (video, music) Streaming

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!

35 Comments

  1. miksuh
    Posted November 25, 2008 at 17:37 | Permalink

    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

  2. Posted November 25, 2008 at 18:10 | Permalink

    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.

  3. Josh
    Posted December 29, 2008 at 14:01 | Permalink

    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.

  4. Posted December 30, 2008 at 02:35 | Permalink

    @Josh: glad it helped, thanks for reading :)

  5. John
    Posted January 1, 2009 at 08:05 | Permalink

    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.

  6. Posted January 2, 2009 at 17:31 | Permalink

    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.

  7. Posted January 2, 2009 at 21:19 | Permalink

    @matt: Glad it helped. It’s the reason I posted it here.

    @John: are you running ushare daemon as root?

  8. Manny
    Posted January 6, 2009 at 09:21 | Permalink

    for some reason i get a permission denied error when trying to edit ushare.conf any suggestions?

  9. marc
    Posted January 6, 2009 at 19:36 | Permalink

    Nice, tried for Fedora 7, worked well. Installation on FC7 only required “yum install ushare”. Also needed to open firewall, then it was running.

  10. Posted January 7, 2009 at 00:10 | Permalink

    @Manny, are you editing it as root (or using sudo?). You need to be root as it’s owned by root and not yourself.

  11. laredo
    Posted January 8, 2009 at 09:22 | Permalink

    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 :/

  12. Posted January 8, 2009 at 13:35 | Permalink

    @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.

  13. Justin
    Posted January 10, 2009 at 18:33 | Permalink

    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. :)

  14. TraceRoute87
    Posted January 15, 2009 at 01:58 | Permalink

    Great little tutorial! Works like a charm. Thanks alot!

  15. james
    Posted January 21, 2009 at 19:05 | Permalink

    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

  16. Brad
    Posted January 22, 2009 at 06:05 | Permalink

    This works great. Thanks for the help!

  17. wisd0m
    Posted January 23, 2009 at 17:33 | Permalink

    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.

  18. Posted January 26, 2009 at 17:11 | Permalink

    @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.

  19. Jordan
    Posted February 1, 2009 at 00:11 | Permalink

    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!

  20. Posted February 2, 2009 at 13:30 | Permalink

    @Jordon: ignore lo, it’s just a loopback device. You need to configure ushare in /etc/ushare.conf to use the eth0 device.

  21. aeilos
    Posted February 8, 2009 at 18:40 | Permalink

    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

  22. Posted February 13, 2009 at 10:57 | Permalink

    Works like a charm!
    Thanks a lot dude.

  23. Posted February 19, 2009 at 16:41 | Permalink

    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?

  24. Posted February 19, 2009 at 18:35 | Permalink

    OK, only available for 8.04 upwards had to do a release upgrade for it.

  25. rchrd
    Posted February 21, 2009 at 03:36 | Permalink

    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…

  26. Posted February 24, 2009 at 00:18 | Permalink

    @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.

  27. Alex
    Posted February 24, 2009 at 14:18 | Permalink

    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 :)

  28. nathan
    Posted March 31, 2009 at 02:17 | Permalink

    Thanks a ton man
    USHARE_OPTIONS=-x, seemed to fix everything for me!

  29. sco
    Posted April 24, 2009 at 18:03 | Permalink

    Thanks! Worked like a charm!

  30. Matt
    Posted April 28, 2009 at 09:53 | Permalink

    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 :)

  31. Posted May 18, 2009 at 02:12 | Permalink

    awesome tool. had to refresh my root terminal skills but it works pretty well even with music!

  32. Mike
    Posted June 21, 2009 at 01:03 | Permalink

    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.

  33. vince
    Posted July 10, 2009 at 19:29 | Permalink

    Very nice, it’s work .

  34. Matthew
    Posted September 26, 2009 at 20:10 | Permalink

    Thanks, worked right out of the box per your instructions.

  35. patrick
    Posted December 14, 2009 at 03:43 | Permalink

    I configured ushare as described, and I still get “Interface eth0 is down.” Don’t understand why this is happening.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*