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:

01# /etc/ushare.conf
02# Configuration file for uShare
03
04# uShare UPnP Friendly Name (default is 'uShare').
05USHARE_NAME=MyServer
06
07# Interface to listen to (default is eth0).
08# Ex : USHARE_IFACE=eth1
09USHARE_IFACE=eth2
10
11# Port to listen to (default is random from IANA Dynamic Ports range)
12# Ex : USHARE_PORT=49200
13USHARE_PORT=49200
14
15# Port to listen for Telnet connections
16# Ex : USHARE_TELNET_PORT=1337
17USHARE_TELNET_PORT=
18
19# Directories to be shared (space or CSV list).
20# Ex: USHARE_DIR=/dir1,/dir2
21USHARE_DIR=/usr/local/media
22
23# Use to override what happens when iconv fails to parse a file name.
24# The default uShare behaviour is to not add the entry in the media list
25# This option overrides that behaviour and adds the non-iconv'ed string into
26# the media list, with the assumption that the renderer will be able to
27# handle it. Devices like Noxon 2 have no problem with strings being passed
28# as is. (Umlauts for all!)
29#
30# Options are TRUE/YES/1 for override and anything else for default behaviour
31USHARE_OVERRIDE_ICONV_ERR=
32
33# Enable Web interface (yes/no)
34USHARE_ENABLE_WEB=no
35
36# Enable Telnet control interface (yes/no)
37USHARE_ENABLE_TELNET=no
38
39# Use XboX 360 compatibility mode (yes/no)
40USHARE_ENABLE_XBOX=yes
41
42# Use DLNA profile (yes/no)
43# This is needed for PlayStation3 to work (among other devices)
44USHARE_ENABLE_DLNA=yes

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.