The Ultimate DNS-323 Setup: Part 2 – Debian Installation

DNS323 — Mark @ 3:52 pm

By the end of this guide you will have

-A fully stable and remotely operable BitTorrent client on your DNS-323. I will show you how to setup 1) A remote web interface and 2) A Windows desktop application that is very similar to uTorrent that can remotely control and monitor your torrents.

-Have your DNS323 download torrent files for you with a single click and without using anything but the Firefox web browser.

-Have your DNS323 automatically extract RAR archives after they are downloaded.

-Store and maintain your torrent downloads on the DNS 323.

-Stream videos and movies from you DNS 323 to your Xbox 360 or Playstation 3 (or similarly compatible device).

Introduction:

This guide will walk you through the steps to turn you Dlink DNS 323 into a fully functional Linux server with the capability to download Torrents extremely easily (using the Transmission BitTorrent Client), remotely administer those torrents via a web interface (Transmissions built in Clutch interface) and a uTorrent like desktop app for Windows (Transmission Remote .NET).

Required Skills and Software

-Set your home router to assign your DNS-323 a static IP

-Basic Linux command line skills

-SSH client (Putty on Windows or OSX comes with one, available from iTerm)

Debian Linux

To run an advanced setup like this, you must install Debian Linux on your DNS-323. Debian is a full operating system that will run in a self contained environment. It will note replace or overwrite anything from Dlink and you may remove it at anytime. You will still be able to access the Dlink web interface just as before.

The Debian installation takes 5-10 minutes as there is a fun-plug package that automates all of the work for you. Debian is installed in a chroot environment which means it is completely separated from the rest of the DNS-323 software.


For Fonz’s Fun Plug Users Only (If you are using an unmodified DNS-323 skip to the next step)

If you (like I was  originally) are currently running Fonz’s Fun Plug you will first have to remove it before you can install Debian. Fonz’s Fun Plug is a nice system but is not as powerful or as up to date as a full Debian Linux system.

To remove Fonz’s Fun Plug, delete the funplug directory in /mnt/HD_a2/fun_plug. It is possible it can be done via Windows Explorer (or whatever) if you changed its permissions/owner, otherwise do it from the command line. I will assume you know how to do it as you install it in the first palce.

(Please be careful using rm -rf, you can destroy a Linux system with one wrong delete)

rm -rf /mnt/HD_a2/fun_plug
chmod -R 777 /mnt/HD_a2/ffp
rm -rf /mnt/HD_a2/Nas_prog

Reboot the DNS-323 and delete the /mnt/HD_a2/ffp directory.

Debian Installation

You are now ready to install Debian. This is very simple using the Debnas Fun Plug package. Fun Plug is a mechanism that comes with the DNS-323 that allows users to boot custom scripts. This allows us to boot to a chrooted operating system so easily. You can find the DNS-323 Debian Installer at http://sourceforge.net/projects/debnas/. At the time of this writing 0.5 is the latest version. Version 0.5 installs an older version of Debian which is unfortunate but Debian itself provides a way to easily update itself to the latest version available.

Download and extract the Debian Installer package to Volume_1 of the DNS-323. SSH to the DNS-323 an extract the DebNas package (tar -jxvf  debnas-0.5.tar.bz2 or by using 7-zip from Windows Explorer). There should now be linux.tar and the fun_plug file in the Volume directory now.

Reboot the DNS-323 and Debian will install automatically. Installation will take several minutes. SSH will become enabled when the device eventually boots. Be patient, the DNS-323 is roughly the equivalent to a 10 year old computer. As awesome as it is, it’s slow as hell. SSH to the 323. The default login credentials are:

Username: root
Password: 12345678

Root is the equivalent of Administrator on other types of systems. You can do a lot of damage using the root account if you don’t know what you’re doing. Create a new unprivileged account and change the root password. You can add a new user by using the useradd command. Don’t forget to change the root password with the passwd command. You can find a pretty good command line tutorial here http://www.ee.surrey.ac.uk/Teaching/Unix/.

Upgrade Debian

Now you have a full Linux environment on the DNS-323 with all of Debian’s software packages at your disposal. Most Linux systems have a software manager that allows you to easily install common software. Debians system is among the best.

The first step is to upgrade to Debian Lenny, a more recent stable version of the operating system. As root, edit /etc/apt/sources.list.d/etch.list, replacing the word etch with lenny. I also changed the mirror url to a North American mirror rather than the German one by removing the de. in the url. You may also rename the filename from etch.list to lenny.list if you feel so inclined.

Now we need to update the repository packages listing and upgrade to lenny. You may have GPG issues which you can resolve by following the guide here :

apt-get update
apt-get dist-upgrade

This will take a while to download and then upgrade. When it is done reboot Debian. I had to reboot using the command ‘reboot -f’. When Debian comes back up, it will be running Lenny. When it comes back up, update to make sure everything is current.

apt-get update
apt-get upgrade

This will likely take a very long time and require some interaction. It is a good idea to reboot the system (although likely unnecessary) after a system wide upgrade. Type reboot from the command line.

