Installing MediaTomb on Ubuntu Server 10.04 to stream to DirecTV
So I’ve wanted to build a media machine for quite some time now but just haven’t had the resources to build the one that I really want. I tried XBMC on the hardware that I have laying around the house but it just couldn’t run well at all. I think XBMC uses way more video resources than I have on any of my extra PCs.
After much trial and error, I’ve finally settled on installing MediaTomb on an old P4, 1.6GHz computer with 786M of RAM, running Ubuntu Server 10.04 because it’s extremely lightweight while still being remotely accessible. I’ll be using MediaTomb to stream audio and video to my DirecTV HR22 satellite receiver but you can use it to stream to many different devices. Just check out MediaTomb’s device list for more information.
OK, let’s get started with our installation.
1. Download Ubuntu Server. Of course, burn it to CD or DVD with your favorite burner or put it on a USB stick. I like to use uNetBootin to build my USB sticks but, as an FYI, I’ve found that some computers are very picky about what type of USB stick they’ll boot from (no idea why, yet).
2. Install Ubuntu Server
a. When it asks for a name during the installation, make sure to give it something that will easily identify it as your media server, especially if you have quite a few computers on your network. You might find it easily now but, in my experience, if it’s not easy to find when you install five more computers next year, then you didn’t name it well.
b. When it asks is you would like to install any software, install only OpenSSH Server. This will allow you to remotely log into it later, especially if this computer will set somewhere that it won’t be connected to a keyboard and monitor.
3. Post Ubuntu Server installation cleanup. Now that you have a working Ubuntu server, verified by logging in after the post-installation reboot, let’s do some cleanup before installing MediaTomb.
a. First, let’s secure your ssh service. If you’re familiar with SSH, then go ahead and set in place whatever security measures you’re comfortable with but, if you’re not familiar with ssh, then please, at the very least, add AllowUsers yourusername to the end of /etc/ssh/sshd_config. Of yourse, replace yourusername with the actual username that you created when you installed Ubuntu server.
b. Next, let’s go ahead and update your Ubuntu server with the most recent software updates. To do that, enter sudo apt-get update at the prompt and the package manager will pull down the list of most recent updates of available software from the repository.
c. After that’s complete, enter sudo apt-get upgrade to actually install the updates. This will probably take a few minutes since the software on the CDs is usually older than what’s currently available.
d. After that’s complete, reboot the system with a sudo shutdown -r now.
4. Install MediaTomb
a. At the command prompt, enter sudo apt-get install mediatomb vlc imagemagick vsftpd ffmpeg. You may find many directions on the internet that have you doing all types of downloading and compiling but, with the most recent versions of Ubuntu, the repositories carry all of the needed dependencies for MediaTomb to install from this simple command line. You probably noticed that we’re installing VLC and ImageMagick, too, right? That’s because VLC does the on-the-fly transcoding as MediaTomb is streaming the video to your device and ImageMagick rescales your photos for viewing.
5. Configure MediaTomb
a. I’ll assume at this point that you’ll want to run this as a headless system so MediaTomb will start on its own after any reboots. To do that, you’ll need to edit the config.xml file in /etc/mediatomb, of course, making a copy of the original first, in case anything happens.
b. There are many areas that can be changed in the config.xml file to adapt MediaTomb to your needs. I’m not going to post them all here but I will provide a link to the Wiki that contains the most popular edits – http://mediatomb.cc/dokuwiki/transcoding:transcoding. Personally, the only thing that I changed for use with my DirecTV box was my MediaTomb server <name>.
c. Restart MediaTomb, after making your config.xml changes, with sudo service mediatomb restart.
d. Make sure it all works by going to http://localhost:49152 in your browser. If that doesn’t work, take a look at the MediaTomb log file at /var/log/mediatomb.log and verifiy that 49152 is the correct port for your current session.
6. Add your folders to MediaTomb
This may, or may not, be necessary depending on your configuration. I found that many of my media files were automagically found. However, it didn’t scan the second drive, so using the browser, I told MediaTomb to scan that drive automatically, twice a day, for new media.
And, voila! You now have your very own media server to serve up music, photos and movies to your hearts content!