When Should I Use VMs vs Containers?

October 22, 2025 5 answers
Asked by CuriousCoder42
I'm looking for some insight into using virtual machines (VMs) versus containers. I often default to using containers whenever possible, but I'm not entirely sure when it's better to choose VMs. Any experienced users willing to share their thoughts and criteria for making the decision? Thanks!

Answers

AlwaysContainerFan
Honestly, I prefer containers for everything. The efficiency and resource savings are just too good to pass up. But I do consider VMs when a specific application absolutely canโ€™t externalize its state, which can be tricky. Sticking to containers whenever possible is a good rule of thumb, though!

SkepticalDev: But wait, would you still use containers if you're dealing with stateful applications? Seems risky!

Reply to this answer
TechSavvyGal99
It's great that you're already using containers! In my experience, the main reason to choose VMs is when you need to run software that just doesn't support containers. They can be a hassle with all the configuration and monitoring, but for legacy apps or apps with strict licensing, they're sometimes a must. Otherwise, if it can run in a container, we do it!

OldSchoolDev: Yeah, it can be a real chore to create a Docker image for legacy applications not designed for it.

ContainerNinja88: Or when you're stuck with some outdated legacy code that's a pain to convert.

Reply to this answer
LegacySupportGuy
For me, VMs are the go-to when we're dealing with older architectures where changing to containers just isn't practical. Trying to force legacy systems into a modern containerized setup can end up being more trouble than it's worth. Sometimes itโ€™s just better to keep things as they are for stabilityโ€™s sake.

VM_Champion23: Exactly! Also, if you're working with certain apps that have proprietary licensing issues, containers can be a nightmare.

Reply to this answer
ExploratoryDev
I think you hit the nail on the head: anything stateless is a candidate for containers. Web servers, APIs, those fit well in containers. Databases, which are stateful, are typically better suited for VMs. But itโ€™s always good to evaluate the specific requirements of the app.
Reply to this answer
CloudHopperSteve
In my role with a strong VDI platform, containers work great for most of our use cases. That said, whenever client apps need full stacks, or for things like EKS Clusters, VMs can sometimes make things simpler. It really comes down to how you want to manage resources for those edge cases: about 5% of the time we hit that need.

Aks_Explorer: Yep, we moved to AKS from Container Apps for similar reasons, especially with FUSE issues.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions