This guide will focus on installing Ubuntu as a base for a Torrent box that downloads directly to a TrueNAS box.
Prerequisites:
1. A Windows 10 Pro machine, with Hyper-V activated and appropriate BIOS settings allowing virtualization. For example, enabling both SR-IOV and SVM for AMD platforms.
2. A copy of Ubuntu distro [https://ubuntu.com/download/desktop]
3. A TrueNAS machine with SMB shares already working.
Part 1 – Installing Ubuntu on Hyper-V
- In Hyper-V Manager, click New > Virtual Machine.
- Example details:
- Name: UbuntuVM [best to locate the VM on an NVME or SSD for better performance].
- Specify Generation: Generation 1.
- Startup Memory: 8192 MB [uncheck Dynamic Memory].
- Connection: Default Switch.
- Create a virtual hard disk: Name the vhdx and locate it on a NVME or SSD for better performance.
- Size: 20GB
- Installation Options: “Install an OS” by pointing it to the bootable Ubuntu ISO you downloaded.
- Click “Finish”
- Before starting the VM, right-click on it and choose “Settings”.
- Processor: adjust it to the number of processors you want the VM to use. Min 2.
- “Network Adapter > Advanced Features”, you can set a static MAC address for DHCP purposes.
- Click OK.
- Connect and Start the VM.
- Choose language, keyboard.
- Choose “Install Ubuntu”.
- Choose time zone.
- Choose minimal install.
- Allow it to install and restart
Part 2 – Mapping TrueNAS SMB Shares Thru fstab
- Log into the Ubuntu VM and open a “Terminal”
- Install cifs-util:
$ sudo apt-get 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.
At this point, you will have a permanently mounted access to a SMB share on TrueNAS or any network storage device sharing thru SMB protocol. You can also add more SMB shares by repeating steps 3 thru 8. This will come in handy for when you want to write from you torrent client, such as Qbittorrent directly to your NAS upon completion.
References:
1. How to Install Ubuntu on Windows with Hyper-V – Aleksandar Kovačević
2. Permanently Mount CIFS/SMB Share in Ubuntu – Marc Jenkins
3. How to Mount a Samba Share on Ubuntu and Debian – Rahul Kumar