Why virtualization still used instead of containers? [closed]

Solution 1:

Containers are not "a form of operating system virtualisation". Containers are the way to build multiple user environments in a single OS image. Containers and VMs were never able to achieve the same purpose. Containers are based on technology that was never intended to replace virtual machines at all; it is the way to build jails more secure than, say, chroot (it is like "chroot on steroids").

If you want to see "a form of operating system virtualisation", learn about Xen paravirtual technology; that is the form of OS virtualisation.

There are many tasks which is not possible to do in containers, for example, people often need to run both Windows and Linux apps and god only knows what else, and the only way to do that is virtualisation.

Yet there are many tasks that could be solved either way. Why they still aren't always solved using containers?

Because of inertia in people's minds. VMs are just like computers, which we use for very long time and everybody is accustomised to them. Containers are very different things.

Because of Windows widespread, which doesn't have such a concept. I can even speculate that's because it is hard to enforce licensing restrictions in truly secure containerized environment; Micro$oft licensing terms were always very muddy, but inclusion of containers could make that unbearable even to their most loyal proponents.

Solution 2:

Virtualization is still used because it is extremely flexible despite the numerous advantages that come with containers.

For example, you can have nested virtualization enabled on a VM guest. With this feature enabled, the VM guests have the same virtualization ability that the host system has.

With a set up like this, you can extend your resource footprint much more than just using a host system for only containers or a limited amount of VMs which in turn host containers.

Each individual VM can in theory create a further 3-5 VMs which can then be containerized and used much more efficiently.