{"id":1168,"date":"2021-04-21T21:29:55","date_gmt":"2021-04-21T18:29:55","guid":{"rendered":"http:\/\/leonidassavvides.com\/blog\/?p=1168"},"modified":"2023-10-17T06:49:37","modified_gmt":"2023-10-17T03:49:37","slug":"dockercontainers-vs-hypervisorvirtual-machines","status":"publish","type":"post","link":"https:\/\/www.leonidassavvides.com\/blog\/2021\/04\/dockercontainers-vs-hypervisorvirtual-machines\/","title":{"rendered":"Docker[Containers] vs Hypervisor[Virtual Machines]"},"content":{"rendered":"<div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div>\n<h2 class=\"wp-block-heading has-text-align-center\">Virtualization Technologies<\/h2>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Docker vs Hypervisor &#8212; Containers vs Virtual Machines<\/h2>\n\n\n\n<p><strong>Wednesday, April 21, 2021<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Category \\ Technology<\/strong><\/td><td><strong>Docker [Containers]<\/strong><\/td><td><strong>Hypervisor [Virtual Machines]<\/strong><\/td><\/tr><tr><td><strong>Docker vs. Virtual Machines<\/strong><\/td><td><strong>&nbsp;<\/strong><\/td><td><strong>&nbsp;<\/strong><\/td><\/tr><tr><td>OS Support and Architecture<\/td><td><strong>No Guest OS<\/strong>, Docker containers <strong>hosted on a single physical server with a host OS, which shares among them.<\/strong> Sharing the host OS between containers makes them light and increases the boot time. Docker containers are considered suitable to run multiple applications over a single OS kernel.<\/td><td><strong>Host OS and the Guest OS<\/strong> inside each VM. Guest OS can be any OS, like Linux or Windows, irrespective of host OS.<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Security<\/td><td>Providing root access to applications and running them with administrative premises is <strong>not<\/strong> recommended in the case of Docker containers <strong>because<\/strong> containers share the host kernel. The container technology has access to the kernel subsystems; as a result, a <strong>single<\/strong> <strong>infected<\/strong> application can hack the <strong>entire<\/strong> host system.<\/td><td>Virtual machines are <strong>stand-alone <\/strong>with their <strong>kernel<\/strong> and <strong>security<\/strong> features. Applications needing more <strong>privileges<\/strong> and <strong>security<\/strong> run on virtual machines.&nbsp;<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Portability<\/td><td>Docker containers packages are self-contained and can run applications in any environment, and since they <strong>do not need a guest OS<\/strong>, they can be <strong>easily ported across different platforms.<\/strong> Also, containers being <strong>lightweight [MBs]<\/strong> can be started and stopped in <strong>very less time<\/strong> compared to virtual machines<\/td><td>VMs are huge in size <strong>[GBs]<\/strong> because each include standalone OS. Not easy moved to a different platform without incurring compatibility issues.<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>&nbsp; &nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Category \\ Technology<\/strong><\/td><td><strong>Docker [Containers]<\/strong><\/td><td><strong>Hypervisor [Virtual Machines]<\/strong><\/td><\/tr><tr><td><strong>Docker vs. Virtual Machines<\/strong><\/td><td><strong>&nbsp;<\/strong><\/td><td><strong>&nbsp;<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Performance<\/td><td>The <strong>lightweight<\/strong> architecture of Docker containers is <strong>less<\/strong> resource-intensive than virtual machines. Most times <strong>one application per Container<\/strong>.<\/td><td>VMs are <strong>more resource-intensive<\/strong> than Docker containers as the virtual machines need to <strong>load the entire OS to start<\/strong>. One OS in each VM, and usually <strong>many apps running <\/strong>in this OS.<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Boot-Time<\/td><td>Boots in a few <strong>seconds<\/strong>.<\/td><td>It takes a few <strong>minutes<\/strong> for VMs to boot.<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Runs on<\/td><td>Dockers make use of the <strong>execution engine.<\/strong><\/td><td>VMs make use of the <strong>hypervisor<\/strong>.<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Memory Efficiency<\/td><td>No space is needed to virtualize, hence <strong>less memory.<\/strong><\/td><td>Requires entire OS to be loaded before starting the surface, so less efficient, <strong>more memory.<\/strong><\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Isolation<\/td><td><strong>Prone to adversities<\/strong> as <strong>no<\/strong> provisions for <strong>isolation<\/strong> systems.<\/td><td>Interference possibility is <strong>minimum<\/strong> <strong>because<\/strong> of the efficient <strong>isolation<\/strong> mechanism.<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Deployment<\/td><td>Deploying is <strong>easy<\/strong> as only a single image, containerized can be used across all platforms.<\/td><td>Deployment is comparatively <strong>lengthy<\/strong> as separate <strong>instances<\/strong> are responsible for execution<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Usage<\/td><td>Docker has a <strong>complex usage mechanism <\/strong>consisting of both <strong>third party and docker managed tools.<\/strong><\/td><td>Tools are <strong>easy to use and simpler to work with.<\/strong><\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><tr><td>Reuse of Resources and Libraries<\/td><td>Docker Containers can <strong>reuse<\/strong> Resources and Libraries<strong> from other Containers, taking less disk space.<\/strong><\/td><td><strong>No reuse<\/strong> between VMs, <strong>Redundant copies exist<\/strong>, demanding <strong>more disk space.<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Usually, Organizations are making use of the hybrid approach mostly as the choice between virtual machines and Docker containers depends upon the kind of workload offered.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hypervisor-2 vs Docker<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"472\" src=\"https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/docker-vs-vm.png\" alt=\"\" class=\"wp-image-1169\" srcset=\"https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/docker-vs-vm.png 862w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/docker-vs-vm-300x164.png 300w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/docker-vs-vm-768x421.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hypervisor-1 vs Docker<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"499\" src=\"https:\/\/leonidassavvides\/blog\/wp-content\/uploads\/2021\/04\/Docker-containers-are-not-lightweight-virtual-machines-1024x499.png\" alt=\"Docker\" class=\"wp-image-1173\" srcset=\"https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/Docker-containers-are-not-lightweight-virtual-machines-1024x499.png 1024w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/Docker-containers-are-not-lightweight-virtual-machines-300x146.png 300w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/Docker-containers-are-not-lightweight-virtual-machines-768x374.png 768w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/Docker-containers-are-not-lightweight-virtual-machines.png 1153w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Hypervisor-2 vs Hypervisor-1<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"210\" src=\"https:\/\/www.leonidassavvides.com\/blog1\/wp-content\/uploads\/2021\/04\/hypervisor-1-vs-hypervisor-2.png\" alt=\"\" class=\"wp-image-1172\" srcset=\"https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/hypervisor-1-vs-hypervisor-2.png 512w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/hypervisor-1-vs-hypervisor-2-300x123.png 300w\" sizes=\"auto, (max-width: 512px) 85vw, 512px\" \/><\/figure>\n\n\n\n<p><strong><u>Note:<\/u><\/strong> Hypervisor 1 [Servers mainly] vs Hypervisor 2 [Desktop mainly]<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"711\" height=\"395\" src=\"https:\/\/www.leonidassavvides.com\/blog1\/wp-content\/uploads\/2021\/04\/Hypervisor-1-vs-2.png\" alt=\"\" class=\"wp-image-1171\" srcset=\"https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/Hypervisor-1-vs-2.png 711w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/Hypervisor-1-vs-2-300x167.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">VM Hypervisor-2 vs Docker [Linux] vs Docker [VM Linux]<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"850\" height=\"430\" src=\"https:\/\/www.leonidassavvides.com\/blog1\/wp-content\/uploads\/2021\/04\/A-comparison-of-the-architecture-of-virtual-machines-and-Docker.png\" alt=\"\" class=\"wp-image-1170\" srcset=\"https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/A-comparison-of-the-architecture-of-virtual-machines-and-Docker.png 850w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/A-comparison-of-the-architecture-of-virtual-machines-and-Docker-300x152.png 300w, https:\/\/www.leonidassavvides.com\/blog\/wp-content\/uploads\/2021\/04\/A-comparison-of-the-architecture-of-virtual-machines-and-Docker-768x389.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Virtualization Technologies Docker vs Hypervisor &#8212; Containers vs Virtual Machines Wednesday, April 21, 2021 Category \\ Technology Docker [Containers] Hypervisor [Virtual Machines] Docker vs. Virtual Machines &nbsp; &nbsp; OS Support and Architecture No Guest OS, Docker containers hosted on a single physical server with a host OS, which shares among them. Sharing the host OS &hellip; <a href=\"https:\/\/www.leonidassavvides.com\/blog\/2021\/04\/dockercontainers-vs-hypervisorvirtual-machines\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Docker[Containers] vs Hypervisor[Virtual Machines]&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,54,19,21,22,24,29,37,42,43,46,49,50],"tags":[89,102,138,264],"class_list":["post-1168","post","type-post","status-publish","format-standard","hentry","category-dev","category-docker","category-linux","category-mac-os-x","category-macos","category-macs","category-pc-build","category-security","category-technical","category-tech","category-virtualization","category-windows-10","category-windows-11","tag-containers","tag-docker","tag-hypervisor","tag-virtual-machines"],"_links":{"self":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts\/1168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/comments?post=1168"}],"version-history":[{"count":2,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts\/1168\/revisions"}],"predecessor-version":[{"id":2151,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/posts\/1168\/revisions\/2151"}],"wp:attachment":[{"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/media?parent=1168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/categories?post=1168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leonidassavvides.com\/blog\/wp-json\/wp\/v2\/tags?post=1168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}