LXCs vs VMs - What Was My Rationale?

  Рет қаралды 8,157

DB Tech

DB Tech

Күн бұрын

Пікірлер: 80
@KE8BSM
@KE8BSM 7 ай бұрын
Good points for using LXC’s over VM’s! I’ve seen multiple ways to passthrough hardware to LXC’s. I’d love to see a definitive video on hardware passthrough to LXC’s! Especially for unprivileged LXC’s
@DBTechYT
@DBTechYT 7 ай бұрын
I'm planning on doing some videos on passthroughs and that sort of thing when I get my new HL15. I've already got hardware waiting to be put in it specifically for passthrough content :)
@bps3374
@bps3374 3 ай бұрын
I am also a total fan of LXC. Fast, small and uses little hard disk space. The reason why you install Docker in a VM (should not have to) is the security of the Horst server. We visited the Proxmox developers. When I asked why not Docker in LXC? We were shown how. With one LXC (docker ) you can bring down the entire Proxmox Horst. Nothing happened in a VM. VM containers use more resources, but prevent a total failure of the server. The backup strategy for VMs is snapshots + a weekly full backup (stop mode) in individual operation. Proxmox Backup Server & Cluster Nodes is a separate topic. It was a very impressive seminar with the developer. I apologize for my English, writing in a foreign language on a cell phone is a disaster. Greetings from Germany
@DBTechYT
@DBTechYT 3 ай бұрын
That's good info! Thanks for sharing :)
@jbauson1
@jbauson1 2 ай бұрын
I'm planning to move my Swarm and Kubernetes clusters to LXC. However, I'm curious about what you saw that could potentially crash the Proxmox host. What specifically was shown to you?
@bps3374
@bps3374 2 ай бұрын
@@jbauson1 No instructions on how to crash the software, that is bad for business. For this great software that we can all use privately. So let's change the subject. The question is why in the LXC and not in a VM ?
@jbauson1
@jbauson1 2 ай бұрын
@@bps3374 Well, why not? I'm not using Proxmox for critical workloads-it's more for personal projects like Plex, file servers, and simple experiments that can afford to be offline briefly. For serious production environments, I rely on AWS, Azure, and other cloud providers. I'm not looking for step-by-step instructions, but rather understanding what might cause a crash. Since you mentioned that this issue was presented by Proxmox developers, I'm interested in what they found generally causes crashes. Given that these are Proxmox developers, I assume they have the proper setup and permissions in place for both the LXC containers and the Proxmox installation itself.
@famousartguymeme
@famousartguymeme 28 күн бұрын
@@bps3374 How to conduct the exploit, I need to exercise this exploit in a APT target using proxmox
@PoeLemic
@PoeLemic 12 күн бұрын
How you explained it, is very helpful. I am trying to build my own home lab, so that's why I love your channel. You help make it more understandable and show us that we can do it too.
@donglobal
@donglobal 7 ай бұрын
I like the new yellow backgrounds you are using in your last two videos, it really does make them stand out from the crowd.
@Rockwolf50
@Rockwolf50 7 ай бұрын
Whilst I completely agree with your rationale Dave and do things the same way (and get flamed on Reddit for it), you could restore a single container on a VM. If you go into the interface of PBS and click on the backup of that machine you want to use, you can actually access to the folder structure of that VM and can download folders directly to your desktop, where you could just scp it back in to your VM. I don’t myself, as I prefer the simplicity of LXC containers and splitting all my services out.
@DBTechYT
@DBTechYT 7 ай бұрын
I guess i wasn't aware of that specific method of doing things, but that seems WAY more time consuming and tedious than doing it this way :)
@cease70
@cease70 7 ай бұрын
I had this exact question while watching the video. I like, and would almost say that I prefer, LXC containers to a VM running multiple Docker containers but think there's a balance to be struck between the two. I think I saw/read from another KZbinr I follow (can't remember who it was at the moment) that hosted LXC's for internal-only applications and did a VM with Docker for anything that was exposed to the internet, which probably makes sense from a threat surface standpoint. Great to hear your rationale!
@DBTechYT
@DBTechYT 7 ай бұрын
Thanks!! I appreciate you! :)
@julianmoorhouse1021
@julianmoorhouse1021 7 ай бұрын
Great video and I completely agree with you. I have had one of the containers within a proxmox VM get corrupted by an update, and had to revert to an earlier backup of the whole VM to recover, but that meant I was restoring to an older version of everything else in that VM which was annoying as well. So now I strategically choose what can be in the same VM and what I split across multiple VMs.
@DBTechYT
@DBTechYT 7 ай бұрын
That sucks!! I'm glad you've got a strategy that works for you :)
@evanbaker6375
@evanbaker6375 6 ай бұрын
Makes complete sense. I may be wrong, but an LXC is essentially a container just running in proxmox natively instead of something like portainer on a VM. Least that's how I understand them
@donaldmull3680
@donaldmull3680 7 ай бұрын
So very happy that you are back to posting videos. Missed ya man!
@DBTechYT
@DBTechYT 7 ай бұрын
Thank you so much. It's been a process (and still is to a point) but I'm really excited to get back into creating new content more often :)
@DanielBrown89
@DanielBrown89 7 ай бұрын
Loved the rational, especially the snapshot restore. I guess my two lazy points are what would keep from doing it. 1. Manually updating by logging in and pulling images, etc. 2. Having to think about resources for each lxc. My favorite thing about docker in a VM is I don't have to care if one container uses more resources than another. Only have to monitor the overall VM system usage. Either way though, going to move pi hole to an lxc for sure!
@DBTechYT
@DBTechYT 7 ай бұрын
As I've said in a few other replies, "the great part about this hobby is that everyone can do things the way that makes sense to them. (as long as it actually works)" :)
@richardbillington3185
@richardbillington3185 7 ай бұрын
Point 2. Can be an advantage too, you CAN set resources on each LXC, especially a RAM and CPU limit which you can also adjust dynamically without the need to reboot to LXC so some LXC can consume more resources that others. But for me the biggest advantage is with LXC you get a proper network with a real dedicated IP address for each container and that network can be mapped to a Proxmox bridge interface with proper VLAN tagging. I have LXC on several different VLANS for example one VLAN goes through a privacy VPN and is UK based, another is on a more secure network such as my password manager (I keep that firewalled from any other containers as you don't know what code or vulnerabilities are in Docker Hun images. I know you "can" do most of this is Docker with MACVLAN and VLAN interfaces but its far simpler with LXC's
@fawaz333dnb
@fawaz333dnb 6 ай бұрын
Totally you are right 👍👍👍
@DBTechYT
@DBTechYT 6 ай бұрын
Thanks for watching and commenting!! Much appreciated :)
@ronm6585
@ronm6585 7 ай бұрын
Makes sense to me. Thanks for sharing.
@DBTechYT
@DBTechYT 7 ай бұрын
As always, thanks for watching and commenting! :)
@miclgael
@miclgael 7 ай бұрын
good to see you back :) also just realised i've been spruiking your vids and i wasn't even subbed 🤦‍♀
@PotatoStudioTV
@PotatoStudioTV 7 ай бұрын
I had the same dilemma with my home server. The reason I use VMs on some mission critical services is due to HA and Backups. Since I use my NAS's SSD pool as storage via NFS, if 1 node shuts down, the HA manager can migrate without any issues. If I use local-lvm and my node powers off for any reason, HA cannot migrate since the storage is on the offline PVE node. If I use LXC with NFS as storage, backups will fail. So It's mix and match for me until I upgrade my hardware and move to CEPH, this is my setup.
@50_Pence
@50_Pence 7 ай бұрын
As per usual - Really great info.
@DBTechYT
@DBTechYT 7 ай бұрын
Thanks!! I appreciate you :)
@PoeLemic
@PoeLemic 12 күн бұрын
Also, probably, dumb question. But could you (maybe?) make a video explaining what a LXC container is, more contrast it against a Docker container. I believe that I understand Portman (sorry, edit: Portainer) and how you run Docker containers on it. But, I didn't know that you could run a LXC container (I guess that's what it is) straight on ProxMox. So, I am assuming that LXC is just another container model, probably similar to Docker, by probably a different vendor. Or, that'd be my guess. But, be nice to see how to put a LXC container together and what software you use. Or, maybe, I guess that people put LXC's together -- just like people put Docker containers together. Okay, that's just a topic that I am searching now and trying to understand, and that's why I came back to your channel to see if you expanded upon it in this video. [Thanks, @DB].
@mrpops2ko
@mrpops2ko 6 ай бұрын
hi, the way you suggested doing things in terms of easy backup also exist for a monolithic docker host too. most of the ways people do it (like me) are to make use of BTRFS snapshotting and also to make use of docker compose bindmounts. so you'd create a directory like /appdata/utility_name and then you'd have timeshift or snapper or btrfs-progs or whatever similar utility then snapshot that /appdata/ at regular intervals (either on another separate disk or as part of a mirror) and should something bad happen to any specific docker container then its as simple as just going into that specific subvolume (snapshot) for the files and yoinking them out
@DBTechYT
@DBTechYT 6 ай бұрын
That's a cool strategy!
@lessonswithricardo
@lessonswithricardo 6 ай бұрын
Good thing about LXC you can run docker inside of it as well. Outside of running desktops, security onion, and a few rdp managers, VM not really needed.
@DBTechYT
@DBTechYT 6 ай бұрын
💯
@kingneutron1
@kingneutron1 3 ай бұрын
You can run xrdp in an LXC. But I would not run docker under lxc, there have been reports of breakage in the past after updating Proxmox at the host level.
@ProfessorMatrix
@ProfessorMatrix 7 ай бұрын
@db tech just curious what are the machines specs for these LXC containers for the single services? Just started setting up my home lab so looking for some recommendations. Thanks
@DBTechYT
@DBTechYT 7 ай бұрын
I usually set them to either: 1 core and 512mb of ram Or 2 cores and 1gb of ram And then I adjust as needed
@gigabit9823
@gigabit9823 7 ай бұрын
I use LXC's exclusively too. So much better.
@ManelRodero
@ManelRodero Ай бұрын
When I started with Proxmox, I used LXCs based on TurnKey Core because they were supposed to be very lightweight. If you use Proxmox Helper Scripts, many of the LXCs are Debian 12. I understand that the Proxmox kernel supports both of these options, right? What do you use? Do you use templates and install applications afterwards? Do you use Proxmox Helper Scripts? Thanks.
@DBTechYT
@DBTechYT Ай бұрын
I use a helper script for my Plex server. I use a base Debian LXC template for my LXCs and put Docker on them and install services on that. I've also got a couple of VMs doing other things as well. I don't use anything with the Turnkey stuff. Actually just talked about this a bit in the livestream I just finished. :)
@kevinhughes9801
@kevinhughes9801 7 ай бұрын
Great point never thought of it like that. Can you do a video on how you created your lxc template and how you map external storage to it please?
@basdfgwe
@basdfgwe 7 ай бұрын
If you can containerise it then it should be containerised, the real question I keep going back and forth between docker and lxc. Half my services are on LXC and the other half are on docker.
@JonatanCastro
@JonatanCastro 7 ай бұрын
I wish I had that "monkey brain" Great video, man! ❤
@DBTechYT
@DBTechYT 7 ай бұрын
Thanks so much!! :)
@tfraiseo
@tfraiseo 7 ай бұрын
I go for an LXC out of the gate because my lab doesn't have a lot of horsepower and I like how lightweight they are. I tried getting AWX running in an LXC and couldn't make it work. It's a hobby for me and getting frustrated makes me stop before pulling my hair out so i don't completely give up on it from burnout. I'd be curious to see if anyone has won that battle and what their process was.
@augustolacerda3560
@augustolacerda3560 7 ай бұрын
well, that is very interesting but can i go one step further? I run my services in docker on ubuntu server. what would be the difference from that to running docker inside an lxc. Sounds to me like an inception of containers... I mean there might be a reason why people recommend doing it that way, but I just can't get the reason why.
@DBTechYT
@DBTechYT 7 ай бұрын
The difference for me, as I said in the video, is further isolating the different services from each other. And then having the LXCs fully backed up allows me to restore a single service without impacting the rest of my services on the same machine. Again, the great part about this hobby is that everyone can do things the way that makes sense to them. (as long as it actually works)
@kevinwhiten2804
@kevinwhiten2804 7 ай бұрын
What template/OS do you use for your LXCs?
@DBTechYT
@DBTechYT 7 ай бұрын
I use Debian 12 Turnkey Core for my templates. I'm planning on making a video showing the process I go through to set all that up :)
@kevinwhiten2804
@kevinwhiten2804 7 ай бұрын
@@DBTechYT I use the same template, so it is nice to get some reassurance! Thanks
@XtianApi
@XtianApi 2 ай бұрын
I hope those are all unprivelaged lxcs. For security you could run one VM and all the services on their own LXC in that VM and backup each lxc separately, like you do, and just save backups to a smb share. Backing up method would be a bit different, but you could probably make it work for you. Passing through, or different backup solution that produces same backup file type, or something. Fun challenge, if nothing else.
@DBTechYT
@DBTechYT 2 ай бұрын
I always run my LXCs as unprivileged.
@XtianApi
@XtianApi 2 ай бұрын
@@DBTechYT exxxxcellent
@MrNoBSgiven
@MrNoBSgiven 6 ай бұрын
I have two points. 1. I do agree with you on LXC vs Docker. Of course, majority of us do the easy docker-compose templates mixing quite stagnant configuration files with databases (mysql, postgress...). The recovery dilemma could be solved by keeping databases in separate dedicated LXC/VMs replicated at least to one extra instance. There is no reason to create separate mysql installation for every application. They could be combined, which long term simplifies backups and recoveries (IMHO). 2. The issue of having multiple instances of DNS (or homepage) apps. Implementing vip failover with Keepalived solves it beautify. Quick and easy installation, but the benefit of losing DNS resolution for 1 second is just priceless. My pain Pihole runs as LXC container on Proxmox, and its failover backup (updated by gravity-sync every 15 mins) on a raspberry pi 3. Also on question: why don't your production Proxmox server run in a cluster? Just wondering.
@DBTechYT
@DBTechYT 6 ай бұрын
So... Let's see... I disagree with you on the "no reason to create a separate mysql installation for every application". If someone manages sql injection on one application, that would, in turn compromise the other applications using that database. I always have a dedicated database for each application. I used to work as a web developer and had issues with hackers doing ignorant stuff and really screwing us over. I've been overly cautious since then about this kind of stuff. As far as why I'm not running my 2 production servers in a cluster is fairly simple: I used to have a 3 node HA Proxmox cluster and it was fine. But it never actually did anything for me. It was "neat" that I could see all the info from one dashboard and whatnot, but it just didn't do much more than that for me. So I migrated everything over to a single node that was just as, if not more, powerful than the 3 nodes I previously had set up. Recently I decided to set up a second node specifically for a VM I wanted to run that would have overloaded the first unit when added to everything else. So I just quickly set up that node and started deploying stuff on it. I never felt the need to cluster them because I've got new hardware coming that will eliminate the need for multiple nodes entirely. As I've said in a few other replies, "the great part about this hobby is that everyone can do things the way that makes sense to them. (as long as it actually works)" :)
@testbox3201
@testbox3201 4 ай бұрын
Just make regular backups of your docker volumes.
@DBTechYT
@DBTechYT 4 ай бұрын
This works for me and it's all automated. You do what works for you
@stefsmurf
@stefsmurf 7 ай бұрын
I think I was with you until 5:35. From my understanding, since the data (shouldn't) be in the VM itself, just mounted, it's just the configurations that needs to be restored. And even if you don't have something like Anisble, Terraform, or something like that for auto-deployments, even just making a backup of the docker compose file used to setup the docker in the VM should be good enough. Now, this only doesn't make sense if you don't update your docker compose file each time any updates are done, and I would encourage you to do that, if you don't already. Of course, the other reason why this approach wouldn't work is that you're storing your VM data directly on the VM, instead of stored outside, to be mounted inside. Depending on your setup, this may the best way, and then your rational sorta makes sense, but even then, not really. Because data compromise is data compromise, regardless of what manner of container you're using. And you're already using Proxmox, so setting up your storage in Proxmox (NFS, ISCSI) shouldn't be that much more difficult than your current setup. Your rational at 7:30 is probably the only one that is objectively true. Memory usage should also decrease slightly using LXCs vs VMs, which allows you to have much more LXCs at the same time running than that amount of VMs. At this point, I must ask: What's the point of using Docker if you're just running 1-2 apps per LXC? Shave down the resources more and just run them 'baremetal' on the LXC.
@DBTechYT
@DBTechYT 7 ай бұрын
I'm not currently using NFS or iSCSI for my storage. All of my data is being stored locally. I used to have my data stored on a different device via NFS and the amount of shit I took for doing that was unreal. I left it like that (using NFS) until I decided to rebuild my setup and simplify things a bit. Again, the great part about this hobby is that everyone can do things the way that makes sense to them.
@stefsmurf
@stefsmurf 7 ай бұрын
@@DBTechYT No, what I meant is that in your homelab explanation video, you stated that each mini pc had 2 ssds in them. One for OS, one for I can't remember, but probably storage. You can setup NFS or ISCSI on Proxmox for local use, and then just mount them into each VM/LXC. That way, the data lives on even if the VM/LXC disappears, all on the same machine. That's what I mean about the data storage not in the VM/LXC. > I used to have my data stored on a different device via NFS and the amount of shit I took for doing that was unreal. F them. That's what I'm doing, and even worse, gonna do it over 1gbe until I get a job to get 2.5gbe to usb cables for faster connection. (Unfortunately for me, no 2.5gbe or 10gbe for HP mini g2 or g3, which is what I have.) Using 3 synology machines for it, to boot. (2 of app storage, 1 for backups). I wasn' trying to attack your setup, just don't necessarily agree with your rationale. But only academically. Way too old to get into arguments on the internet, especially about stuff that doesn't affect me, and even more when it works for someone else. Just felt I had to point one one avenue I think you missed.
@DBTechYT
@DBTechYT 7 ай бұрын
Gotcha. I see what you're saying. I have an nvme drive in each unit for boot and an SSD for storage. I have it set up via ZFS. No offense taken on anything. My Proxmox setup works for me and my backup solution has saved me a few different times. I think my concern with having persistent data via NFS like you're saying is this: Let's say someone compromises your system and you just restore the Docker setup. That compromised data will still be in the NFS data pool. By restoring everything (the docker container AND the data), there's less of a chance that the compromised files will be restored. I use this as an example as I worked for a web development company years ago and hackers infiltrated some of our sites, compromised them with backdoors and malware, and then waited a month or 2 before they actually launched their attack. No matter how many times we restored the sites, we just kept restoring compromised files and never removed their access as a result. We had to take a completely different approach to undoing what they did, so I always like to do a full restore of everything whenever possible as a result.
@50_Pence
@50_Pence 7 ай бұрын
I build my (fixed image container) server with ansible then periodically backup just the persistence directories and sql db's off site. Then should the site get popped I run the playbook this time it pulls the backup data during the build. What do you think? I'm v new to all this. Maybe there is a better/simpler way I've not seen?
@DBTechYT
@DBTechYT 7 ай бұрын
@@50_Pence sounds like you've got a good solution in place. I've only played with Ansible a little bit so I don't have much to say on it at this point, but I'm planning on learning at least a bit of it because it really does fascinate me.
@mikekane9734
@mikekane9734 7 ай бұрын
Man! That's starts like a soapy opera 2.30 min same 6 words different order
@open-source-is-the-answer
@open-source-is-the-answer 28 күн бұрын
He insulated all of us right on the start calling himself dumb lol what that makes us who are watching him and not knowing what he knows lmao
@DBTechYT
@DBTechYT 28 күн бұрын
I truly believe that a good chunk of my audience is much smarter than I am. I like to talk about Docker containers and try new things. I do what makes my life easier. Doesn't mean I'm doing it right lol
@ahyi9350
@ahyi9350 6 ай бұрын
Love the plan. But I moved away from proxmox because of kernel error which crashed my system. Backup was on the same disk so that was quite a nightmare for me. Maybe another video for us if you have a backup plan for this scenario?
@DBTechYT
@DBTechYT 6 ай бұрын
I think the thing to be learned from this is that your backups shouldn't be on the same drive. I'm not trying to be mean. I just can't imagine a scenario where having backups on the same device is a good idea.
@joeking5211
@joeking5211 4 ай бұрын
2:27 'isn't a VM' ???, thought it was, or not ?. I must dip out here before total confusion sets in as I am a very new Proxmox user and fear taking the wrong road in the early days. But thks for the attempt at the compare but I guess unless you already know what you are doing I feel this vid will confuse, I need a clear and concise vid to get me through this, better luck next time, thks for the effort and Kind Rgds.
@DBTechYT
@DBTechYT 4 ай бұрын
This wasn't really meant to be a tutorial as much as an explanation of why I did what I did in a previous video. Thanks for watching and commenting :)
Docker on Proxmox LXC 🚀 Zero Bloat and Pure Performance!
20:53
SmartHomeBeginner
Рет қаралды 62 М.
Running VMs in TrueNAS Scale - Should you run this instead of Proxmox?
21:05
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 14 МЛН
From Small To Giant 0%🍫 VS 100%🍫 #katebrush #shorts #gummy
00:19
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 7 МЛН
Split A GPU Between Multiple Computers - Proxmox LXC (Unprivileged)
25:59
LXC/LXD vs Docker Which is better?
14:24
Scotti-BYTE Enterprise Consulting Services
Рет қаралды 29 М.
Proxmox LXC - How To Guide - Better Than A VM?
17:01
Jim's Garage
Рет қаралды 71 М.
Getting Started with Proxmox Containers
25:09
DB Tech
Рет қаралды 88 М.
Virtual Machine (VM) vs Docker
8:52
IBM Technology
Рет қаралды 217 М.
The Death of Microservices?
24:20
Cloud Computing Insider
Рет қаралды 65 М.
Virtualize vs. Containerize (Which should I choose?)
14:38
Techno Tim
Рет қаралды 192 М.
Smart Sigma Kid #funny #sigma
00:33
CRAZY GREAPA
Рет қаралды 14 МЛН