Creating a Linux Terminal Media Server for Your Home PC’s 03/14/08

Freevo on LTSPIt seems we always need to update our PC hardware at one point or another, to keep abreast of the increasing demands that current software makes of our computers. If like me, you hate to lose the use of older PC’s, you may store them away for “later” projects.

When I was a heavier Windows user, I often had the experience of using Terminal server connections via diskless workstations. At that time, one of the touted benefits was the ability to revive and use obsolete computers because the processing and applications were run on the Terminal Server, not the workstation. I’ve been contemplating trying to afford the addition of another workstation to use as a media centre. I’d been hemming and hawing about the cost of a new PC for this as the funds are just not there, until it occurred to me that I could use a couple of the older units for this purpose; connected to a Linux Terminal Media Server.

What exactly am I accomplishing in this post? Creating a rough guide showing how to set up a centralized Media Terminal Server that allows connecting computers to function as “thin” Media clients. The following is the basics of how I got it to work, hopefully some of you can provide better ways or improved steps to enhance this guide. Please keep in mind that some of the configuration on your systems might be different to mine (file paths and network configuration for example). This is the basics of what worked for me, so I hope this one helps you as well as gives you something to build upon!

Here’s the scenario…

When setting up the “main computer”, I want to be able to make changes or install other things and not break the media terminal server, so I’ll do the installation in VMWare, which is already installed now. (More information bout VMware here: http://www.vmware.com/). Also, I wanted the Media Centre’s (maybe one upstairs and the other downstairs?) to use Freevo (About Freevo here: http://freevo.sourceforge.net/). One of my friends uses Freevo so I thought it would be a bit different from MythTV which I seem too read almost daily about :) And because he had Freevo working, I just had to do it too. ;) To the point: I wanted older PC’s to function as media stations.

I wanted this on a separate subnet so that I would not have to change around any of the existing network configuration. This was pretty easy to do, just plug a second hand router into the network. Plug the WAN port of that router (it was an old SMC) into one of the LAN ports of the router connected to the Internet (via the broadband modem). On that second hand SMC router, disable DHCP (you’ll find out later). I ran one Cat5 cable upstairs and left another downstairs. And the server got plugged into one of the LAN ports of the SMC router (those 2 extra cables got plugged into the other LAN ports of the SMC router as well).

I needed the following…

The “main” PC with a version of Ubuntu Feisty installed in Vmware.
Wireless keyboard/mouse, so users can surf the web, email, chat, etc. (Which is cheaper than a whole computers).
Google, for research as to packages needed, etc. (mencoder, freevo, codecs, tvtime and other packages).

Google found me some good resources listed below (you will find lots more):

Linux Terminal Server Project
45 Minutes to a Linux Terminal Server
UbuntuLTSP

Steps to get this working…

Open a terminal in Feisty (in vmware), update apt and install the needed packages:

sudo su
apt-get update
apt-get install openssh-server
apt-get install ltsp-server-standalone ltsp-utils student-control-panel ltsp-build-client ltsp-update-sshkeys

We need to configure DHCP. Remember up above when I said disable it on the router? If not, then there’s a 50/50 chance your thin clients will obtain DHCP leases from the wrong device (the wrong device being the router, they need to get the connection from the Terminal Server).

Create a backup in case of mistakes (you can go back to the original):

cp /etc/ltsp/dhcpd.conf /etc/ltsp/dhcpd.conf.bak

I need to configure the correct information (your IP addresses may be different:

The gateway for access: 192.168.1.1
The media terminal server: 192.168.1.2
My private “special” thin client (downstairs): 192.168.1.3
The address range given to other clients: 192.168.1.50 – 192.168.1.55 (only 2 will ever be used but I added extra just in case of some weird DHCP lease problem).

Configure DHCP:

nano /etc/ltsp/dhcpd.conf

authoritative;
default-lease-time 7200;
max-lease-time 7200;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.55;
option domain-name “media.int”;
option domain-name-servers 192.168.1.2;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;

filename “/ltsp/pxelinux.0″;
option root-path “di″;
}

group {
use-host-decl-names on;
option log-servers 192.168.1.2;

host rogerbox {
hardware ethernet 00:13:D4:4E:86:93;
fixed-address 192.168.1.100;
}
}

Exit the terminal and reboot the terminal server.

Now we need to make sure the thin client gets set up properly…

sudo nano /opt/ltsp/i386/etc/lts.conf

Side note: Always make backups first. I learned that the hard way. ;)

[Default]
SERVER = 192.168.1.2
SOUND = Y
SOUND_DAEMON = esd
VOLUME = 80
LOCAL_DEVICE_01 = /dev/hdb:cdrom
LOCAL_DEVICE_02 = /dev/sda:usb
LOCAL_DEVICE_03 = /dev/fd0:floppy

Some other directives I came across that are helpful with thin clients are:

X_MOUSE_DEVICE = /dev/input/mice
PRINTER_0_DEVICE =/dev/lp0
PRINTER_0_TYPE =P

However, these are things I don’t need to worry about here. See here for more research: http://ubuntuforums.org/showthread.php?t=368869 and here: http://www.skolelinux.org/~klaus/sarge/x2700.html

Now let’s update/upgrade and get freevo and the other packages for the thin clients…

We are going to chroot spacerthe image the one we installed in vmware. What is chroot some of you may ask?

The chroot command ‘changes the root’ to another location. Why would you want to do that? One of the more popular reasons is to create a sandbox for either an application or a user. Once a new root is declared via chroot, any references that a user or application makes to ‘/’ will resolve to the new directory. This is a pretty effective way to restrict access to the real root and therefore the real file system. In fact, sometimes that act of chrooting is referred to a jailing or a chrooted shell is referred to as a jail shell.” Read more here: http://www.newlinuxuser.com/explain-what-is-chroot/

sudo chroot /opt/ltsp/i386
apt-get update
apt-get dist-upgrade

Let’s grab some packages (you can also include others that you want):

sudo apt-get install freevo mencoder tvtime xine-ui w32codecs ubuntu-restricted-extras libdvdcss2 libdvdcss libxine-extracodecs libjpeg-progs exiftran vlc vlc-plugin-esd mozilla-plugin-vlc lame flac cdparanoia amarok

Side note: If you’re interested in multimedia, you might enjoy this post: How to Play Most Restricted Media Formats in Ubuntu.
Also, if you really prefer MythTV, then remove from the above command: freevo
and add: mythtv mythtv-themes

Freevo related:

freevo setup
freevo plugins -a

At this stage, it’s really up to you how you’d like to configure Freevo. I found the site (Freevo) immensely helpful. The homepage is here: http://doc.freevo.org/Index. If you prefer to boot directly into Freevo when powering up then this page will be for you: Boot directly into Freevo. And a blurb from the Freevo site:

From a developers point of view – unlike other projects Freevo tries to reuse existing other applications such as mplayer, xine and gstreamer for this task. The new API is designed to be very flexible, splitting the logic into several independent modules that can also be used by other projects. It contains a subproject kaa with the different modules and the GeeXboX project has joined the Freevo team to create a Live-CD based on Freevo 2.0.

For those of you who really prefer MythTV, a good starting point is: MythTV Ubuntu Installation Guide

Do you love to share?


You can leave a response, or trackback from your own site.

One Responses to this article

 
Shahid July 2, 2011 Reply

When I was a heavier Windows user, I often had the experience of using Terminal server connections via diskless workstations. At that time, one of the touted benefits was the ability to revive and use obsolete computers because the processing and applications were run on the Terminal Server, not the workstation. I’ve been contemplating trying to afford the addition of another workstation to use as a media centre. I’d been hemming and hawing about the cost of a new PC for this as the funds are just not there, until it occurred to me that I could use a couple of the older units for this purpose; connected to a Linux Terminal Media Server. Read more at Ubuntu Linux Help

Leave a Reply

close comment popup

Leave A Reply