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
- Open a Terminal in Ubuntu.
- Update the qBittorrent’s PPA:
$ sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable - Install qBittorrent:
$ sudo apt install qbittorrent - Open qBittorrent.
- 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.
- Downloads:
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
- Install cifs-util:
$ sudo apt install cifs-utils - Make a mount point:
$ sudo mkdir /mnt/[SomeDirectory] - Create a file to store your SMB credentials:
$ sudo nano /root/.examplecreds - Add the following 2 lines with your SMB credentials:
username=[SMBUserName]
password=[SMBPassword] - Write out the file [Ctrl-O] and exit [Ctrl-X].
- Edit fstab:
$ sudo nano /etc/fstab - 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 - Write out the file [Ctrl-O] and exit [Ctrl-X].
- Test for issues prior to rebooting:
$ sudo mount -a - 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