Home Assistant addon : qbittorrent (supports openvpn & smb mounts)

Thanks! Just create a qBittorrent folder in your /config and it will work. I’ll push a new version à bit later in the day that does this automatically

Edit : new version online

tell me how to change the user interface? (webui)

1 Like

Hello, When connecting with the web interface, you can change it from the addon options. With ingress, it’s not possible to change it though its a limitation of using it

I change the interface in the configuration but it is always the same all the same (what am I doing wrong?
Screenshot at Aug 30 12-53-22

1 Like

Hi, it can’t be changed when accessing with ingress (from the HA app), it is only changed if you try to access it with http://IP:port

New feature : Added auto stop, just set the run_duration optional setting

run_duration: 12h #for how long should the addon run. Must be formatted as number + time unit (ex : 5s, or 2m, or 12h, or 5d...)

New feature : mount local drives in addition to smb ones.

Configure this option:
localdisks: "sda1, sdb1" # Optional

Name is the partition name. It is mounted to /mnt/diskname and can be accessed by the qbittorrent app

I’ve followed along through the thread, but I can’t figure out why the smb mount isn’t working for me.

Config:

ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
whitelist: localhost,127.0.0.1,172.30.0.0/16,192.168.0.0/16
customUI: vuetorrent
SavePath: /mnt/qbt
Username: <redacted username>
DNS_server: ''
PUID: '0'
PGID: '0'
TZ: ''
networkdisks: //<Redacted IP>/qbt
cifsusername: <Redacted username>
cifspassword: <Redacted password>
openvpn_enabled: false
openvpn_config: qbt.ovpn
openvpn_username: <Redacted ovpn username>
openvpn_password: <Redacted ovpn password>
run_duration: ''
cifsdomain: ''
smbv1: false

Logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Qbittorrent
 qBittorrent is a bittorrent client
-----------------------------------------------------------
 Add-on version: 14.3.8.99202110120741-7429-1bae770b2ubuntu20.04.1-ls158
 You are running the latest version of this add-on.
 System: Home Assistant OS 6.4  (amd64 / qemux86-64)
 Home Assistant Core: 2021.10.2
 Home Assistant Supervisor: 2021.10.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
 https://github.com/alexbelgium/hassio-addons
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    0
User gid:    0
-------------------------------------
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
[cont-init.d] 30-nginx.sh: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 90-dns_set_1.1.sh: executing... 
[18:06:40] INFO: DNS Servers option empty. Using default router (or HA) dns servers.
[cont-init.d] 90-dns_set_1.1.sh: exited 0.
[cont-init.d] 91-qbittorrent_configuration.sh: executing... 
[18:06:40] INFO: Downloads can be found in /mnt/qbt
[18:06:41] INFO: Whitelisted subsets will not require a password : localhost,127.0.0.1,172.30.0.0/16,192.168.0.0/16
[18:06:41] INFO: WEBUI username set to <Redacted username>
[18:06:41] INFO: Alternate UI enabled : vuetorrent. If webui don't work, disable this option
[18:06:42] INFO: Default username/password : admin/adminadmin
[18:06:42] INFO: Configuration can be found in /config/qBittorrent
[cont-init.d] 91-qbittorrent_configuration.sh: exited 0.
[cont-init.d] 92-local_mounts_v1.2.sh: executing... 
[18:06:42] INFO: Mounting external hdd...
[cont-init.d] 92-local_mounts_v1.2.sh: exited 0.
[cont-init.d] 92-smb_mounts_v1.4.sh: executing... 
[18:06:42] INFO: Mounting smb share(s)...
do_connect: Connection to <Redacted IP> failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
	Sharename       Type      Comment
	---------       ----      -------
	qbt             Disk      

Reconnecting with SMB1 for workgroup listing.
Unable to connect with SMB1 -- no workgroup available
[18:06:43] INFO: Mounted with smbclient
[18:06:43] INFO: ... //<Redacted IP>/qbt successfully mounted to /mnt/qbt with options ,,iocharset=utf8
[cont-init.d] 92-smb_mounts_v1.4.sh: exited 0.
[cont-init.d] 93-openvpn.sh: executing... 
[18:06:43] INFO: Direct connection without VPN enabled
[cont-init.d] 93-openvpn.sh: exited 0.
[cont-init.d] 99-custom-scripts: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[18:06:44] INFO: Starting NGinx...

It appears that this works, but nothing downloaded shows up in the share. Using portainer I tried to see what was mapped, and on a fresh start /mnt/qbt exists, but is empty:

In Portainer running bash in the container:

cd /mnt/qbt
root@db21ed7f-qbittorrent:/mnt/qbt# ls -l
total 0

If I download something, I do see it in Portainer in /mnt/qbt but it’s is no way mapped to the network share. When I restart the addon, the folder is empty again.

Any ideas what I’m doing wrong here @alexbelgium ?

Hi Khalos,

Great troubleshooting guide, thanks!

First thing is that it showed me issues in my SMB scripts - indeed as you saw the disk was never mounted. I’ve therefore pushed a new version of Qbittorrent that includes data validation for the “networkdisks” field, that corrects the issue that you mention (a local folder is see in /mnt/xxx even if the folder is not mounted), and provides much better troubleshooting descriptions. Could you please upgrade to this version and see what the log says ? Thanks!

Second thing is that I’ve looked at your logs but I don’t see an issue there:

  • The smbclient info show that the sharename (qbt) is correct and visible for the machine
  • You redacted the IP, but I suppose it was in IP format and not a netbios name ?
  • Are you sure that the username/password are correct, and are well encoded in the source device ?

In conclusion, apart from the above questions, the best way forward I think would be if you could update to the new version and we’ll see what the logs tell us… In parallel, as I see that you use portainer (great tool!), you could also do test by yourself by trying to mount the folders manually using the command mkdir -p /test && mount -t cifs -o rw,username=YOURUSERNAME,password=YOURPASSWORD //IP/qbt /temp

Thanks for the great response, and for the quick update to the addon!

This did indeed point out that I had an issue with my credentials (I had username as Desktop-XXXX/<username> instead of of just <username>. With this new version I could see an error in the logs (and when I tried manually through portainer). The /mnt/qbt directory was no longer created with these invalid credentials.

mount error(13): Permission denied

In the old version there was no such error, so I assumed that meant my credentials were valid.

Thank you so much for your help, and for maintaining the addon!

1 Like

Hello!
I have a problem to start qbittorrent. Could you help me?

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: qBittorrent
 A BitTorrent client in Qt
-----------------------------------------------------------
 Add-on version: 1.3.4301
 You are running the latest version of this add-on.
parse error: Expected string key before ':' at line 1, column 4
[13:34:34] ERROR: Unknown HTTP error occured
 System:   (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.10.6
 Home Assistant Supervisor: 2021.10.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] qbittorrent.sh: executing... 
[cont-init.d] qbittorrent.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Perhaps it’s a ease solution one, but I couldn’t find any.

Hi!

Which version of the addon are you running? Neither the text nor description match what I have in my current addon, for example (notice the difference in addon description) :

[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Qbittorrent
 qBittorrent is a bittorrent client

The latest is “14.3.8.99202110120741-7429-1bae770b2ubuntu20.04.1-ls158-4”

Yes, I see your addon version now… Indeed it is too old you need to update!

If it can’t update, you can go in the addons store, in my repo, and check if there is not another version of qbittorrent that appears…

Thanks a lot! It helped :slight_smile:

1 Like

Hello,

at first many thanks for this addon. A question about the ports, is it possible to change the standard port for bittorrent to something else than 6881? If i change the port in qbittorrent i can see no open ports, if staying in 6881 in qb and changing the host port in the config of the addon, i can see that my (custom) port is open (when i do a portscan), but the tracker still says not connectable. I think the tracker uses the port that is selected and reportet in/by qb (which is 6881 in this case), but the open port with the forwarding in the router is something else…

Thanks in advance

Mike

Hi, actually we shouldnt touch to the ports in qbitorrent : the mapping to another port should be done from the addon options! Then it should work… Does this help you?

When changing the port in the addon the tracker says not connectable, i think this happens because qbittorrent submits its open port (from its own settings) to the tracker but could not be reached from outside from this port.
But its not a huge problem, i will use the standard port from you, with this setting it is connectable.

1 Like

Indeed if this is the case it cannot be solved easily as the port that docker maps from the inside of the container can’t be changed dynamically… Or it would require a double layer of nginx redirection (one internal to the addon, one at the interface between addon and docker) that would risk creating even more issues!

So if you’re happy I am.

I’ve updated the transmission addon also if people want an alternative to qBittorrent :

  • Removal of unprotected mode required
  • Addition of local disks mount
  • Addition of repair capabilities for the settings json
  • Optional custom UI, with custom UI set by default
  • Optional custom DNS setting (to avoid flooding a local DNS filter such as adguard)
  • Optional whitelist
  • Optional identification with USER & PASS