Using UShare to connect CentOS server to XBOX 360

Connecting your CentOS server to Xbox 360 to play videos through your TV is fairly easy, it just requires installing uShare,  a piece of software that makes your server recognisable as a uPNP  device to the Xbox.  This guidewas written with CentOS 5.3 and the latest "Jasper" spec Xbox,  (manufacture date late 2009), with the latest xbox updates installed.  

Step 1: Install uShare using yum

Make sure you have the RPMForge/DAG repos installed as per my previous twoposts. Once you've done this, uShare can be easily installed by typing: yum install ushare

If you are having problems with yum getting confused by packages like I am, then you'll need to type this: yum --enablerepo=rpmforge install ushare

Yum should then install uShare and any dependencies required.  

Step 2: Configuring uShare

You'll need to edit the uShare configuration file to get your server correctly recognised as a uPNP server, so type: nano /etc/ushare.conf

This will bring up the file to edit, I have edited mine as below, but it's all fairly self explanatory:

# /etc/ushare.conf 
# Configuration file for uShare 
# uShare UPnP Friendly Name (default is 'uShare'). 
USHARE_NAME=uShare 
# Interface to listen to (default is eth0). # Ex : USHARE_IFACE=eth1
USHARE_IFACE=eth0 
# Port to listen to (default is random from IANA Dynamic Ports range) # Ex : USHARE_PORT=49200 
USHARE_PORT=49200 
# Port to listen for Telnet connections # Ex : USHARE_TELNET_PORT=1337 
USHARE_TELNET_PORT= 
# Directories to be shared (space or CSV list). 
# Ex: USHARE_DIR=/dir1,/dir2 
USHARE_DIR=/media 
# 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 USHARE_OVERRIDE_ICONV_ERR= 
# Enable Web interface (yes/no) 
ENABLE_WEB=yes 
# Enable Telnet control interface (yes/no) 
ENABLE_TELNET= 
# Use XboX 360 compatibility mode (yes/no) 
ENABLE_XBOX=yes 
# Use DLNA profile (yes/no) 
# This is needed for PlayStation3 to work (among other devices) 
ENABLE_DLNA=yes

I've enabled DLNA, not sure if I need to, but it's working on my xBOX so it may need to be installed.  

Step 3: Editing /etc/init.d/ushare

For a lot of people, the steps above apparently worked, but maybe CentOS  is different... To get uShare to work correctly in XBOX compliant mode I  needed to edit the /etc/init.d/ushare file to force it to start in the  correct mode. To do this, open the file by typing at the terminal: nano /etc/init.d/ushare

Next I had to add the -x flag to the OPTIONS part near the top of the file; here is the top of the file:

#!/bin/bash  
#  
# Init file for uShare UPnP Media Server  
#  
# Written by Dag Wieers <[email protected]>  
#  
# chkconfig: - 54 46  
# description: uShare UPnP Media Server  
#
# processname: ushare  
# config: /etc/ushare.conf  
# pidfile: /var/run/ushare  
source /etc/rc.d/init.d/functions  OPTIONS="-x"  [ -x /usr/bin/ushare ] || exit 1  [ -r "/etc/ushare.conf" ] && source /etc/ushare.conf  [ -z "$USHARE_DIR" ] && exit 0

Note the line I have modified to read OPTIONS="-x", that is the only  part of the file I have changed (the rest of the file is intact but not  quoted).  

Step 4:  Start uShare and connect the XBOX

Finally, uShare must be started by typing /sbin/service ushare start

If you want to have uShare starting every time you restart your server  then either find a command line way of doing it, or go through the GUI -  System>Server Settings>Services. Then tick ushare and save the  settings.  You may also need to restart your httpd server if you enabled web  access, (the web access is actually not really very helpful though tbh),  this is then accessable by going to  *serveraddress*:*portnumber*/web/ushare.html. (Obviously put your own  server address and the port number you set earlier in). Firewall ports  may also need to be opened for those you set up in the ushare.conf file.  

On the XBOX, the computer may just appear under the Video/Music/Photo  library tabs in 'My Xbox'. If it doesn't, then go to My Xbox>System  Settings>Network Connections>Test PC connection and the PC should  appear after a search. If it doesn't, check you have start the ushare  service and opened all relevant firewall ports.  The XBOX then, for me, required me to download a ~5MB file to enable  video files to be played, then it all worked fine.

Limitations: The xBox only seems to display the first 1000 songs in my collection,  and also seems to have problems with photos in the 'Photo Library' tab.  However, in Video library all videos are listed as well as the photos...  

References: