What are the typical uses cases for LXC versus VM?

MorganK picture MorganK · Jun 11, 2013 · Viewed 10.1k times · Source

I am trying to make up my mind on when an LXC container can be a better choice than using a full VM.

Do you have any precise uses cases in mind that can bring some arguments in one way or another?

Are LXC more "PaaS" oriented, to run applications without hardware control? Do we always need to use VM on an "IaaS" perspective where we want infrastructure control?

Regards,

Answer

Vinay Sahni picture Vinay Sahni · Jun 13, 2013

LXC is like a chroot jail on steroids. For sake of argument, you can consider it a light weight VM (even though it's not a VM at all).

If you've already gone through the effort of writing an application that is designed to live on ephemeral infrastructure, then LXC just lets you do it with less overhead.

For me, the coolest thing about LXC is the community growing around it. Consider something like docker - a docker image is relatively portable. It provides the tools to configure identical containers on physical hardware, or within a VirtualBox VM running on your desktop, or within VM's provided by Amazon or Rackspace. This brings us closer to the dream of write-once run-anywhere.