What is the difference between VirtualBox and Docker

virtualbox-docker

What is the difference between virtualisation and containerisation? Containers (Docker) and virtual machines (VMware, VirtualBox, etc.) solve different problems.

VirtualBox is an example of virtualisation (same as VMware or Parallels). Virtualisation software emulates a physical machine. It implies extra overhead for emulation.

On the other hand, Docker is an example of containerisation software, it runs in host OS and does not emulate anything so needs no hypervisor and adds no emulation overhead.

Let’s compare them:

VirtualBox  Docker
Hardware level process isolation OS level process isolation
Complete isolation of applications from host OS Can share some resources with host OS
Each VM has separate OS Each container can share OS resources
Boots in minutes Boots in seconds
More resource usage Less resource usage
Pre-configured VMs are hard to find Pre-built containers are already available in repo
Customising pre-configured VMs requires work Building a custom setup with containers is easy
Bigger size because each VM contains whole OS Containers are small because there is docker engine over the host OS
VMs can be easily moved to a new host OS Containers are destroyed and recreated rather than moving
Creating VMs take relatively long time Dockers can be created in seconds
Virtualised apps are harder to find and it takes more time to install them Containers with Nginx, Varnish etc. can be found and installed easily within minutes

Leave a Reply

Your email address will not be published. Required fields are marked *