nerdexam
CompTIA

XK0-004 · Question #286

Which of the following BEST describes the difference between a container and a VM?

The correct answer is A. Containers share host OS libraries and a kernel, while VMs have their own libraries and kernel. Containers and VMs differ in isolation level: containers share the host OS kernel and libraries, while VMs run a full guest OS with their own independent kernel.

Scripting, Containers and Automation

Question

Which of the following BEST describes the difference between a container and a VM?

Options

  • AContainers share host OS libraries and a kernel, while VMs have their own libraries and kernel.
  • BContainers are larger than VMs.
  • CVMs share host libraries and a kernel, while containers have their own libraries and kernel.
  • DVMs are larger than containers.

How the community answered

(41 responses)
  • A
    90% (37)
  • B
    2% (1)
  • C
    2% (1)
  • D
    5% (2)

Why each option

Containers and VMs differ in isolation level: containers share the host OS kernel and libraries, while VMs run a full guest OS with their own independent kernel.

AContainers share host OS libraries and a kernel, while VMs have their own libraries and kernel.Correct

Containers use OS-level virtualization via kernel namespaces and cgroups, sharing the host kernel and system libraries, which makes them lightweight and fast to start. VMs use hardware-level virtualization through a hypervisor, with each VM running a complete guest OS including its own kernel and libraries, providing stronger isolation at the cost of greater resource consumption.

BContainers are larger than VMs.

Containers are not larger than VMs - containers are significantly smaller because they omit the guest OS, whereas VM disk images bundle an entire operating system.

CVMs share host libraries and a kernel, while containers have their own libraries and kernel.

This reverses the correct architecture - it is containers that share the host OS kernel and libraries, not VMs; each VM maintains its own isolated kernel.

DVMs are larger than containers.

While VMs do generally have a larger resource footprint, this statement alone does not describe the architectural difference that defines containers versus VMs.

Concept tested: Container vs VM virtualization architecture comparison

Source: https://docs.docker.com/get-started/docker-overview/

Topics

#containers#virtual machines#kernel sharing#virtualization

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice