Containers & Virtualization Flashcards

(24 cards)

1
Q

What kernel features enable containers?

A

Namespaces, Cgroups, Capabilities, Seccomp, and AppArmor/SELinux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are namespaces used for?

A

Isolate system resources such as process IDs, mount points, network interfaces, and hostnames.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List the main types of Linux namespaces.

A

PID, Mount, UTS, IPC, User, Network, and Time namespaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a PID namespace?

A

Isolates process IDs so each container has its own PID 1 and process tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a mount namespace?

A

Isolates filesystem mount points, allowing different views of the filesystem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a user namespace?

A

Allows a process to have root privileges inside a namespace without root access on the host.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a network namespace?

A

Provides each container with isolated network interfaces, IP tables, and routing tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What command lets you enter another process’s namespace?

A

nsenter -t <PID> -n -p</PID>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are cgroups used for?

A

Limit, account for, and isolate resource usage (CPU, memory, I/O) among process groups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What command shows a process’s cgroup membership?

A

cat /proc/<PID>/cgroup</PID>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Linux capabilities?

A

Fine-grained privileges split from root to limit what processes can do.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does seccomp do?

A

Restricts system calls a process can make to reduce kernel attack surface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is AppArmor or SELinux used for?

A

Provides mandatory access control for confinement of processes and files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is containerd?

A

A container runtime that manages container lifecycle and image execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between Docker and containerd?

A

Docker uses containerd under the hood as its container runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is virtualization?

A

The creation of virtual instances of computing resources, such as VMs running their own OS.

17
Q

What is a hypervisor?

A

Software that creates and runs virtual machines.

18
Q

What is a Type 1 hypervisor?

A

Runs directly on hardware (e.g., VMware ESXi, Xen, Hyper-V).

19
Q

What is a Type 2 hypervisor?

A

Runs as an application on top of a host OS (e.g., VirtualBox, VMware Workstation).

20
Q

What is memory virtualization?

A

Maps guest virtual addresses to host physical memory using page tables.

21
Q

What are shadow page tables?

A

Used by hypervisors to translate guest virtual to host physical addresses efficiently.

22
Q

How do containers differ from virtual machines?

A

Containers share the host kernel, while VMs emulate hardware and run their own kernels.

23
Q

Which has stronger isolation: containers or VMs?

A

VMs, since each has its own kernel and hardware virtualization boundary.

24
Q

Which has better performance and density: containers or VMs?

A

Containers — they are lightweight and have minimal overhead.