Junior — Middle
What is the difference between mounting physical disks to a virtual machine and connecting them to a container?
sobes.tech AI
Answer from AI
Mounting physical disks to a virtual machine (VM) and connecting them to a container differ in terms of abstraction level and access method:
-
Virtual Machine:
- The VM emulates a complete hardware environment, including disks.
- A physical disk or its image is mounted as a virtual disk accessible to the VM's OS as a regular disk.
- The VM has its own kernel and file system, and is fully isolated.
-
Container:
- Containers use the host's kernel and isolate processes at the OS level.
- Connecting a disk to a container usually involves mounting directories or volumes from the host.
- The container does not see the disk as a separate device but works with the host's file system.
In summary: in a VM, the disk is presented as a separate device, while in a container, it appears as a mounted folder or volume without emulating a separate device.