Here we go. Since Proxmox is not support this kind of mount in GUI yet, your explanation here is a brilliant! This approach much efficient than network sharing between VMs/CTs. Thank you very much, wish you all the best!
Gotta tell ya I've been wrestling with this on and off for months now. This video was the breakthrough I needed. My only regret is that the like button only has one thumb up! Thank you!
I have to say that after a whole afternoon reading the documentation and messing up my host I had so many configs tested that nothing was working for me, your explanation brought me back to my senses!!! Thanks, you just gained a sub!
I was on the brink of giving up on Promox until I watched this. This video should be part of the Wiki. Thank you so much. Now I can setup my homelab :)
Thank you for the support and the comment if you find something that you thick i could do better or something that i have not covered please leave a comment letting me know
Yes man!!!! Thank you so much!!!! This literally fixed all my issues - can't thank you enough!!! I also migrated from TrueNAS and this should be way easier than it currently is. Thank you so much again!!!
Great Video. Thx for that. I just spent 4 day to figure it out going through numerous tutorials. But non of them covered this subject fully as you have done it. One bit is missing as you have said is you didn't show how to mount the USB drive via fstab so it would be visible and usable after the reboot. I will have to look for that solution as i have turnkey fileserver on my little proxmox box with USB storage connected to it where i have my files. But again. Thanks for this tutorial as it is the best as i have seen on the net and covers every aspect of bind mounting.
Many thanks for the video, In my case host directory was a OMV SMB share. So I couldn't chmod and change it right away. Instead had to remount it with 1005:1005 😂
how did you readd the cifs share with the correct id? i normal linux you do it in fstab but in here all the configuration happened in the storage.cnf what is the right way to do it?
@@lidoror In my case, the CIFS drive is also created with a VM (OMV) running on the PVE host, which I wanted to connect to one of my LXC containers So what I did was the following 1. Create a Folder at PVE HOST, and mount the CIFS drive there. ///ns-folder /mnt/ns/folder cifs credentials=/mnt/ovm/.creds,vers=3.0,uid=1005,gid=1005 0 0 2. Then I follow this video to make a bind mount of my /mnt/ns/folder into the LXC container. I referred to this video and the document. Used the configuration as it is. (Link is there in the video description ☝) Finally, execute the following command chown -R 1005:1005 /mnt/bindmounts/shared Then you will able to write to the share within LXC. 👌
what is the significance of 1005? I can see and edit files from the samba sevrver (turnkey fileshare) now but on the client side it's can't be read, the test.txt inside the folder is unknown file type what else is needed to have the drive accessible for samba share. I would also like to share the same drive with a media server, and others like file backup. the drive I'm sharing is ext4 filesystem Update: I figured it out, just as I thought. 1005 is userid and groupid you need to use, in my case it doesn't exist, the guide is not clear about that. I needed to use 1000. I swapped 1005 for 1000 and now I can read and write on the samba client side.
Nice Video👍Got some trouble setting this up, but now it works more or less. I use it to connect a NFS from my NAS to a container, but to get it going I needed to add nfsvers=4 to the mount command. After that it works but it tells me "mount: bad usage". Any idea what im doing wrong?
I am sorry I don't :( this post might help forum.proxmox.com/threads/tutorial-mounting-nfs-share-to-an-unprivileged-lxc.138506/ you could also mount the NFS to Proxmox and pass it in by falling the video
Good lord I get all the way the the end and everything was fine then see your mounting a USB I can’t figure out that last command but for a network drive
So I tried this with my external HDD which already had NTFS partition but didn't work. Maybe it won't work with NTFS? But the main problem is that I locked myself out of the container. My root login won't work anymore. Any help please?
This worked for me until I got to the point of changing the owner to 1005. I was not able to execute "chown -R 1005:1005 /path/path. I am using a TrueNAS NFS share and the solution was to go into the TrueNAS NFS share settings and set "Maproot User" to "root"
Can I use the web interface to mount a NAS smb into a container (e.g. for media files to be accessible inside the container/ for the container to save into the NAS)?
Hiya! Coming from the other video :) Great video and guide! It's funny this is the part that I figured out last night and got it working perfectly. In my case I have a ZFS pool that is mounted to a priviledged container (For SAMBA Access) and to a unpriviledge container. After making the changes and confirming I could read/write, I proceeded to get docker and docker compose up and running. I've been trying to get radarr / sonarr up and running. Tried via docker and also with a .yml. Upon creation, I am unable to use the apps to access the mounted locations within the container inside the unpriviledge lxc... I think I might have an issue with permissions at the docker container level? Any suggestion is appreciated!
I just tried this and it worked here is the lines that I added to my docker file RUN groupadd -g 1005 customgroup && \ useradd -u 1005 -g 1005 customuser USER customuser
I was unable to get this working. I cannot give access to the users and apps within the cotnainer to my external storage. I've decided to try a different approach by segmenting my services depending on which needs access to storage (as priviledged LXC) and those that do not (as unpriviledged LXC). @@virtualizeeverything
Step 1 do all of that. Step 2 a few days down the line. Unplug your drives and power down your server to do a bit of service maintenance on your hardware, plug your drives back up, power on and boom ... its no longer mounted. LOL.. Isn't it better to mount by UUID?
It boggles my brain why Proxmox developers still allow the adding of disk drives to be so overly complicated or fiddly. All people want to be able to do is plug a drive up have the OS detect it and provide us with simple method to pass them to a VM or LXC. In the current state of things in Proxmox people have more chance of butchering their existing data or crippling the Proxmox install trying to do a task that should be simple.
I'm a linux beginner and struggled when chown executed without error but did not successfully change the ownership, ownership remained root. I learned that NTFS doesn't support it. Instead you need to set the ownership in /etc/fstab for the entire partition. e.g. UUID="xxxxxx" /mnt/folder ntfs user,exec,uid=1005,gid=1005,rw 0 1
Ugh. Should have watched the whole video first. This was covered immediately after where I got stuck. Now I'm having huge io delay on this drive making it unusable. Struggling to solve that...
Here we go. Since Proxmox is not support this kind of mount in GUI yet, your explanation here is a brilliant! This approach much efficient than network sharing between VMs/CTs. Thank you very much, wish you all the best!
Gotta tell ya I've been wrestling with this on and off for months now. This video was the breakthrough I needed. My only regret is that the like button only has one thumb up! Thank you!
I am so glad we could help
I have to say that after a whole afternoon reading the documentation and messing up my host I had so many configs tested that nothing was working for me, your explanation brought me back to my senses!!! Thanks, you just gained a sub!
your welcome
This was exactly what I was looking for. Great information! Now I have a great setup with my old drives. :)
Glad I could help!
Like how you're showing more advanced stuff in Proxmox, subbed.
Thanks for the sub! I try to mix some advanced stuff in and it has been doing better so you will see more
I was on the brink of giving up on Promox until I watched this. This video should be part of the Wiki.
Thank you so much. Now I can setup my homelab :)
Thank you for the support and the comment if you find something that you thick i could do better or something that i have not covered please leave a comment letting me know
Yes man!!!! Thank you so much!!!! This literally fixed all my issues - can't thank you enough!!! I also migrated from TrueNAS and this should be way easier than it currently is. Thank you so much again!!!
so glad that we could help thank you for the comment
AWESOME Video!!! Thanks!!! It worked for me and the explanations where easy to follow
You're welcome! Thank you for the comment
OMG thank you so much for explaining the bind mount stuff - now I can have an unprivileged lxc
thank you for the comment
Best explanation I could find regarding this, Thank you!!!!!
it was really hard to find info when i was making this video to glad it has help you.
Exactly what I was looking for! Thank you.
Great Video. Thx for that. I just spent 4 day to figure it out going through numerous tutorials. But non of them covered this subject fully as you have done it. One bit is missing as you have said is you didn't show how to mount the USB drive via fstab so it would be visible and usable after the reboot. I will have to look for that solution as i have turnkey fileserver on my little proxmox box with USB storage connected to it where i have my files.
But again. Thanks for this tutorial as it is the best as i have seen on the net and covers every aspect of bind mounting.
Thank you for the support and comment
Isn't it called 'Bind Mount'?
As it’s called in the video @00:05 😂
Exactly what I needed, thanks!
do you have to change the user on the lxc to 1005 or am I missing something?
Brilliant, I can put my HDD and mount my music files, thanksss!
Many thanks for the video, In my case host directory was a OMV SMB share. So I couldn't chmod and change it right away. Instead had to remount it with 1005:1005 😂
Glad this video helped you get you project up and running
how did you readd the cifs share with the correct id?
i normal linux you do it in fstab but in here all the configuration happened in the storage.cnf
what is the right way to do it?
@@lidoror In my case, the CIFS drive is also created with a VM (OMV) running on the PVE host, which I wanted to connect to one of my LXC containers So what I did was the following
1. Create a Folder at PVE HOST, and mount the CIFS drive there.
///ns-folder /mnt/ns/folder cifs credentials=/mnt/ovm/.creds,vers=3.0,uid=1005,gid=1005 0 0
2. Then I follow this video to make a bind mount of my /mnt/ns/folder into the LXC container.
I referred to this video and the document. Used the configuration as it is. (Link is there in the video description ☝)
Finally, execute the following command
chown -R 1005:1005 /mnt/bindmounts/shared
Then you will able to write to the share within LXC. 👌
@@anamixnetwork8446 did you map it in the fstab?
Because in the proxmoz web ui you can’t change the id
what is the significance of 1005? I can see and edit files from the samba sevrver (turnkey fileshare) now but on the client side it's can't be read, the test.txt inside the folder is unknown file type what else is needed to have the drive accessible for samba share. I would also like to share the same drive with a media server, and others like file backup. the drive I'm sharing is ext4 filesystem
Update: I figured it out, just as I thought. 1005 is userid and groupid you need to use, in my case it doesn't exist, the guide is not clear about that. I needed to use 1000. I swapped 1005 for 1000 and now I can read and write on the samba client side.
Thank you!!!!
I wonder if setting the container as privileged will help skipping the whole permissions process?
Nice Video👍Got some trouble setting this up, but now it works more or less. I use it to connect a NFS from my NAS to a container, but to get it going I needed to add nfsvers=4 to the mount command. After that it works but it tells me "mount: bad usage". Any idea what im doing wrong?
I am sorry I don't :( this post might help forum.proxmox.com/threads/tutorial-mounting-nfs-share-to-an-unprivileged-lxc.138506/ you could also mount the NFS to Proxmox and pass it in by falling the video
14:50 why does this work? Because 1005 is not a valid GID if I look at: cat /etc/group, am I missing something?
Good lord I get all the way the the end and everything was fine then see your mounting a USB I can’t figure out that last command but for a network drive
So I tried this with my external HDD which already had NTFS partition but didn't work. Maybe it won't work with NTFS? But the main problem is that I locked myself out of the container. My root login won't work anymore. Any help please?
appreciate the video thank you. If I wanted to share that Storage on the container, over the network, is there some way I could do that ?
This worked for me until I got to the point of changing the owner to 1005. I was not able to execute "chown -R 1005:1005 /path/path. I am using a TrueNAS NFS share and the solution was to go into the TrueNAS NFS share settings and set "Maproot User" to "root"
Good to know.
Can I use the web interface to mount a NAS smb into a container (e.g. for media files to be accessible inside the container/ for the container to save into the NAS)?
As of the last time that I tried no. if you are using smb why not just mount in the lxc?
@@virtualizeeverything as far as I can tell, there's no way to do it with an unprivileged container. I might be wrong?
From everything I could find there is not, only NFS drives
Why 0, 1005, 1006, 65535 and 100000?
did i misunderstand this or did you just bypas the unprivileged option by making your container a real root?
exactly what i was looking for but still dont understand whats going on
Hiya! Coming from the other video :) Great video and guide! It's funny this is the part that I figured out last night and got it working perfectly. In my case I have a ZFS pool that is mounted to a priviledged container (For SAMBA Access) and to a unpriviledge container.
After making the changes and confirming I could read/write, I proceeded to get docker and docker compose up and running. I've been trying to get radarr / sonarr up and running. Tried via docker and also with a .yml. Upon creation, I am unable to use the apps to access the mounted locations within the container inside the unpriviledge lxc... I think I might have an issue with permissions at the docker container level? Any suggestion is appreciated!
I have not tried this but maybe try making a user and a group in the docker file with the id in my case 1005
I just tried this and it worked here is the lines that I added to my docker file
RUN groupadd -g 1005 customgroup && \
useradd -u 1005 -g 1005 customuser
USER customuser
@@virtualizeeverything sweet I'll try it out and test it when I get back home. Thank you!
I just got home and trying to figure out where this dockerfile is (sorry I'm not that experience with it yet).
I was unable to get this working. I cannot give access to the users and apps within the cotnainer to my external storage. I've decided to try a different approach by segmenting my services depending on which needs access to storage (as priviledged LXC) and those that do not (as unpriviledged LXC). @@virtualizeeverything
Step 1 do all of that.
Step 2 a few days down the line. Unplug your drives and power down your server to do a bit of service maintenance on your hardware, plug your drives back up, power on and boom ... its no longer mounted. LOL..
Isn't it better to mount by UUID?
It boggles my brain why Proxmox developers still allow the adding of disk drives to be so overly complicated or fiddly. All people want to be able to do is plug a drive up have the OS detect it and provide us with simple method to pass them to a VM or LXC. In the current state of things in Proxmox people have more chance of butchering their existing data or crippling the Proxmox install trying to do a task that should be simple.
I'm a linux beginner and struggled when chown executed without error but did not successfully change the ownership, ownership remained root. I learned that NTFS doesn't support it. Instead you need to set the ownership in /etc/fstab for the entire partition.
e.g. UUID="xxxxxx" /mnt/folder ntfs user,exec,uid=1005,gid=1005,rw 0 1
Ugh. Should have watched the whole video first. This was covered immediately after where I got stuck. Now I'm having huge io delay on this drive making it unusable. Struggling to solve that...