Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Networking

Sharing Videos from Linux to Xbox 360

Submitted by on December 19, 2008 – 8:49 pm 3 Comments

Xbox 360 uses UPnP protocol to stream multimedia files from computers on your home network. Normally, you would have a Windows PC running WMP and sharing files. But what if you have a Linux box instead? There are several applications capable of sharing videos and music from your Linux computer to Xbox 360, as well as to PS3 and any other device using UPnP. Sometimes these applications may be tricky to configure. Here are instructions for installing UShare. The installation was performed on Ubuntu 8.10 but the same or a similar process would apply to most other Linux flavors.

If you are not logged in as root, prepend each command with “sudo”.

Update list of sources for apt-get:

echo "deb http://www.geexbox.org/debian/ unstable main" >> /etc/apt/sources.list

Install Mercurial, Korn shell and some other stuff:

apt-get install mercurial ksh chkconfig

Get Ushare repository info:

hg clone http://hg.geexbox.org/ushare

Edit Ushare configuration file:

vi /etc/ushare.conf

Make sure the file contains the following entries:

# /etc/ushare.conf
# Edit this file with 'dpkg-reconfigure ushare'
# Configuration file for uShare

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

# 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=

# 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=/path/to/your/videos

# 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=

The ushare startup script has some problems, so here is a simple but working replacement. Put it in /etc/init.d/ushare, overwriting the existing file:

#!/bin/ksh

USHARE=/usr/bin/ushare
FLAGS="-x -D -f"
CONF=/etc/ushare.conf

message() {
        if [ $? -eq 0 ]
        then
                echo "Done"
        else
                echo "Failed"
        fi
}

usharecheck() {
        USHAREP=$(ps -ef | grep $USHARE | grep -v grep | wc -l)
}

usharestart() {
        usharecheck
        if [ $USHAREP -eq 0 ]
        then
                $USHARE $FLAGS $CONF
                message
        else
                echo "Ushare is already running. Use 'restart' instead."
        fi
}

usharestop() {
        usharecheck
        if [ $USHAREP -gt 0 ]
        then
                ps -ef | grep $USHARE | grep -v grep | awk '{print $2}' | while read PID
                do
                        kill -9 $PID
                done
        fi
}

case "$1" in
        start)          usharestart
                        ;;
        stop)           usharestop
                        ;;
        restart)        usharestop
                        usharestart
                        ;;
        status)         usharecheck
                        if [ $USHAREP -gt 0 ]
                        then
                                echo "Ushare is running"
                        else
                                echo "Ushare is not running"
                        fi
                        ;;
        *)              exit 1
esac

Let’s make sure all permissions are good:

chmod 755 /etc/init.d/ushare
chmod 644 /etc/ushare.conf

Check to make sure ushare will start up when system reboots:

chkconfig -l ushare

Now run “/etc/init.d/ushare restart” and fire up your Xbox. Go to “My Xbox” -> “Video Library” and whatever you specified in ushare.conf as “USHARE_NAME” should now appear in Xbox selection video sources.

Print Friendly, PDF & Email

3 Comments »

  • evil chevy says:

    OK i basically hate window. i hav 3yrs old laptop and i think its time 4 CHANGE!
    New vista is piece of crap imao and xp is fine but window gets so much bad stuff like viruses and melware
    SO! i decided to get apple.
    im a student so i do pretty much common student stuff like listening to music, writing papers, making powerpoints, etc…
    i DO NOT play games cuz i play xbox 360
    AND i watch TONS of movies/tv shows online like every freakin single day. So i assume that they are downloading right? (95% legal haha)

    anyway, should i get macbook or MBP?
    I heard both of them are fast but i want smooth and longlasting laptop that i can use 4 long long long time. (i would really luv to hav 15′ instead of 13′ btw
    or…..pc?
    cuz pc is way cheaper than macs (but…viruses…!)

  • Matthew S says:

    I want to be able to store alot of MP3 , movies and photos and have them accessible by all computers on the network.

    I want to be able to view the videos and movies on an HDTV

    Id like to know if there is a wireless solution to being able to play the music through out the house in different rooms.

    Id finnally like to be able to connect some security cameras to the network and have them recorded to the network storage device and be able to be accessed remotely on the internet.
    so i looked at the sonos player which is nice but seems limited ..

  • Beavis says:

    say like a ps3, psp, itouch, or something alike ……
    im not exactly sure how virus’s work but dont they attach themselves to programs, then duplicate?
    so no programs = no host
    or what about macro viruses? could this affect your hard drive … like videos, pics, ect …..
    so say if you downloaded a virus, would’nt it only affect the designated operating systems, and having no o.s, then would’nt you be safe?
    what if you had linux for ps3 or a xbox 360? cause 360’s run off of a special windows o.s? are these consoles now vunerable?
    just curious
    best answer gets 10p
    thanks for your help

Leave a Reply

%d bloggers like this: