DVArchive Installation

Introduction
The purpose of this project is to have a place to archive TV shows recorded via ReplayTV and still be able to access them by browsing to the Kurobox from any ReplayTV on your LAN. I personally have this running on my LAN and it works flawlessly! Keep in mind, you will need at least an HG model for this to work reliably. A standard Kurobox will work with very mixed results.

The following set of instructions is assuming you will be starting from scratch on a Kurobox…let’s get started!

Install Debian

 * Follow steps spelled out here


 * Use the latest Kurobox Debian image from here (Be sure to select the correct download for your Kurobox [HG vs non-HG])

Install FTP
After Debian is installed it’s a good idea to install an ftp server. The Kurobox must have internet access at this time in order to install.


 * Switch to root
 * 1) su root
 * Install proftpd
 * 1) apt-get install proftpd
 * When asked if this should be in inetd mode or standalone mode, select inetd mode if there isn’t going to be a lot of ftp traffic.
 * Verify you can log into the Kurobox via FTP.

Install Key Packages
This will install some of the basic things to assist in making life a little easier when dealing with Debian.


 * Install Key Packages which can be found here

Install Java (1.4.2 or 1.5)
Java is needed in order for DVArchive to run. DVArchive 3.2 now supports Java 1.5. For those that are wondering if there are any benefits of 1.5 over 1.4.2 Java for DVArchive, this is what I was told.

"I don't think there is any specific Java 1.5 stuff coded in by gerry.

However you should benefit from the newer release of java through it's newer VM code. I've noticed my linux based servers respond faster through my replaytv menus since changing to java 1.5"


 * Java 1.4.2 installation
 * Be sure to do the “mkdir opt” step in step 4 or else you will get errors.


 * Java 1.5 installation (Debian) or click here for Fedora

Install VNC
Installing this piece will give DVArchive a virtual frame buffer or “fake” screen which makes it think it’s running on a normal screen without actual video hardware.


 * VNC installation

The instructions talks about using ssh. I personally didn’t do step 8. Just wanted to get it running first and then if I need to can do that step later.


 * VNC viewer, I use TightVNC which seems to work well. To run the viewer (if using OS X), go to the shell prompt and type “java VncViewer HOST  PORT 5901”.  (Launch this from where VNCViewer.jar is located)

Install DVArchive

 * Download DVArchive


 * Copy the zip file to a folder called “dvarchive” in /home/ (or where ever you wish) and then unzip.

Script Files Needed

 * Create a text file called “startVNC-DVA” in whichever directory you wish. (I use the / directory).


 * 1) vi startVNC-DVA


 * startVNC-DVA should look like this:

. /etc/profile >/dev/null 2>&1 cd /root rm -f /tmp/.X11-unix/X* /tmp/.X1-lock export VNCDISPLAY=":1" echo "********* Start DVArchive/VNC @ `date` **********" >/tmp/vnc_dva.log nohup vncserver ${VNCDISPLAY} >/tmp/vnc_dva.log 2>&1 &
 * 1) !/bin/sh
 * 1) Clean up crashed VNC


 * Save it and make this file executable.


 * 1) chmod +x startVNC-DVA

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & (cd /home/dvarchive ; ./startDVA ) & x-window-manager &
 * Now open $HOME/.vnc/xstartup in vi and adjust it so it look like this:
 * 1) !/bin/sh


 * Create “startDVA” in /home/dvarchive/ (cd /home/dvarchive then vi startDVA)


 * 1) cd /home/dvarchive
 * 2) vi startDVA


 * It should look like this:

/usr/bin/java –Xmx64m ./DVArchive.jar --store /home/dvarchive/DVArchive.xml $* >/tmp/dva_server.log 2>&1
 * 1) !/bin/sh

The flag –Xmx64m tells it Java the maximum memory heap size to be used for DVArchive. The default is 31mb and is bit low. 64mb seems to work without DVArchive complaining about low memory.

Like the first startVNC-DVA file, make this executable as well
 * 1) chmod +x startDVA


 * Now we need to create a startup file (or rc.local) equivalent. Create a file called “local” in the /etc/init.d directory.
 * 1) cd /etc/init.d
 * 2) vi local


 * It should look like this:

/sbin/ifconfig eth0:1 192.168.11.151 /sbin/route add host 192.168.11.151 dev eth0:1 This is creating another network interface on eth0. Why? Well, DVArchive needs to use port 80 and port 80 is being used on the Kurobox. So we assign another IP to eth0 (192.168.11.151 or any other open IP) and will assign DVArchive to use it since port 80 will be open for this new IP. In essence, the Kurobox will have 2 IP’s being used. Eth0 for all things Kuro and eth0:1 will be used specially for DVArchive purposes.
 * 1) !/bin/sh


 * After saving the file "local" make it executable


 * 1) chmod +x local


 * Now we need to link up the newly created local file


 * 1) update-rc.d local defaults 80


 * Reboot the Kurobox for the new interface (eth0:1) to take effect.


 * Log back into the Kurobox and do a “ifconfig” to make sure you see the newly created eth0:1 listed with the correct IP that was designated.

Running DVArchive (the moment of truth)

 * Go to the directory where you created “startVNC-DVA” and launch it
 * 1) ./startVNC-DVA


 * Use the “top” command from the prompt. You should see a string of java processes running (you may need to stretch your telnet screen to see more processes).  If not, something didn’t start correctly.  Go into /tmp and check the log files to see what happened.


 * Go into your VNC client and connect up to the Kurobox. You should see DVArchive running and you will probably get some sort of license agreement screen.  DVArchive will then ask where you wish to keep the video files.  /mnt should be hda3 (the largest partition) so point it to /mnt.  (I also created a “DVA” folder within /mnt so that DVArchive would save it’s files in /mnt/DVA)


 * Once DVArchive is up, you may notice that the “Server” indicator on the buttom right is red. If that’s the case, you need to manually tell DVArchive to use that second IP (eth0:1).  Go into 'DVArchive Properties' under the 'File' menu.  Go into the "Server" tab and click “Override IP Address”.  Then make sure you select the secondary IP you configured. (in my case it’s 192.62.11.151)


 * Click OK and you will need to restart DVArchive.


 * Close DVArchive from your VNC session


 * Disconnect your VNC client


 * From the telnet session, kill the vncserver session
 * 1) vncserver –kill :1


 * Relaunch startVNC-DVA
 * 1) ./startVNC-DVA


 * From DVArchive via VNC viewer, start copying video files to your DVA folder from your ReplayTV’s or other DVArchive sources.


 * Serve up shows to your ReplayTV’s and enjoy!

Optional
One could probably plug in an external USB drive into the Kurobox to expand the Replay library capacity even more. More details on how to prepare Debian for USB drives can be found here.