OpenVZ Forum


Home » General » Support » MediaTomb UPnP server
MediaTomb UPnP server [message #30647] Sat, 31 May 2008 15:00 Go to next message
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
There are known issues about running a media UPnP server on VEs?
My host system is a Debian Lenny with vzctl 3.0.22 and kernel 2.6.18. VE is also a Debian Lenny with mediatomb server 0.11. When I try to run mediatomb, I receive:
2008-05-31 16:52:36    INFO: Loading configuration from: /etc/mediatomb/config.xml
2008-05-31 16:52:36    INFO: Checking configuration...
2008-05-31 16:52:36    INFO: Setting filesystem import charset to UTF-8
2008-05-31 16:52:36    INFO: Setting metadata import charset to UTF-8
2008-05-31 16:52:36    INFO: Setting playlist charset to UTF-8
2008-05-31 16:52:36    INFO: Configuration check succeeded.
2008-05-31 16:52:36   ERROR: main: upnp error -117
2008-05-31 16:52:36   ERROR: upnp_cleanup: UpnpUnRegisterRootDevice failed
Re: MediaTomb UPnP server [message #30648 is a reply to message #30647] Sat, 31 May 2008 17:48 Go to previous messageGo to next message
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
Solved assigned a veth to the VE.
Re: MediaTomb UPnP server [message #30659 is a reply to message #30648] Mon, 02 June 2008 10:01 Go to previous messageGo to next message
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
Ok, Mediatomb starts... But I can't see UPnP contents outside the VE! VE is configured with a veth interface enbaled for multicast. Neither the host node can see the contents served by mediatomb. An installation of mediatomb on the host node works perfectly. I enabled multicast routing and everything necessary for UPnP, but it seems I'm missing something...
Re: MediaTomb UPnP server [message #36086 is a reply to message #30647] Wed, 20 May 2009 18:11 Go to previous messageGo to next message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
Hello,

I am picking up on an old thread here but I have the same issue. I am trying to establish a Upnp media server under OpenVZ. I have configured a veth device but I can't get multicasting to work. I am not a networking expert so would appreciate some advice to help me get Upnp working (I want to do this with MediaTomb and MythTV also).

Many thanks in advance for any help...
Re: MediaTomb UPnP server [message #36087 is a reply to message #36086] Wed, 20 May 2009 18:27 Go to previous messageGo to next message
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
I haven't found an answer, yet. So help is still appreciated!
Re: MediaTomb UPnP server [message #36403 is a reply to message #36087] Tue, 16 June 2009 09:18 Go to previous messageGo to next message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
I have this working. Laughing

You have to reconfigure your HE's network with a bridge. You give a veth device to the VE and call it eth0. You configure that eth0 on the VE via its /etc/network/interfaces file. When the VE starts you add its veth device on the host to the bridge. You can test the networking with a tool called "ssmping".

I am away from my test machines but I will write this up and post here and also try and find a suitable place on the Wiki for it.
Re: MediaTomb UPnP server [message #36851 is a reply to message #36403] Fri, 24 July 2009 02:38 Go to previous messageGo to next message
alby is currently offline  alby
Messages: 2
Registered: July 2009
Location: Melbourne, Australia
Junior Member
I setup the bridge and using ssmping seems to confirm everything is working but the ps3 cannot see the mediaserver on the lan. Any clues what I may be missing?
Re: MediaTomb UPnP server [message #36864 is a reply to message #36851] Fri, 24 July 2009 19:09 Go to previous messageGo to next message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
Hi, yes. sorry I've been away from the PC for a few days. I will try to write a few notes on this and post here over the weekend.
Re: MediaTomb UPnP server [message #36869 is a reply to message #36851] Sun, 26 July 2009 10:57 Go to previous messageGo to next message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
Here is how to set up veth networking woth OpenVZ. These notes relate to version 3.0.22 on Ubuntu 8.04 Hardy Heron.

The first thing you must do is create a network bridge on your host.

Install the Bridge Utilities

# apt-get install bridge-utils

Modify your network configuration file /etc/network/interfaces. Here is what mine looks like:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface (bridged configuration)
auto br0
iface br0 inet dhcp
bridge_ports eth0

Reboot, or re-start networking to invoke the new configuration
#/etc/init.d/networking restart

Check you have a bridge (use ifconfig) and that your network still works before proceeding.

Next, there are some config files and scripts needed to enhance openvz so it does the
required setup work to add/remove a vm from the bridge. There are three files:

/usr/sbin/vznetcfg
/usr/sbin/vznetaddbr
/etc/vz/vznet.conf

The first file, /usr/sbin/vznetcfg, already exists but causes a problem on ubuntu because the default shell (which
is actually "dash") does not support the "source" command. Change line 20...

from this:
[ -f "$VZNETCFG" ] && source "$VZNETCFG"

to this:
[ -f "$VZNETCFG" ] && . "$VZNETCFG"


The second file, /ust/sbin/vznetaddbr, is a new script that is invoked to do the bridge configuration:

#!/bin/sh
# /usr/sbin/vznetaddbr
# a script to add virtual network interfaces (veth's) in a CT to a bridge on CT0

CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`

if [ ! -n "$VZHOSTIF" ]; then
   echo "According to $CONFIGFILE CT$VEID has no veth interface configured."
   exit 0
fi

if [ ! -n "$VZHOSTBR" ]; then
   echo "According to $CONFIGFILE CT$VEID has no bridge interface configured."
   exit 1
fi

echo "Adding interface $VZHOSTIF to bridge $VZHOSTBR on CT0 for CT$VEID"
/sbin/ifconfig $VZHOSTIF 0
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding
/usr/sbin/brctl addif $VZHOSTBR $VZHOSTIF

exit 0

The third file, /etc/vz/vznet.conf, contains a reference to the second file and is used by the first file, which is invoked during bridge setup:

#!/bin/sh
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"


With those files in place, openvz should manage connecting your veth vps to your bridge. You just need to create the VPS and configure its networking. Here's how:

First, create the vps:
vzctl create 123 --ostemplate ubuntu-8.04-i386-minimal
vzctl set 123 --hostname vz123 --save


next, add the bridge to the vps configuration:
echo "CONFIG_CUSTOMIZED=\"yes\"" >> /etc/vz/conf/123.conf
echo "VZHOSTBR=\"${BRIDGE:-br0}\"" >> /etc/vz/conf/123.conf


and then add an eth0 device to it:
vzctl set 123 --netif_add eth0 --save


Now configure networking within the vps. This basically involves creating an appropriate /etc/network/interfaces file.

For DHCP addressing, create the /etc/network/interfaces file like this:
cat > /vz/private/123/etc/network/interfaces << EOF
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
EOF


For static addressing, create the /etc/network/interfaces file like this:
cat > /vz/private/123/etc/network/interfaces << EOF
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
    address 10.0.0.123
    netmask 255.0.0.0
    gateway 10.0.0.138
EOF


If we're doing static addressing (this is not required if using dhcp because dhcp takes care of it), create the /etc/resolv.conf file like this:
cat > /vz/private/123/etc/resolv.conf << EOF
search lan
nameserver 10.0.0.138
EOF


That's it! The VPS is now ready for use, so start it up:
vzctl start 123


You can test your setup works for multicast with a utility called ssmping. You need to install it on the VPS and also on another host (could be ct0 or a completely different machine on the network):

Install on the VPS (from the host):
cp /etc/apt/sources.list /vz/root/123/etc/apt
vzctl exec 123 apt-get update
vzctl exec 123 apt-get install ssmping


Install elsewhere:
apt-get install ssmping


To test, you run "ssmpingd" the vps and you run "ssmping" on another machine:

vzctl enter 123
ssmpingd


And on the other machine
ssmping 10.0.0.123


You should get output from ssmpingd:
root@vz123:/# ssmpingd
received request from 10.0.2.118
received request from 10.0.2.118
received request from 10.0.2.118
received request from 10.0.2.118
received request from 10.0.2.118



You should get output from ssmping:
john@tma1:~$ ssmping 10.0.0.123
ssmping joined (S,G) = (10.0.0.123,232.43.211.234)
pinging S from 10.0.2.118
  unicast from 10.0.0.123, seq=1 dist=0 time=5.609 ms
multicast from 10.0.0.123, seq=1 dist=0 time=5.621 ms
  unicast from 10.0.0.123, seq=2 dist=0 time=0.036 ms
multicast from 10.0.0.123, seq=2 dist=0 time=0.045 ms
  unicast from 10.0.0.123, seq=3 dist=0 time=0.023 ms
multicast from 10.0.0.123, seq=3 dist=0 time=0.030 ms
  unicast from 10.0.0.123, seq=4 dist=0 time=0.026 ms
multicast from 10.0.0.123, seq=4 dist=0 time=0.032 ms
  unicast from 10.0.0.123, seq=5 dist=0 time=0.025 ms
multicast from 10.0.0.123, seq=5 dist=0 time=0.033 ms

--- 10.0.0.123 ssmping statistics ---
5 packets transmitted, time 4592 ms
unicast:
   5 packets received, 0% packet loss
   rtt min/avg/max/std-dev = 0.023/1.143/5.609/2.233 ms
multicast:
   5 packets received, 0% packet loss since first mc packet (seq 1) recvd
   rtt min/avg/max/std-dev = 0.030/1.152/5.621/2.234 ms
john@tma1:~$ 

If you change the networking of an existing venet0 VPS you may need to remove old routes from the routing table because they conflict with the veth setup (this is not necessary on a clean VPS built according to the above instructions). This command will achieve that:

# complex command greps routes with venet in them and then removes them.
# IFS is used to delimit on line breaks instead of word breaks. Shell
# characters are escaped to avoid interpretation on the host.
vzctl exec 123 "IFS=\`echo -en \"\\n\\b\"\` && for r in \`ip route | grep venet0\`; do eval \"ip route del \$r\"; done"


With that all done, you should be able to install Mediatomb or Mythtv and see them on your PS3. I won't go in to the details of those apps as I expect you know that already. The key is to have the network set up correctly and I hope my notes go some way towards helping you achieve that Smile

The other thing is to make sure your PS3 has the latest firmware so that it supports Upnp, but I expect you have that already!

I have attached two example scripts containing the relevant commands.

[Updated on: Sun, 26 July 2009 11:03]

Report message to a moderator

Re: MediaTomb UPnP server [message #36876 is a reply to message #36869] Mon, 27 July 2009 04:38 Go to previous messageGo to next message
alby is currently offline  alby
Messages: 2
Registered: July 2009
Location: Melbourne, Australia
Junior Member
Many thanks for your detailed notes. I now have mediatomb running happily in a debian lenny container with the mediatomb deb from squeeze.
Re: MediaTomb UPnP server [message #43745 is a reply to message #30647] Thu, 13 October 2011 01:45 Go to previous messageGo to next message
Robberson is currently offline  Robberson
Messages: 1
Registered: October 2011
Junior Member
yesterday i spent several hours installing openvz with the result that it does not seem to run on my machine - a VIA EPIA V10000 running a VIA C3 at 1 GHz.
(As soon as i switched the system, a debian sarge base installation on an XFS file system) extended by Thorsten's debain packages for openvz to one of the ovz-kernels, the system became unstable: the ovz tools could not find their files although the configuration data was correct, even worse, after a "su - another_user" that User's shell could not access anything in its search path.)
Re: MediaTomb UPnP server [message #43766 is a reply to message #43745] Thu, 13 October 2011 13:56 Go to previous message
azagzin is currently offline  azagzin
Messages: 38
Registered: May 2008
Location: Vilnius
Member
Robberson wrote on Wed, 12 October 2011 21:45
yesterday i spent several hours installing openvz with the result that it does not seem to run on my machine - a VIA EPIA V10000 running a VIA C3 at 1 GHz.
(As soon as i switched the system, a debian sarge base installation on an XFS file system) extended by Thorsten's debain packages for openvz to one of the ovz-kernels, the system became unstable: the ovz tools could not find their files although the configuration data was correct, even worse, after a "su - another_user" that User's shell could not access anything in its search path.)

this is offtopic
Previous Topic: installing RHEL6 kernel
Next Topic: kernel panic with 2.6.32-042stab037.1
Goto Forum:
  


Current Time: Tue Nov 19 07:51:01 GMT 2024

Total time taken to generate the page: 0.03094 seconds