Passing Storage to a Container Getting Started with Proxmox 8

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ส.ค. 2023
  • This video shows the viewer how to use a Proxmox tool called Blind Mount to pass storage from the host Proxmox system to a Container ( LXC ) ( CT )
    File for ct conf
    /etc/pve/lxc/1234.conf
    Mount point line
    mp0: /mnt/bindmounts/shared,mp=/shared
    uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), so 0..1004 (ct) → 100000..101004 (host)
    lxc.idmap = u 0 100000 1005
    lxc.idmap = g 0 100000 1005
    we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
    lxc.idmap = u 1005 1005 1
    lxc.idmap = g 1005 1005 1
    we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
    lxc.idmap = u 1006 101006 64530
    lxc.idmap = g 1006 101006 64530
    File and map for user and group id
    /etc/subuid
    /etc/subgid
    root:1005:1
    command to set 1005 as user and group id
    chown -R 1005:1005 /mnt/bindmounts/shared
    Proxmox wright up
    pve.proxmox.com/wiki/Unprivil...
    Mount Command
    mount -t exfat -o uid=1005,gid=1005 /dev/sdX1 /mnt/usb
    fstab path
    /etc/fstab
    fstab command
    /dev/sdX1 /mnt/usb exfat uid=1005,gid=1005 0 1
    Links in our description may be affiliate links which help our channel grow.
    Become a Patreon:
    / virtualizeeverything
    Check out our new merch store:
    store.virtualizeeverything.com/
    Gear we use:
    virtualizeeverything.com/gear...
    Fuel our coffee cravings:
    BTC: bc1qmqe5n7pnep95dzknh48yf3x3c70wcf0r3jvd0x
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 56

  • @noblesknight8942
    @noblesknight8942 2 วันที่ผ่านมา

    Exactly what I was looking for! Thank you.

  • @RomanTruman
    @RomanTruman 9 หลายเดือนก่อน +4

    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!

  • @bomblaster42
    @bomblaster42 8 หลายเดือนก่อน +5

    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!

  • @rauleduardosantiestebanmor6928
    @rauleduardosantiestebanmor6928 6 หลายเดือนก่อน +2

    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!

  • @pittgikera
    @pittgikera 2 หลายเดือนก่อน +1

    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 :)

    • @virtualizeeverything
      @virtualizeeverything  2 หลายเดือนก่อน

      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

  •  10 หลายเดือนก่อน +2

    Exactly what I needed, thanks!

  • @BeachChimp
    @BeachChimp 4 หลายเดือนก่อน +1

    This was exactly what I was looking for. Great information! Now I have a great setup with my old drives. :)

  • @realifejon
    @realifejon 23 วันที่ผ่านมา +1

    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!!!

    • @virtualizeeverything
      @virtualizeeverything  20 วันที่ผ่านมา +1

      so glad that we could help thank you for the comment

  • @jSirBrickzAlot
    @jSirBrickzAlot 5 หลายเดือนก่อน +1

    Like how you're showing more advanced stuff in Proxmox, subbed.

    • @virtualizeeverything
      @virtualizeeverything  5 หลายเดือนก่อน

      Thanks for the sub! I try to mix some advanced stuff in and it has been doing better so you will see more

  • @chrisramos3081
    @chrisramos3081 3 หลายเดือนก่อน

    Best explanation I could find regarding this, Thank you!!!!!

    • @virtualizeeverything
      @virtualizeeverything  2 หลายเดือนก่อน

      it was really hard to find info when i was making this video to glad it has help you.

  • @kirksteinklauber260
    @kirksteinklauber260 4 หลายเดือนก่อน +1

    AWESOME Video!!! Thanks!!! It worked for me and the explanations where easy to follow

  • @rvkasper
    @rvkasper 5 หลายเดือนก่อน +1

    OMG thank you so much for explaining the bind mount stuff - now I can have an unprivileged lxc

  • @anamixnetwork8446
    @anamixnetwork8446 หลายเดือนก่อน

    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 😂

    • @virtualizeeverything
      @virtualizeeverything  หลายเดือนก่อน

      Glad this video helped you get you project up and running

  • @warrenbradley4962
    @warrenbradley4962 8 หลายเดือนก่อน +4

    do you have to change the user on the lxc to 1005 or am I missing something?

  • @piotrlisiecki1936
    @piotrlisiecki1936 11 หลายเดือนก่อน +2

    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.

  • @europa7533
    @europa7533 10 หลายเดือนก่อน

    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 ?

  • @gluetubeserver
    @gluetubeserver 6 หลายเดือนก่อน +13

    Isn't it called 'Bind Mount'?

    • @christophzeeb7957
      @christophzeeb7957 3 หลายเดือนก่อน

      As it’s called in the video @00:05 😂

  • @thatguywiththe
    @thatguywiththe 11 หลายเดือนก่อน

    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!

    • @virtualizeeverything
      @virtualizeeverything  11 หลายเดือนก่อน +1

      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

    • @virtualizeeverything
      @virtualizeeverything  11 หลายเดือนก่อน +2

      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

    • @thatguywiththe
      @thatguywiththe 11 หลายเดือนก่อน

      @@virtualizeeverything sweet I'll try it out and test it when I get back home. Thank you!

    • @thatguywiththe
      @thatguywiththe 11 หลายเดือนก่อน

      I just got home and trying to figure out where this dockerfile is (sorry I'm not that experience with it yet).

    • @thatguywiththe
      @thatguywiththe 11 หลายเดือนก่อน

      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

  • @0x0081
    @0x0081 7 หลายเดือนก่อน +1

    I wonder if setting the container as privileged will help skipping the whole permissions process?

  • @benediktwichmann5294
    @benediktwichmann5294 5 หลายเดือนก่อน +1

    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?

    • @virtualizeeverything
      @virtualizeeverything  5 หลายเดือนก่อน

      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

  • @DerBarde2012
    @DerBarde2012 9 หลายเดือนก่อน

    did i misunderstand this or did you just bypas the unprivileged option by making your container a real root?

  • @TheDropForged
    @TheDropForged 3 หลายเดือนก่อน

    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?

  • @balsalmalberto8086
    @balsalmalberto8086 5 หลายเดือนก่อน

    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.

  • @petermarin
    @petermarin 8 หลายเดือนก่อน

    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)?

    • @virtualizeeverything
      @virtualizeeverything  8 หลายเดือนก่อน +1

      As of the last time that I tried no. if you are using smb why not just mount in the lxc?

    • @petermarin
      @petermarin 8 หลายเดือนก่อน

      @@virtualizeeverything as far as I can tell, there's no way to do it with an unprivileged container. I might be wrong?

    • @Montagic
      @Montagic 7 หลายเดือนก่อน

      From everything I could find there is not, only NFS drives

  • @eriksalo5550
    @eriksalo5550 8 หลายเดือนก่อน +1

    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"

  • @mcmormus
    @mcmormus 3 หลายเดือนก่อน

    exactly what i was looking for but still dont understand whats going on

  • @monty9242
    @monty9242 2 หลายเดือนก่อน

    Why 0, 1005, 1006, 65535 and 100000?

  • @ecotts
    @ecotts หลายเดือนก่อน

    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?

  • @ecotts
    @ecotts หลายเดือนก่อน

    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.

  • @socenthobbs
    @socenthobbs 6 หลายเดือนก่อน

    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

    • @socenthobbs
      @socenthobbs 6 หลายเดือนก่อน

      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...