Thursday, January 19, 2012

Installing mldonkey on FreeNAS 8.0 embedded

I have recently been able to successfully install mldonkey on my fresh amd64 FreeNAS 8.0.3 embedded (HP Proliant Microserver) setup. I think mldonkey is a piece of software that cannot be renounced, so I'm leaving here a tutorial showing the steps I followed through to have a correct working install.

Caveat: FreeNAS USB installs give really few space available on the / partition. Consider that installing software in it can fill up all the available space, possibly resulting in system crashes. Before following this tutorial, please take into account the real amount of free space available on your / partition, considering that ~10 MB of space will be used by mldonkey software (at the time this tutorial was written!)

  1. Log as root into the NAS, either through ssh or through the console. If you log in as a regular user, type su and enter root password.
  2. We have to install software into the / tree, so we have to make it first of all writeable:

    # mount -uw /
  3. FreeNAS is pointing by default to a repository which mldonkey is not available to download from. Luckily enough, we can find a working binary in an upper level of the repository tree. So, install it this way:

    # pkg_add -r ../net-p2p/mldonkey-core-3.0.6

    Please notice that you have to put the current available version in order to correctly downlaod it. If errors about not finding the package are shown, point your browser to the net-p2p folder in the repository and check which package is available.

    The download/install procedure will actually take a while, as installing on the USB stick is a slow process.
  4. Now log into the web interface and create a new user under Account > Users > Add User

    Username: mlnet
    Password: *****
    Home Directory: /mnt/SHARED-DISK/mlnet/

    Where SHARED-DISK is your storage mount point.
  5. I use my station as a server, so there are multiple users in it. To let all of them get access to the downloaded files, change permissions from a ssh/console shell accordingly:

    # chmod 760 /mnt/SHARED-DISK/mlnet/
  6. Now we have to configure the downloads.ini file. First of all, we have to let mldonkey create its configuration files. Log in (from either ssh or console) as mlnet, using the credentials created at step 4.
    Launch mldoney:

    # mlnet

    The program will setup and then hung, waiting for connections. Kill it with CTRL + C.

    Now cd into /mnt/SHARED-DISK/.mldonkey and edit the downloads.ini using vi, ee, or your favorite shell editor.

    Find the line:

    allowed_ips = ["";]

    After the semicolon, add "your ip". Note that you can, for example, allow connections from a subnet in your LAN, specifying the correct subnet mask like ""
  7. Now we want to tell FreeNAS to automatically launch mldonkey at startup. We will be using rc.local to this end:

    cd /conf/base/etc/
    vi rc.local (this will create the file if not already existing)

    At the end of the file (or at a suitable place according to your configuration) enter the line:

    su mlnet -c mlnet &

    This will launch mldonkey as mlnet user and continue the startup of the machine.
  8. When the machine is fully booted, access mldonkey url:


    Now, you can start using and configuring mldonkey according to your needs!

Friday, January 6, 2012


Se i Re Magi fossero onorevoli
Rinuncerebbero a tutti i convenevoli
A Erode direbbero: "Maestà
Ti diamo il Bimbo, lasciaci l'indennità!"