qBittorent with Mounted SMB/CIFS/Network Share on Ubuntu 20.04

The focus of this guide is to install qBittorrent on Ubuntu while being able to download and write directly to a SMB share on TrueNAS. Without altering the fstab file, qBittorrent will experience I/O errors. A complete guide to installing Ubuntu on Hyper-V and mounting SMB shares can be found HERE and this guide builds off of that, along with the installation of a VPN, like Private Internet Access with port forwarding you can find HERE.

Step 1 – Install qBittorrent

  1. Open a Terminal in Ubuntu.
  2. Update the qBittorrent’s PPA:
    $ sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
  3. Install qBittorrent:
    $ sudo apt install qbittorrent
  4. Open qBittorrent.
  5. Open Options.
    • Downloads:
      • Pre-allocate disk space for all files – CHECK
      • Append .!qb extension to incomplete files – CHECK
      • Default Dave Path – Use the mnt point mapped to SMB share
      • OPTIONAL: Keep incomplete torrents in – Use another mnt mapped to SMB share
    • Connection:
      • Port used for incoming connections – Port forwarded from PIA app
      • Use UPnP/NAT-PMP port forwarding from my router – UNCHECK
    • Advanced:
      • Network interface – Choose PIA interface ex. wgpia01
    • Click OK and restart qBittorrent.

qBittorent can now download and save directly to a network SMB share, such as the SMB protocol thru TrueNAS. If you have not mounted and mapped a SMB share, follow the guide below; you can also mount additional SMB shares for “Downloading” and “Complete” folders.

Guide to Mount SMB Shares Permanently

  1. Install cifs-util:
    $ sudo apt install cifs-utils
  2. Make a mount point:
    $ sudo mkdir /mnt/[SomeDirectory]
  3. Create a file to store your SMB credentials:
    $ sudo nano /root/.examplecreds
  4. Add the following 2 lines with your SMB credentials:
    username=[SMBUserName]
    password=[SMBPassword]
  5. Write out the file [Ctrl-O] and exit [Ctrl-X].
  6. Edit fstab:
    $ sudo nano /etc/fstab
  7. Add the following line with your network specifics:
    //[TrueNAS IP]/[Share Name] /mnt/[SomeDirectory] cifs vers=3.0,credentials=/root/.examplecreds,noperm 0 0
    Here’s an example:
    //192.168.6.9/Media/Video/4K /mnt/4K_Videos cifs vers=3.0,credentials=/root/.examplecreds,noperm 0 0
  8. Write out the file [Ctrl-O] and exit [Ctrl-X].
  9. Test for issues prior to rebooting:
    $ sudo mount -a
  10. If no errors, reboot.

Refereces:
1. How to Install qBittorrent on Ubuntu 18.04 Desktop or Server – Xiao Guoan
2. Installing Ubuntu 20.04.3 LTS in Windows 10 Hyper-V with Mounted SMB Shares – RedEyeNinja

Liked it? Take a second to support RedEyeNinja on Patreon!
Become a patron at Patreon!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.