Containers and VMs Together

Apr 08 2016

A couple weeks back I talked about how Docker containers were not virtual machines (VMs). I received a lot of positive feedback on the article (thanks!), but I also heard a common question: Can VMs and Docker containers coexist?

The answer is a resounding “yes.”

At the most basic level VMs are a great place for Docker hosts to run. And by VMs I mean VMs in all their forms. Whether it’s a vSphere VM or a Hyper-V VM or an AWS EC2 instance, all of them will serve equally well as a Docker host. Depending on what you need to do, a VM might be the best place to land those containers. But the great thing about Docker is that, it doesn’t matter where you run containers – and it’s totally up to you.

Another question I hear relates to whether or not Docker container-based services can interact with VM-based services. Again, the answer is absolutely yes. Running your application in a set of Docker containers doesn’t preclude it from talking to the services running in a VM.

For instance, your application may need to interact with a database that resides in a virtual machine. Provided that the right networking is in place, your app can interact with that database seamlessly.

Another area where there can be synergy between VMs and Docker containers is in the area of capacity optimization. VMs gained early popularity because the enabled higher levels of server utilization. That’s still true today. A vSphere host, for instance, can host VMs that may house Docker hosts, but may also host any number of traditional monolithic VMs. By mixing and matching Docker hosts with “traditional” VMs, sysadmins can be assured they are getting the maximum utilization out of their physical hardware.


Docker embraces running Docker hosts on a wide variety of virtualization and cloud platforms. Docker Cloud and Docker Datacenter can easily manage Docker hosts regardless of where they run. And with Docker Machine you can provision new Docker hosts onto a wide variety of platforms including VMware vSphere, Microsoft Hyper-V, Azure, and AWS.

One of the most powerful things about Docker is the flexibility it affords IT organizations. The decision of where to run your applications can be based 100% on what’s right for your business. You’re not locked in to any single infrastructure, you can pick and choose and mix and match in whatever manner makes sense for you organization. Docker hosts on vSphere? Great. Azure? Sure. Physical servers? Absolutely. With Docker containers you get a this great combination of agility, portability, and control.


Learn More about Docker


10 thoughts on “Containers and VMs Together

  1. Avatar for Mike Coleman

    Kristopher Francisco

    Great article. Provided your networking team has figured how to provide scalable, unique addressing to each container, the heterogeneous environment works well.

    I often question whether or not infrastructure teams want the added complexity of running two computing platforms. That's why Evolute created Chrysalis ( which allows you to convert your VMs to Docker/containers.

    What do you think about moving to an all container environment?

    • Hi Kristopher,

      Can I ask a follow-on question to your response to Mike's beautiful article?

      Is there any syntax to create a unique addressing for each container? Will this syntax work across different environment? E.g. Docker, Kubernetes, CloudFoundry, Mesos etc.


  2. Avatar for Mike Coleman

    Mohamed H. Ibrahim

    Thanks Mike. Can you cover how networking works connecting different Docker containers running on Docker hosts housed in different platforms? Also we would like to know if Windows 2016 server core can be run on containers? If so has there been a successful deployment of mssql 2016 in this kind of setup. I recently attempted installing this setup on Hyper-v container but it failed. Also tried installing MSSQL 2016 on Hyper-v container running win2016 nano server core and it also failed.

  3. Avatar for Mike Coleman

    The Docker Guy

    I've been running into the more counter-intuitive case of folks deploying existing VMs (for example, appliances) in Docker containers. It's curious and sort of flies in the face of the micro-services approach I prefer, but it works.


  4. In practice, it seems that it is not always true that docker and other VMs can coexist. For example, there is a known mutual exclusion with VirtualBox running on windows.

  5. Good article! Can you shed some light on how using dockers and VMs together can facilitate better security?

  6. Docker and KVM's co-existing looks like a nice idea but I am concerned about the security of such a setup. Docker containers are not secure and they let access /dev, /sys as root from within containers. This can compromise the host system. Is it safe to run a VM on the same host? How safe is the VM when kernel address space is compromised? I haven't seen you mentioning any security implications. Can you comment?

  7. Avatar for Mike Coleman

    Jagadisha Gangulli

    Hi Mike,

    In this case, should we go for multiple monitoring systems.

  8. Hi Kristopher,

    Can I ask a follow-on question to your response to Mike's beautiful article?

    Is there any syntax to create a unique addressing for each container? Will this syntax work across different environment? E.g. Docker, Kubernetes, CloudFoundry, Mesos etc.


  9. I have a question:
    Suppose i have a host machine with Suse Sles 11 and on top of it i have a VM with Suse Sles12 OS in which i have dockers installed.
    Now if i want to communicate with host to the docker container. How is it possible ? I know that we need to deal with bridge networking stuff. But can i get the list of steps from anyone ?


Leave a Reply