Proxmox LXC - How To Guide - Better Than A VM?

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 136

  • @todomal-ho5no
    @todomal-ho5no 9 місяців тому +61

    Thank you so much for sharing your knowledge. I have to add that, for a non-English speaker like me, your cadence in speaking and your pronunciation help a lot to understand what you are saying. Good job. 👍

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +6

      Thanks, I really appreciate the feedback

    • @eygs493
      @eygs493 6 місяців тому

      none of what you showed worked at all, web UI is a complete mess, when i try to create lxc container, the next button greyed out, NO MATTER what i do, i have given it hostname/passwork, even found pub rsa key file to paste in, NOTHING works. "next" simply CAN NOT be clicked to proceed.

    • @AthelstanEngland
      @AthelstanEngland 2 місяці тому

      To be fair we invented the language so going back to the source makes sense 👍👍 completely unbiased of course! 😂

  • @alphenit
    @alphenit 9 місяців тому +16

    I hear: "Hey everybody...." and I click like! Jim's Garage should have 100k subscribers

  • @SchecterWolfe
    @SchecterWolfe 9 місяців тому +3

    The proxmox forums helped me a ton when I was manually setting up a sandbox container from a custom buildroot image

  • @samfisher3283
    @samfisher3283 16 днів тому +1

    Your way of explaining technical concepts is insanely good and I really enjoy listening to you. Thanks for the effort and keep going!

    • @Jims-Garage
      @Jims-Garage  16 днів тому

      @@samfisher3283 much appreciated, thanks 👍

  • @cabbagehead8815
    @cabbagehead8815 9 місяців тому +3

    Didn't think I'd be learning from a muckle (MCC) rider! Thanks for sharing your knowledge, see you on the road!

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      Haha, thanks! Keep it shiny side up 🚲

  • @romayojr
    @romayojr 9 місяців тому +7

    excellent easy to follow guide as always. i would be interested to see you setup k3s using lxc

  • @golvellius6855
    @golvellius6855 6 місяців тому +3

    The way you explain things is top notch bro thank you

    • @Jims-Garage
      @Jims-Garage  6 місяців тому

      Thank you, appreciate the feedback.

  • @Liam-r7m
    @Liam-r7m 9 місяців тому +3

    Started watching on the OPNsense setup video and it was very helpful, thank you! I've been wanting to setup Jellyfin in an LXC for GPU transcoding, but it seems like a hassle. Would love a video on it like you mentioned!

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      Thanks, I might do it next. Watch this space.

  • @s0litaire2k
    @s0litaire2k 9 місяців тому +2

    LXC is very useful. I've ran both containers and VMs using LXC (yes including a windows VM) issues is that it's it's great for creating and testing systems locally but it's intentionally a total pain in the posterior to "expose" a container to the network. I did use a rpi3b running alpineOS to run a few basic containers I could access from the internet to test things.

  • @Kevin-oj2uo
    @Kevin-oj2uo 9 місяців тому +6

    I love this Proxmox videos! Keep up the good work!

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      Thanks, I have a few more to tick off at least

  • @markandrow4010
    @markandrow4010 9 місяців тому +2

    Thank you James, As always, excellent and with comprehensive explanations.👌 👍

  • @pitzyper
    @pitzyper Місяць тому +1

    Excellent and very video! It is a great way to deploy light services and using less than 100 MB of RAM. My only observation is the CPU limit. That is useful to restrict the CPU usage to less than the full (2 in this case) cores. For instance, CPU limit of 0.5 will mean that only 50% of 1 core will be the limit, so you don't really need to also set it as 2 as the count will be fully utilized regardless.

    • @Jims-Garage
      @Jims-Garage  Місяць тому +1

      @@pitzyper thanks, good point

  • @elias9725
    @elias9725 9 місяців тому +2

    Was looking forward to this video, your explanations are great!

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      Thanks, I hope it was helpful

  • @sagarsriva
    @sagarsriva 9 місяців тому +2

    Thanks. Great video

  • @wusaby-ush
    @wusaby-ush 9 місяців тому +2

    Thank you for this

  • @malzbier1339
    @malzbier1339 9 місяців тому +2

    Very good, as usual 👍🏻.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      Thanks, I appreciate the feedback

  • @philbos6232
    @philbos6232 9 місяців тому +2

    This is so scary every time I’m working with any product, Jim comes around the corner and makes a video about it. Superb!
    I would really want a guide to install ansible awx on a single node k3s LXC without much hassle, is this even possible? I tried multiple guides with no luck

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      K3S is possible on LXC, I'll have a look at it.

  • @masterserge
    @masterserge Місяць тому +1

    Jim love the videos and the way you explain things makes it easy to follow. Have you had a chance to look into using xcp-ng hypervisor with Incus and lxc? Would love to see a video on that and your thoughts.

    • @Jims-Garage
      @Jims-Garage  Місяць тому

      I played with it briefly but it seems to be geared for scale. I might cover it in the future.

  • @blender_wiki
    @blender_wiki 9 місяців тому +1

    Why do people always think in "better" or "worse" terms? Please do not implement clickbite titles on your channel.
    Things are just different, something can be more efficient in some kind situations but not in certain use cases.
    Besides this good educational video, I will share this to my students. 🙏🙏

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +2

      Appreciate the feedback. The title is reflective of a question that is frequently asked and I do believe there is a better choice in every situation, hopefully I called that out. E.g., internal Vs external, resources, performance.

  • @YokoOHHNoo
    @YokoOHHNoo 9 місяців тому +3

    I recently set up an dedicated game server for the game Enshrouded in Proxmox, alas it's pretty resource hungry. My first try in a VM was very disappointing. I have an Ryzen 4300G running my homelab and i gave the VM 8 vCPUs (so one for each physical thread) and 16 GB RAM.
    The gaming experience for one connected player was O.K'ish but for three ore more it was unusable.
    I then switched to a (privileged) LXC also 8 vCPUs but only 8 GB RAM (the game is more CPU than memory hungry). The gaming experience is much(!) better. Now gaming with 3 or 4 players is possible.
    Nonetheless the Enshrouded dedicated Server is pretty bad performing it consumes almost half of my Homelab which was not the case with other game servers like Valheim e.g.! But yes there are performance gains when using LXC in such "extreme" situations!

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      That's great feedback, thanks. Definitely something to consider if you're looking for high performance.

  • @MaxLeeIT
    @MaxLeeIT 9 місяців тому +2

    Thanks for this video and the lovely face

  • @jerrinho23
    @jerrinho23 8 місяців тому +2

    excelent!

  • @adolfolopez126
    @adolfolopez126 9 місяців тому +2

    Yes do a video on igpu passthru

  • @GeorgeHirst93
    @GeorgeHirst93 2 місяці тому +1

    Hi Jim, I've just stumbled across your videos, and this looks really useful. You mentioned about default SSH keys from when you spun up Proxmox. Could you point me to the video you mention this? I can't see anything obvious at the moment but I'll keep digging

    • @Jims-Garage
      @Jims-Garage  2 місяці тому +1

      @@GeorgeHirst93 I have a video on cloud init templates, that's probably the right one

    • @GeorgeHirst93
      @GeorgeHirst93 2 місяці тому +1

      @@Jims-Garage amazing! Thanks

  • @fedefede843
    @fedefede843 9 місяців тому +1

    Nice!
    My only concern here is how the lifecycle is. When using docker I have watchtower for many of my containers and for the critical ones it is just a manual docker compose pull (or the Portainer GUI).
    Let's say a move them all to individual LXC containers. Now what? I've seen many of these videos, but no one addresses this important fact.
    Cheers!

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      No, install docker on LXC. Use docker as normal

    • @fedefede843
      @fedefede843 9 місяців тому +1

      @@Jims-Garage that is ok. That could be the best of both worlds. I have read different opinions on installing docker on LXC, but I guess it is a matter of trying it.
      Do you use it like that or have docker on top of a VM? In my case if I am going to have most of my services in a single environment, it could be just a VM. Since I am not splitting out too much else, why bother. I haven't reached the kubernetes world yet, but I'm looking forward to it.
      Cheers

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +3

      @@fedefede843 I predominantly use Kubernetes on VMs and have a solo docker VM. I am likely to shift over to LXC in the near future as I want to share my GPU with all containers. I'll do a video on the journey.

  • @afnieves
    @afnieves 9 місяців тому +2

    Can you show a video on the iGPU and jellyfin. I have this setup on a NUC got all the configuration working but jellyfin cant transcode.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      It should be exactly the same but 128 instead of 129. Have you tried that?

    • @afnieves
      @afnieves 9 місяців тому

      lxc.cgroup2.devices.allow: c 226:0 rwm
      lxc.cgroup2.devices.allow: c 226:128 rwm
      lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
      lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
      lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
      lxc.idmap: u 0 100000 65536
      lxc.idmap: g 0 100000 44
      lxc.idmap: g 44 44 1
      lxc.idmap: g 45 100045 61
      lxc.idmap: g 106 103 1
      lxc.idmap: g 108 100108 65428
      @@Jims-Garage

    • @afnieves
      @afnieves 9 місяців тому

      Yes I have@@Jims-Garage

  • @fugixi
    @fugixi 3 місяці тому +1

    From a management and monitoring perspective, what do you prefer to use, Docker or LXC?
    I like the idea of using LXC as each service will be visible/exposed directly in the Proxmox GUI, but I suppose the Portainer, Rancher etc. could solve the monitoring part when using Docker.

    • @Jims-Garage
      @Jims-Garage  3 місяці тому +1

      I prefer docker in a VM (albeit most of my stuff is in Kubernetes)

    • @fugixi
      @fugixi 3 місяці тому +1

      @@Jims-Garage Maybe an idea for another video, detailing pros and cons, your preferences and why, management etc. :)

  • @ziozzot
    @ziozzot 9 місяців тому +4

    I woud like to see K3s on LXC

  • @Christian-o7j2t
    @Christian-o7j2t 20 днів тому +1

    Hey there. I've been trying to get this working but no success so far. I run a Windows 11 minisforum and on that, created a Proxmox-VM with Hyper-V. In the Proxmox-VM I created a container to install pihole. However, I'm not getting that far. Proxmox can ping everything, everything can ping Proxmox. But for some unkown reason, I can't update the container nor ping anything except Proxmox. It seems as if Proxmox doesn't let the signal "out". I tried with static IP and DHCP, nothing worked. The router would be my FritzBox, it aknowledges Proxmox, no issue there. No idea what I can still do -.-

  • @hotrodhunk7389
    @hotrodhunk7389 9 місяців тому +2

    I've overtime moved all of my VMs to be LXC. They just do everything so quick. Boot in seconds so small easy to back up and migrate.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      Yes, they're extremely performant. It's a great benefit.

  • @samsonsamson9820
    @samsonsamson9820 9 місяців тому +2

    Thank you for your video.
    How to create an LXC container with docker or k3s?

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      Docker , just install as I did. K3S, coming soon

    • @denniskluytmans
      @denniskluytmans 9 місяців тому

      Docker is easy, docker swarm is the problem with nfs shares

  • @Felix-ve9hs
    @Felix-ve9hs 9 місяців тому +1

    11:24 AFAIK your LXCs will use the swap space of your Proxmox VE host, if it doesn't have swap set up, the LXC will likely get killed trying to allocate any swap.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      Good to know, I'll have to experiment. Thanks for the comments.

  • @peteradshead2383
    @peteradshead2383 9 місяців тому +1

    One problem you may hit if you are on AMD and passing hardware acceleration to jellyfin or frigate , to pass your GPU with PCIe passthrough you blacklist nvidia and radeon , amdgpu drivers etc.
    So stopped the hardware acceleration from the GPU until I removed the radeon & amdgpu from the blacklist.

    • @pabloszi
      @pabloszi 9 місяців тому

      Hmmm... With LXC you don't need to passthru PCI-e devices. You can share it between your desired LXC, Proxmox OS and other LXCs you want.

    • @peteradshead2383
      @peteradshead2383 9 місяців тому

      @@pabloszi you don't , BUT if you do pass a full PCI-e device to a VM don't disable the inbuilt iGPU at the same time.
      I pass iGPU hardware encoding / decoding to a Frigate & Jellyfin LXCs , but have a VM with my RTX2070 super to use for tdarr.

    • @pabloszi
      @pabloszi 9 місяців тому

      @@peteradshead2383 That's right. It works as you described with VM, but LXC isn't VM. LXC is Linux container, and you can't passthru PCI cards to LXC. Instead of this you can share devices between Proxmox host and LXCs.

  • @Felix-ve9hs
    @Felix-ve9hs 9 місяців тому +1

    1:09 This is true, however, it is possible to run a Linux userland in a FreeBSD jail :^)

  • @williambravin1254
    @williambravin1254 6 місяців тому +1

    Hi Good video and teaching. Question (maybe a leter video) can i create 1 lxc and install 1 instance of docker and within this environment have multiple applications such as pihole and tailscale? or will i need to make seperate lxc?

    • @Jims-Garage
      @Jims-Garage  6 місяців тому

      Check the next videos 😁

  • @zyghom
    @zyghom 9 місяців тому +1

    I have started with Proxmox with VMs only as it was much easier to work with (for the newbie like me).
    But now, I move almost everything to LXC.
    Lighter but most importantly: I feel much better with IP management - rather than assigning MACVLAN in docker (in VM).
    Sharing the storage sometimes is an issue but once you know how to it is easy.
    But still there is a place for VMs there.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      Absolutely, both have strengths and weaknesses. As always, a blend is usually best.

  • @dzmelinux7769
    @dzmelinux7769 9 місяців тому +1

    Good video, as much as I know another difference is that VMs restart automatically after migration (cluster) and LXC container have to be started manually, right?

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      I'll have to check. I know they can auto start on creation.

  • @InsaiyanTech
    @InsaiyanTech 9 місяців тому

    Could I run the a arr stack on a lxc container and docker with trafik and stuff like you did with the VMs in the previous series?

  • @monish05m
    @monish05m 9 місяців тому +1

    Amazing guide as usual.
    One question, is it possible to pass through individual disks to an lxc, not just mount point, the entire hard disk?

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      Yes, albeit I think we need to be careful with wording. My understanding is that you're giving the LXC access to the device, not passing it through like a VM. As such, the host can see it as well as other LXCs if you allow it. This is how I'm able to share a single GPU with 3 LXCs.

    • @monish05m
      @monish05m 9 місяців тому

      @@Jims-Garage i was also able to pass through my nvidia gpu to lxc using cgroups in the .conf file, the thing is the same method would not work for disks for some reason, the disk just wont be listed under /dev/disk/by-id/ , if you had any luck please pass the knowledge.

  • @meandthemrs896
    @meandthemrs896 9 місяців тому +1

    Would you consider doing a video on utilising LXC container for something like Radarr using the helper templates - I tried this but had lots of issues with access rights writing to shared storage ?

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      Probably not as UA-cam isn't a fan of those topics... I suspect it's a simple case of permissions though.

    • @meandthemrs896
      @meandthemrs896 9 місяців тому +2

      How about making a shared drive available to a container. My issue is being asked multiple times without a good answer 😊

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      @@meandthemrs896 check here for a cifs example - forum.proxmox.com/threads/tutorial-unprivileged-lxcs-mount-cifs-shares.101795/page-4

    • @meandthemrs896
      @meandthemrs896 9 місяців тому

      Tried it all commands worked but still read only. I think I have an issue making sure the LXC uses the right user account when running - it does mention username depends on application

  • @NFvidoJagg2
    @NFvidoJagg2 9 місяців тому

    I've run the turnkey-gitea template and I've found the they tend to leg behind in software updates, by a few versions.

  • @2bitninja280
    @2bitninja280 9 місяців тому

    Reminds me of Solaris Zones

  • @InSaiyan-Shinobi
    @InSaiyan-Shinobi 9 місяців тому +1

    So can I run docker in lxc and do the same setup you do on a vm setup like for jellyfin radar sonar and so on for it? But would you want to do on a lxc this way since I heard it’s not as secured as doing it on a VM

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      That is what I demonstrated, Jellyfin on Docker with GPU passthrough in a unprivileged LXC.

    • @InSaiyan-Shinobi
      @InSaiyan-Shinobi 9 місяців тому

      @@Jims-Garage oh ok I just wanted to make sure so ima just follow this thanks 😊

  • @produKtNZ
    @produKtNZ 9 місяців тому +1

    If I wanted to spin up a wordpress website, hosting around 80-400 gb per month, VM or Container ?

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      VM, better isolation IMO

  • @74357175
    @74357175 9 місяців тому +1

    Excellent. Question: how much thinner is an LXC vs a VM? That is to say, if a Debian install as a VM is X megabytes, how much smaller is the LXC install?

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +3

      About 20x smaller

    • @peteradshead2383
      @peteradshead2383 9 місяців тому

      Well I have a SMB server with Webmin on 81k of ram , netboot-xyz on 81k , and jellyfin on 374k , so most programs only need 512k or less , try running a running jellyfin on a 512k VM .

  • @---GOD---
    @---GOD--- 9 місяців тому +3

    Jump to 5:00
    You're welcome

  • @sinanfr
    @sinanfr Місяць тому

    For the ref !

  • @codescholar7345
    @codescholar7345 5 місяців тому +1

    Hi there! How can I get an unprivileged LCX with a GUI setup? Thanks!

    • @Jims-Garage
      @Jims-Garage  5 місяців тому

      You'll need to deploy a desktop image and then use a remote desktop application. It doesn't give a great user experience though (I find Linux remote desktops not great with Windows).

    • @codescholar7345
      @codescholar7345 5 місяців тому

      @@Jims-Garage Thanks for the reply! In your 1 gpu 4 LXC it seems like you have a GUI LXC. Basically I'd like a web browser in their own container. I have this now but use VMs. What if I deploy a desktop image to the LXC and then use a remote desktop application like spice or something? Or do I need to use a VM to deploy multiple browsers like I'm doing now (seems kind of inefficient)? Thanks!

    • @Jims-Garage
      @Jims-Garage  5 місяців тому

      @@codescholar7345 you could deploy chrome in docker if you prefer github.com/browserless/browserless

    • @codescholar7345
      @codescholar7345 5 місяців тому

      ​@@Jims-Garage Okay, I'll check it out! Would the docker containers be unprivileged and secure? How did you get jellyfin running in the LXC containers? I watched the video, I'm wondering if I missed that part. If you have time I'm also wondering about a Proxmox system with a 5950x, 3090 and Intel Arc a380 or a750. Could I passthrough the 3090 to a VM and try to split the Intel Arc (running as the main GUI) between containers or VMs. I tried passing through the 3090 to a VM but since i dont have integrated graphics or a second graphics card the VM would not start. Thanks!

    • @Jims-Garage
      @Jims-Garage  5 місяців тому

      @@codescholar7345 jump on Discord, all of this is doable.

  • @TrashMinerHDTV
    @TrashMinerHDTV 2 місяці тому +1

    Where can I find my SSH Key?

    • @Jims-Garage
      @Jims-Garage  2 місяці тому

      It's in the root folder on Proxmox. Alternatively you can generate and use your own.

  • @Mr_nah
    @Mr_nah 9 місяців тому

    Is there a way to upgrade an OS in a container? I don't think do-distr upgrade works

  • @typingcat
    @typingcat 5 місяців тому +1

    I don't know why but so many Englishmen seem to have this exact voice.

    • @Jims-Garage
      @Jims-Garage  5 місяців тому

      Interesting observation. I'm from the middle of the UK originally and nowhere else in the country sounds like that to me. I now live somewhere very different 😂

  • @ierosgr
    @ierosgr 9 місяців тому +1

    At 7:58 you ve mentioned you were going to be using a non root user. At 13:25 you re logging in as root.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому +1

      I'm root on the LXC, but in a separate namespace on the host. If privileged you're using the host namespace which is bad. You can create another user on the LXC like any regular Linux distro

    • @ierosgr
      @ierosgr 9 місяців тому +1

      @@Jims-Garage The other way I thought of this was like the root inside the LXC is alias of another user of the host which automatically generates upon LXC creation. It just happens to have the root name.

  • @loermik
    @loermik 8 місяців тому

    lovely face 😄

  • @RajinderYadav
    @RajinderYadav 9 місяців тому +1

    why not just use kvm, most linux system already come with this and it's pretty easy to setup and use it.

    • @Jims-Garage
      @Jims-Garage  9 місяців тому

      No reason not to, I simply prefer the convenience and quality of life additions from Proxmox.

    • @LehmannMr
      @LehmannMr Місяць тому

      Proxmox offers a web Interface to administer everything.

  • @eygs493
    @eygs493 6 місяців тому +1

    none of what you showed worked at all, web UI is a complete mess, when i try to create lxc container, the next button greyed out, NO MATTER what i do, i have given it hostname/passwork, even found pub rsa key file to paste in, NOTHING works. "next" simply CAN NOT be clicked to proceed.

    • @Jims-Garage
      @Jims-Garage  6 місяців тому +1

      Have you enabled virtualisation in the bios?

    • @eygs493
      @eygs493 6 місяців тому

      @@Jims-Garage i am not sure what you mean by that, you mean enable it from the proxmox web interface? not the host machine right? how exactly should I do that? everything else was followed in this video, and proxmox was up to date through ssh before any attempt to create new container

    • @eygs493
      @eygs493 6 місяців тому

      @@Jims-Garage was there anything to do with the cli ? that i ssh into proxmox host, or you are purely speaking about its web UI

    • @eygs493
      @eygs493 6 місяців тому

      @@Jims-Garage if you either give me instruction, or link to the doc, i will read it, other than that, this is what happened, and i followed every steps of your videos and proxmox is all up to date

    • @eygs493
      @eygs493 6 місяців тому

      @@Jims-Garage wait i know, i was creating vms on the same machine, vms are easy, and it works, its just sluggish so much, so yes, i believe the virtualisation IS enabled

  • @eygs493
    @eygs493 5 місяців тому +1

    this is the worst i ever seen, why do you skip so many details?

  • @eygs493
    @eygs493 6 місяців тому

    none of what you showed worked at all, web UI is a complete mess, when i try to create lxc container, the next button greyed out, NO MATTER what i do, i have given it hostname/passwork, even found pub rsa key file to paste in, NOTHING works. "next" simply CAN NOT be clicked to proceed.

    • @jovtoly1
      @jovtoly1 2 місяці тому

      Did you download a template? Try rewatching from 6:00

  • @eygs493
    @eygs493 6 місяців тому

    none of what you showed worked at all, web UI is a complete mess, when i try to create lxc container, the next button greyed out, NO MATTER what i do, i have given it hostname/passwork, even found pub rsa key file to paste in, NOTHING works. "next" simply CAN NOT be clicked to proceed.