How to set up uShare media server on Fedora / CentOS to stream video and pictures to Xbox 360 or PS3 11

You don’t need a Windows Media Center PC to share pictures, videos, or music with an Xbox 360. If you’ve got a Fedora / RHEL/ CentOS box on your home network and you’d like to use it as a UPnP and DLNA Media Server so that you can stream files to your Xbox 360 or PS3, here are some easy-to-follow instructions on how to set it up.

This tutorial will walk you through installing and configuring uShare, a freeware app that will handle all the server-side stuff for you. According to the uShare site:

uShare is a UPnP A/V & DLNA Media Server. It implements the server component that provides UPnP media devices with information on available multimedia files. uShare uses the built-in http server of libupnp to stream the files to clients.

GeeXboX uShare is able to provide access to both images, videos, music or playlists files. It does not act as an UPnP Media Adaptor and thus, can’t transcode streams to fit the client requirements.

Before you start

Here’s what you need to do before you get started:

  1. You should have¬†SELinux disabled (Google “disable SELinux” if you don’t know how to check SELinux status or turn it off).
  2. If you’re using CentOS or RHEL, you need to have the EPEL Repository enabled on your system. Fedora users already have the proper repo (@fedora) enabled by default.
  3. Realize that these instructions were written and tested with RedHat-based distros (Fedora 14 and CentOS 5.5, to be exact). If you’re running Ubuntu or some other flavor of Linux, these instructions might work with slight modifications, but I have no way of testing or verifying. Please proceed at your own risk.

Install uShare

Installing uShare is as simple as:

yum install ushare

This will also install a number of dependencies, including libupnp, the portable Linux SDK for UPnP devices.

Create a Media Directory

If you already have a directory on your Linux box where you store media you’ll want to share, then you can skip this step. If you don’t have one, you’ll need to create one. I recommend using /usr/local/media. You can make this directory with:

mkdir /usr/local/media

Obviously, you’re going to want some media in there to test things out. I recommend a simple .JPG file or a small .WMV file (or you can check out the full list of Xbox 360 supported media formats).

Configure uShare

All the configuration options for uShare are in the /etc/ushare.conf file. Most of the default values are fine, but I’m a fan of hard-coded options, and I recommend the following settings:

# /etc/ushare.conf
# Configuration file for uShare

# uShare UPnP Friendly Name (default is 'uShare').

# Interface to listen to (default is eth0).
# Ex : USHARE_IFACE=eth1

# Port to listen to (default is random from IANA Dynamic Ports range)
# Ex : USHARE_PORT=49200

# Port to listen for Telnet connections

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2

# Use to override what happens when iconv fails to parse a file name.
# The default uShare behaviour is to not add the entry in the media list
# This option overrides that behaviour and adds the non-iconv'ed string into
# the media list, with the assumption that the renderer will be able to
# handle it. Devices like Noxon 2 have no problem with strings being passed
# as is. (Umlauts for all!)
# Options are TRUE/YES/1 for override and anything else for default behaviour

# Enable Web interface (yes/no)

# Enable Telnet control interface (yes/no)

# Use XboX 360 compatibility mode (yes/no)

# Use DLNA profile (yes/no)
# This is needed for PlayStation3 to work (among other devices)

On Line 5, you can choose whatever name you wish for your media server (but it can’t contain spaces).

On Line 21, you can share multiple directories by including their full path here and separating them with commas (or spaces).

On Line 40, for Xbox 360 compatibility, make sure USHARE_ENABLE_XBOX is set to “yes.”

On Line 44, for compatibility with PlayStation 3 and other DLNA-enabled devices, make sure USHARE_ENABLE_DLNA is set to “yes.” If you’re only going to connect to an Xbox 360, you can set this to “no.”

Enable uShare at Startup

Assuming you want uShare to fire up automatically when you boot your machine, do:

chkconfig --level 345 ushare on

Check your Firewall Settings

If you don’t have the Linux firewall (iptables) enabled, you can skip this step. But if you do, you’ll need to open up TCP port 49200 (which is the port you set up in the configuration file), and UDP port 1900 (for SSDP, the Simple Service Discovery Protocol).

Add these two ports to your firewall settings and then save the new firewall configuration with these three commands:

iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 49200 -j ACCEPT
iptables -A INPUT -m state --state NEW -m udp -p udp --dport 1900 -j ACCEPT
service iptables save

Start the uShare daemon

Now you’re ready to start up uShare and test things out. Do:

service ushare start

If you set everything up properly, you should get:

Starting ushare:                                           [  OK  ]

If it doesn’t start up properly, check the error message for a hint at what might have gone wrong, and verify that your /etc/ushare.conf settings match mine.

Testing things out

Fire up your game console and go to the video, picture, or audio sharing menu(s). The name you picked for your media server should be visible, and the media in your shared folders should be available to access.

If you can’t see your media server, the first troubleshooting step is to disable your firewall with:

service iptables stop

If sharing works with your firewall disabled, then you know uShare is working fine and you need to examine your firewall settings.

If it still doesn’t work after disabling your firewall, keep your firewall disabled while you edit your configuration settings (always do service ushare restart after changing any configuration files), then once you get it working you can re-enable your firewall and test again.

Happy sharing!