This post was inspired by this guide created by @TheHellSite.
My goal is to set up a torrent LXC such that it would torrent an Ubuntu iso to an Unraid share.
It seems that there are many ways to approach this, but I struggled to find a guide that fit my needs. Having finally found a solution, I felt it appropriate to post my process in hopes that it helps others.
While this does work, Proxmox will automatically create folders based on the
Additionally, the use of a privileged LXC seems to be undesirable.
With those issues in mind, I chose to explore other options.
I'm not intimately familiar with the implementation details of SMB/CIFS or torrents, but my rough understanding is that:
This could explain the poor performance, but that is just a guess. In any case, this option does not suit my needs.
Also - I'm very new to Proxmox and, while I have some experience with Linux CLI, I'd hardly say that I'm experienced. If you find any issues in my solution, please let me know and I will try to make edits when appropriate.
My goal is to set up a torrent LXC such that it would torrent an Ubuntu iso to an Unraid share.
It seems that there are many ways to approach this, but I struggled to find a guide that fit my needs. Having finally found a solution, I felt it appropriate to post my process in hopes that it helps others.
The Setup
Note: IP addresses, folder names, etc are just examples. Substitute as needed.- Proxmox is installed on Computer 1
- Has the static IP
192.168.1.10
- Contains a torrent LXC with an ID of
101
- Has the static IP
- Unraid is installed on Computer 2
- Has the static IP
192.168.1.20
- Contains a share called
downloads
- The share allows NFS and has granted read/write permission to
192.168.1.10
(Computer 1)
- Has the static IP
Option 1
The goal can be accomplished by adding the NFS share to your Datacenter in Proxmox. You can then mount the new storage device to the torrent LXC, however the LXC must be privileged and have the NFS feature turned on.While this does work, Proxmox will automatically create folders based on the
Content
types you enabled when adding the storage device. This may be reasonable in certain situations, but none of the content types fit my use-case. I attempted to delete the directories, but they would regenerate.Additionally, the use of a privileged LXC seems to be undesirable.
With those issues in mind, I chose to explore other options.
Option 2
I followed the instructions posted by @TheHellSite in the above thread. I had no problems with the setup process, but I unfortunately experienced poor torrenting speeds.I'm not intimately familiar with the implementation details of SMB/CIFS or torrents, but my rough understanding is that:
- SMB is not very performant when dealing with many small files
- Torrenting downloads many small chunks of the desired content in parallel
This could explain the poor performance, but that is just a guess. In any case, this option does not suit my needs.
Option 3 (my solution)
Having learned a lot from Option 2, I decided to attempt to mount an NFS share without the Proxmox GUI.- Access your nodes shell
- Proxmox > Your Node > Shell
- Create a mounting point for the share
mkdir /mnt/computer2/downloads
- Edit
fstab
so that the share mounts automatically on reboot- Open:
nano /etc/fstab
- Add:
192.168.1.20:/mnt/user/downloads/ /mnt/computer2/downloads nfs defaults 0 0
- Save
- Open:
- Mount the share
- Reload systemd:
systemctl daemon-reload
- Mount shares:
mount -a
- Reload systemd:
- Add the pointing point to your LXC
- Open:
nano /etc/pve/lxc/101.conf
- Add:
mp0: /mnt/computer2/downloads/,mp=/downloads
- Save
- Open:
- Start the LXC
- Update the LXC user's permissions
groupadd -g 10000 lxc_shares
- Note: I think you can use whatever group name you want as long as you use again in the next step.
usermod -aG lxc_shares root
- Note: Your username is probably root, but substitute for whatever user you want to configure permissions for.
- Reboot the LXC
- Verify permissions
- Create a file in your mountpoint:
touch foobar
- Attempt to delete
foobar
from another machine. - If successful, you should be done.
- Create a file in your mountpoint:
Closing
This goal provided me with a good learning opportunity and I'm appreciative of the vast amounts of community discussion on here, Reddit, blog posts, etc. I hope this post helps others as much as the other discussions helped me.Also - I'm very new to Proxmox and, while I have some experience with Linux CLI, I'd hardly say that I'm experienced. If you find any issues in my solution, please let me know and I will try to make edits when appropriate.
Edits
- Added permission configuration to Option 3.
- Context: I deleted by torrent LXC after concluding a test, but forgot to delete the Ubuntu ISO first. I attempted to delete the file from my personal computer, but was unable to because of permission issues. I ended up needing to format the NAS (though fortunately nothing else was on it).
- Removed
uid=100000,gid=110000
from the NFS configuration in Step 3.- Context: uid and gid are not valid settings for NFS. So far as I can tell, this isn't really an issue. I speculate that it may be a pain if you want to manage the files directly from your node's shell, but I think you just as easily create a user with the appropriate UID and GID.
Last edited: