Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Installing qbittorrent under FreeNAS-11.2-U3

DrBob

Newbie
Joined
Jan 6, 2015
Messages
46
I've been using FreeNAS along with qbittorrent for several years before and I somehow managed to make the couple work several years ago. Due to a hardware problem, I was forced to change the NAS processor stuffing (the CPU and MB) and, accordingly, replaced the software to version FreeNAS-11.2-U3 . I managed to start almost everything, except qbittorrent, which caused several problems that I do not know how to solve. Can anybody help me?

1. I launched qbittorrent (hereinafter referred to as qb) and through the interface I try to configure folders for automatic operation.
On my server, the disk array is named GATE_RAID, it has two Samba folders defined - "mnt / GATE_RAID / DISK_Е" and "mnt / GATE_RAID / DISK_F".
In the old settings, qb took .torrent files from the "/ DISK_E / In" folder and downloaded files to the "/ DISK_F / Out" folder. I've set it up once and it worked for several years - I don’t remember how ;-)

My fault, I forgot that you need to define access to the storage folders outside for the jail using the jail setup. I did so, then I registered access and created freenas user qbittorrent, with password qbittorrent, belonging to the media group.


According to the memoirs, I am trying to configure qb through the interface, but for some reason it does not see the .torrent files in the automatic download folder, and those downloads forcibly specified through the file menu of the browser are not known where. In addition, the folder specified in the "Automatically add torrents from" section is not remembered in the qb settings. "//Outside/ " equals to " /mnt/GATE_RAID/iocage/jails/qbittorrent/root/Outside/", where 2 folders from outside storage a mapped.
1554027535313.png

What am I doing wrong?

2. I was unable to configure the plugin with manual IP address settings, only with DHCP.
At settings: Interface - re0, address 192.168.1.101, subnet mask 24 (255.255.255.0, like the rest of the network) I while installing the plugin get the error:
1553960833524.png

What am I doing wrong?
 

Attachments

Last edited:

DrBob

Newbie
Joined
Jan 6, 2015
Messages
46
Were you able to resolve this?
Hello. Nope. I experimented with rights set for users in jails and on the main system, then I found an old thread https://www.ixsystems.com/community/threads/how-to-install-qbittorrent-in-a-jail.22380/
, using which I have had already installed qbittorrent on the previous installation of FeeNAS several years ago, but did not save a bookmark to it. The thread describes a process using installation through creating a jail, not installing a plugin (which is quite the same though, I guess). It uses manusl creation of a user and user group in the jail and running qbittorent as aprocess in it. The problem is, the step-by-step scenario does not work either - i managed to make qbittorrent work correctly with outside the jail mount points only as a process with root rights.

And I did not manage to start the plugin with a manually set IP, only a jail
 

diedrichg

FreeNAS Expert
Joined
Dec 4, 2012
Messages
1,239
This installation guide is spot-on

I modified the rc.d/qbittorrent file to point to my config save folder (jail local which is mounted to a folder on my pool) as well as making the user match the "media" user in my jail. I also modified the rc.conf file as mentioned in the blog article just to be sure. Everything works perfectly!
 
Last edited:

NasKar

FreeNAS Experienced
Joined
Jan 8, 2016
Messages
527
This installation guide is spot-on

I modified the rc.d/qbittorrent file to point to my config save folder (jail local which is mounted to a folder on my pool) as well as making the user match the "media" user in my jail. I also modified the rc.conf file as mentioned in the blog article just to be sure. Everything works perfectly!
I did the same thing but qbittorrent doesn't download after I make these changes:
edit the rc.d/qbittorrent file
Code:
load_rc_config $name

: ${qbittorrent_enable="NO"}
: ${qbittorrent_conf_dir="/config/qbittorrent/conf"}
: ${qbittorrent_download_dir="/config/qbittorrent/Downloads"}
: ${qbittorrent_user=media}
: ${qbittorrent_group=media}

Then make these changes
Code:
sysrc qbittorrent_user="media"
sysrc qbittorrent_group="media"
sysrc qbittorrent_conf_dir="/config/qbittorrent/conf"
sysrc qbittorrent_download_dir="/config/qbittorrent/Downloads"

chown -R media:media /config /usr/local/etc/rc.d/qbittorrent


It does run the app and TOP shows media is the username for qbittorrent-nox
Any ideas?
 

hervon

FreeNAS Experienced
Joined
Apr 23, 2012
Messages
304
I installed qbittorrent this week. Had a few issues with permissions of the shared folders as always. I did not change anything to /etc/rc.conf. Everything wotks great now. Here are a few steps:

pw groupadd -n media-g 1001
pw useradd -n media -w none -u 1001 -G media
pw groupmod media -m media
id media
cd /usr/local/
chown -R media:media etc
cd /var/db/
chown -R media:media qbittorrent

/usr/local/etc/rc.d/qbittorrent
: ${qbittorrent_enable="YES"}
: ${qbittorrent_conf_dir="/var/db/qbittorrent/conf"}
: ${qbittorrent_download_dir="/var/db/qbittorrent/downloads"}
: ${qbittorrent_user=media}
: ${qbittorrent_group=media}

service qbittorrent start

qbittorrent GUI Options:
Save default path : /var/db/qbittorrent/downloads/
Monitored folder : /var/db/qbittorrent/torrents/
 

NasKar

FreeNAS Experienced
Joined
Jan 8, 2016
Messages
527
did you change the permission to media of the /var/db/qbittorrent?
 

hervon

FreeNAS Experienced
Joined
Apr 23, 2012
Messages
304
Yep. Read my comment. I changed permission to the folder
 

NasKar