Installing New Software

As mentioned previously, Debian has a fantastic software manager. Most of the software you need can be installed automatically for you. The only downside to this is often, software you like and use often is not updated to the latest version. The only thing we will install manually however is our BitTorrent client.

To install a software package use the following command. You may find many tutorials on the internet about using apt-get.

apt-get install <package name>

The apt-get system supports dependencies as many Linux programs require other programs to operate properly. Apt-get has a dependency system and should resolve and install all the required packages for you.

List of Packages to install

As root:

apt-get install automake
apt-get install build-essential
apt-get install sudo
apt-get install wget

These will install the tools we need to be able to install the latest versions of Transmission, straight from the developers website.

I would also suggest intstalling the Network Time Daemon. It will keep the time on you DNS-323 in sync with servers on the internet. For some reason the time on my DNS-323 always gets reset or is wrong without it.

apt-get install ntp
/etc/init.d/ntpd start

(It has been a year since I installed my original DNS-323 system. I cannot remember the exact packages I installed to get everything to operate. If I am missing something essential from the list please comment below and I will add it. Thanks.)

  • Flem

    I had some troubles. First, you did not mention that I had to open ftp and upload the the debnas-files. After reboot two times I could ssh to my nas. But, I could not update etch-packets. I had to dist-update to lenny. But, that required that I removed:
    /etc/apt/sources.list.d/etch.list
    and made a new file:
    /etc/apt/sources.list.d/lenny.list
    with the following content:
    deb http://ftp.dk.debian.org/debian/ lenny main contrib non-free
    deb-src http://ftp.dk.debian.org/debian/ lenny main contrib non-free
    (Please change dk (Denmark) to something else.)
    I had GPG problems, and I had to use your link:
    http://linux.com/community/blogs/Debian-Upgrading-to-Lenny-ERROR-no-public-key-available-for-the-following….html

    Then, dist-upgrade gave some problems with locales. I had to:

    aptitude install locales
    dpkg-reconfigure locales

    But, I could not make the apt-get problems before I ran:
    LANGUAGE=en_GB.UTF-8
    LC_ALL=en_GB.UTF-8
    LANG=en_GB.UTF-8

    After reboot, it seems to work though $LANGUAGE and $LC_ALL are not set.
    (echo $LANG $LANGUAGE $LC_ALL)

    But, thank you it seems to work fine.

    BUT, I can’t read you page because it is grey. I had to copy it to seamonkey composer!!!

  • http://blog.markstahler.ca/ Mark

    Sorry about your troubles, I did not run into any language issues as I use the standard locales.

    Which part of the site isn’t working properly?

  • Flem

    Concerning reading problems. The problem is that the background is dark grey, and the text is light grey and therefore very difficult to read. I use firefox with default configuration of fonts and colours. (I allow webpages to show their own fonts and colours.)

  • Sanjivkawa

    are you able to install this linux distro without jeopardizing the users data files on the server

  • nik

    Does this work on dns-320 aswell?!

  • ckarn

    Nope, not yet at least.

    The debnas package doesn’t work on DNS-320. I think it’s because the 320 needs a different kernel – but yeah, no idea.

    But hopefully someone will make a version for DNS-320 soon!

  • JaCh0o

    hi, i have some troubles with installing debnas. U have written “SSH to the DNS-323 an extract the DebNas package” before installing debian, how can i do it if on disk there is no ffp or any other program ?? i even cant log on telnet. what am i doing wrong ?

  • Jach0o

    after doing exactly what u have written above. i cant log by SSH couse when i check ports on DNS-323 there are only: 80, 139, 445, 515. Please tell me what should i do ?? ive made factory reset of firmware + formatted disk to ext3 after that i droped 2 files on dns-323 and shut it down after 10 sek i turned it on. on disk there are: fun_plug, linux.tar (89,3MB) and linux (folder, 95,8MB), please help.

  • http://www.bagful.net cloud hosting india

    Hello

    Nice Blog

    Thanks

  • Stringer_Lagoon

    obvious self-promotion is obvious. In other news, how is the fun_plug support on the DNS-320? 

  • http://www.bagful.net/ linux hosting india

    Hello

    Good One

    Thanks 

  • Nyyssitunnus

    Does this work with DNS-325

  • Carlos Madera

    Very good tutorial!

    I had to install  apt-get install debian-archive-keyring
    to use lenny as etch…

    Thanks.

  • Pingback: D-Link All-in-One Mobile Companion (DIR-505) | TheBestRouter.net

  • MyoAung

    Hi Could you provide steps to uninstall DebNAS ? After I changed root password and exit the session. After that i couldn’t login. I want to reinstall it. Thanks.

  • logical Octopus

    I got 404 error when running any sort of apt-get.

    So I editted the sources file: /etc/apt/sources.list.d/etch.list to include:
    deb http://archive.debian.org/debian etch main contrib non-free
    deb-src http://archive.debian.org/debian etch main contrib non-free

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2014 Mark Stahler – Blog | powered by WordPress with Barecity