FreeNAS Experienced
Joined
Jan 8, 2016
Messages
527
Did a clean install with everything working with the default user qbittorrent. Then made your changes, tried both : ${qbittorrent_download_dir="/var/db/qbittorrent/downloads"} and : ${qbittorrent_download_dir="/var/db/qbittorrent/Downloads"} as Downloads is there by default. But the
Code:
root@qbittorrent:~ # id media
uid=8675309(media) gid=8675309(media) groups=8675309(media),850(qbittorrent),8675309(media)
root@qbittorrent:~ # chown -R media:media /usr/local/etc
root@qbittorrent:~ # chown -R media:media /var/db/qbittorrent
root@qbittorrent:~ # nano /usr/local/etc/rc.d/qbittorrent
  GNU nano 4.6                                                                              /usr/local/etc/rc.d/qbittorrent                                                                                        
#!/bin/sh
. /etc/rc.subr

name=qbittorrent
rcvar=qbittorrent_enable

load_rc_config $name

: ${qbittorrent_enable="YES"}
: ${qbittorrent_conf_dir="/var/db/qbittorrent/conf"}
: ${qbittorrent_download_dir="/var/db/qbittorrent/downloads"}
: ${qbittorrent_user=media}
: ${qbittorrent_group=media}

command="/usr/local/bin/qbittorrent-nox"
command_args="--daemon"

qbittorrent_flags=" \
        ${qbittorrent_conf_dir:+--profile=${qbittorrent_conf_dir}} \
        ${qbittorrent_download_dir:+--save-path=${qbittorrent_download_dir}} \
        ${qbittorrent_flags}"

run_rc_command $1


Here is the log file
Code:
(N) 2020-03-29T05:36:02 - qBittorrent v4.2.1 started
(N) 2020-03-29T05:36:02 - Using config directory: /var/db/qbittorrent/conf/qBittorrent/config/
(N) 2020-03-29T05:36:02 - qBittorrent v4.2.1 started
(N) 2020-03-29T05:36:02 - Using config directory: /var/db/qbittorrent/conf/qBittorrent/config/
(I) 2020-03-29T05:36:02 - Trying to listen on: 0.0.0.0:51214,[::]:51214
(N) 2020-03-29T05:36:02 - Peer ID: -qB4210-
(N) 2020-03-29T05:36:02 - HTTP User-Agent is 'qBittorrent/4.2.1'
(I) 2020-03-29T05:36:02 - DHT support [ON]
(I) 2020-03-29T05:36:02 - Local Peer Discovery support [ON]
(I) 2020-03-29T05:36:02 - PeX support [ON]
(I) 2020-03-29T05:36:02 - Anonymous mode [OFF]
(I) 2020-03-29T05:36:02 - Encryption support [ON]
(I) 2020-03-29T05:36:02 - UPnP / NAT-PMP support [ON]
(W) 2020-03-29T05:36:02 - Couldn't load GeoIP database. Reason: No such file or directory
(N) 2020-03-29T05:36:02 - Using built-in Web UI.
(W) 2020-03-29T05:36:02 - Couldn't load Web UI translation for selected locale (C).
(N) 2020-03-29T05:36:02 - Web UI: Now listening on IP: *, port: 8080
(I) 2020-03-29T05:36:02 - Successfully listening on IP: 0.0.0.0, port: TCP/51214
(I) 2020-03-29T05:36:02 - Successfully listening on IP: 0.0.0.0, port: UDP/51214
(I) 2020-03-29T05:36:02 - Successfully listening on IP: fe80::1%lo0, port: TCP/51214
(I) 2020-03-29T05:36:02 - Successfully listening on IP: fe80::1%lo0, port: UDP/51214
(I) 2020-03-29T05:36:02 - System network status changed to ONLINE
(N) 2020-03-29T05:36:02 - 'linuxmint-19.3-cinnamon-64bit.iso' restored.
(W) 2020-03-29T05:36:02 - Couldn't download GeoIP database file. Reason: The remote host name was not found (invalid hostname)
(N) 2020-03-29T05:36:14 - WebAPI login success. IP: ::ffff:192.168.5.30
(N) 2020-03-29T05:36:32 - 'linuxmint-19.3-cinnamon-64bit.iso' was removed from the transfer list and hard disk.
(N) 2020-03-29T05:36:48 - Download first and last piece first: Off, torrent: 'linuxmint-19.3-cinnamon-64bit.iso'
(N) 2020-03-29T05:36:48 - 'linuxmint-19.3-cinnamon-64bit.iso' added to download list.
(C) 2020-03-29T05:38:39 - UPnP/NAT-PMP: Port mapping failure, message: could not map port using UPnP: no router found
(C) 2020-03-29T05:38:39 - UPnP/NAT-PMP: Port mapping failure, message: could not map port using UPnP: no router found
(C) 2020-03-29T05:38:39 - UPnP/NAT-PMP: Port mapping failure, message: could not map port using UPnP: no router found

If I switch back to qbittorrent user then my it works and the log shows "Detected external IP:91.xx.xx.xx
Must be something else that need the chown command to be run on. BTW UPnP is turned off on my router for security reasons.
 

hervon

FreeNAS Experienced
Joined
Apr 23, 2012
Messages
304
Just a guess. Did you create user & group media ? Apart from that i'm clueless.

pw groupadd -n media-g 1001
pw useradd -n media -w none -u 1001 -G media
pw groupmod media -m media
 

NasKar

FreeNAS Experienced
Joined
Jan 8, 2016
Messages
527
pw user add media -c media -u 8675309 -d /nonexistent -s /usr/bin/nologin"
pw groupmod media -m media
pw groupmod media -m qbittorrent"
pw groupmod qbittorrent -m media"
 
Top