Courseiva

LPIC-3 Exam 305: Virtualization and Containerization (305-300) (305-300) (305-300) — Questions 1–75

210 questions total · 3 pages · All types, answers revealed

Page 1 of 3

Page 2
1
MCQmedium

Which command checks the status of the libvirtd service?

A.service libvirtd status
B.libvirtd --check
C.systemctl status libvirtd
D.virsh service-status
AnswerC

`systemctl status libvirtd` queries systemd directly for the unit's runtime state, reporting whether libvirtd is active, inactive or failed, plus recent log lines. This satisfies the stem's requirement to check service status on a systemd-managed host, unlike `service` or `virsh` alternatives that query different layers.

Why this answer

The command `systemctl status libvirtd` is correct because on modern Linux distributions using systemd, `systemctl` is the standard tool to query the status of a service unit. It provides detailed information including whether the service is active, its PID, recent log entries, and any dependencies. Since libvirtd is typically managed as a systemd unit, this command directly checks its runtime state.

Exam trap

The trap here is confusing legacy SysVinit commands like `service` with modern systemd commands, or assuming virsh has service management capabilities, when in fact systemctl is the correct tool for checking service status on systemd-based systems.

How to eliminate wrong answers

Option A is wrong because `service libvirtd status` is a legacy SysVinit wrapper that may not work on systemd-based systems and often redirects to systemctl but is not the native or recommended method. Option B is wrong because `libvirtd --check` is not a valid option; libvirtd does not have a `--check` flag for status verification. Option D is wrong because `virsh service-status` is not a valid virsh subcommand; virsh manages virtual machines, not host services.

2
MCQhard

A KVM guest is configured with a virtio-blk disk and a virtio-net device. Under heavy network load the guest CPU shows high system time inside the guest, and the host shows high context-switch rates for the QEMU process. The administrator wants to reduce per-packet I/O overhead without changing the guest OS drivers. Which change is most appropriate?

A.Enable vhost-net for the virtio-net device by ensuring the vhost_net kernel module is loaded.
B.Increase the number of vCPUs assigned to the guest to absorb the extra system time.
C.Change the network device model to e1000 to lower CPU usage on the host.
D.Switch the disk from virtio-blk to virtio-scsi and reattach the same image.
AnswerA

vhost-net moves the virtio-net data plane from the QEMU userspace process into a kernel thread, cutting the number of context switches and the userspace overhead per packet. Because it keeps the same virtio-net guest driver, no guest OS change is required. This directly addresses the high system time and context-switch rate under heavy network load.

Why this answer

Moving the virtio-net data plane into the kernel with vhost-net reduces the userspace context switches and system time that appear under heavy network load, while preserving the existing virtio-net guest driver. Changing the disk controller, emulating a slower NIC, or adding vCPUs does not target the packet-processing overhead and can even make host CPU usage worse.

Exam trap

The trap here is assuming any high CPU or context-switch symptom points to the block controller, when the described load is clearly network-driven.

3
MCQhard

A Packer build targeting the qemu builder completes, but the resulting image boots to a login prompt and never runs your provisioning scripts. You configured an ssh communicator with a username and password. Which condition most likely prevents Packer from connecting to the guest during the build?

A.The guest firewall blocks outbound traffic on port 22.
B.The qemu builder does not support SSH communicators and only works with the none communicator.
C.Packer requires an Ansible provisioner to be defined before any shell provisioner can execute.
D.The communicator expects the SSH service to be available on a port that the guest has not yet opened, and no boot command waits for cloud-init or sshd to start.
AnswerD

With the qemu builder, Packer starts the VM and immediately tries to SSH using the configured credentials. If the image does not start sshd early or if the boot command does not wait for the SSH port to become reachable, the communicator times out and provisioning never runs. Ensuring sshd is enabled and adding appropriate boot wait logic resolves this.

Why this answer

Packer's qemu builder boots the image and then relies on the configured communicator to run provisioners. If sshd is not started early or the boot command does not poll for the SSH port, the communicator times out and no provisioning occurs. Verifying that the image enables SSH at boot and adding boot wait logic ensures Packer can connect and execute the scripts.

Exam trap

The trap here is focusing on provisioner configuration or outbound firewall rules when the real cause is that the guest's SSH service is not reachable at the moment Packer attempts to connect.

4
MCQhard

A libvirt storage pool of type 'dir' contains several qcow2 images. You want to create a new snapshot of an existing VM using virsh. Which command sequence is required to create an internal snapshot of the VM's current state?

A.virsh snapshot-create-as --domain <vm> <snapshot_name> --disk-only
B.virsh snapshot-create-as --domain <vm> <snapshot_name>
C.qemu-img snapshot -c <snapshot_name> <image_path>
D.virsh domblklist <vm> --snapshot
AnswerB

Internal snapshots store state inside the qcow2 image itself, and snapshot-create-as creates one against the running domain's current state without requiring a separate disk-only or external file. The --domain and snapshot name arguments are sufficient; no --disk-only or --atomic flags are needed.

Why this answer

The command 'virsh snapshot-create-as --domain <vm> <snapshot_name>' creates an internal snapshot of the VM, capturing the state of all its disks and optionally memory. This is the default behavior for virsh snapshot-create-as when no '--disk-only' or '--memspec' is specified, and it requires the disk format to support snapshots (e.g., qcow2).

Exam trap

The trap is confusing internal vs. external snapshots or using qemu-img directly instead of virsh, which may not capture the full VM state or integrate with libvirt.

How to eliminate wrong answers

Option A is wrong because '--disk-only' creates an external disk-only snapshot, not an internal snapshot of the current state. Option C is wrong because 'qemu-img snapshot -c' creates a snapshot at the image level, but it does not capture the VM's memory state and is not managed by libvirt; it also requires the VM to be paused or the image to be inactive. Option D is wrong because 'virsh domblklist <vm> --snapshot' lists block devices, not create a snapshot.

5
MCQmedium

A system administrator is troubleshooting a container that cannot resolve DNS names for other containers on the same user-defined Docker bridge network. The container's /etc/resolv.conf points to 127.0.0.11. Which Docker feature is responsible for providing this DNS resolution?

A.The Docker daemon's --dns flag
B.A DNS server running in a separate container
C.Docker's embedded DNS server
D.The host's systemd-resolved service
AnswerC

Docker runs an embedded DNS server for user-defined networks, which listens on 127.0.0.11 and resolves container names and aliases. It allows containers on the same network to communicate using their names. This server is automatically configured in the container's /etc/resolv.conf. It is the correct mechanism for service discovery within a user-defined bridge network.

Why this answer

Docker's embedded DNS server provides name resolution for containers on user-defined networks. It listens on 127.0.0.11 and resolves container names and aliases, enabling service discovery. This is automatically configured and does not require an external DNS server.

The host's resolver or a separate DNS container would not be used by default in this scenario.

Exam trap

The trap here is assuming that the host's DNS resolver or an external DNS server is used for container name resolution, overlooking Docker's built-in DNS for user-defined networks.

6
MCQeasy

Which hypervisor is known for being 'Type 2'?

A.VirtualBox
B.KVM
C.ESXi
D.Xen
AnswerA

VirtualBox installs as an application atop an existing host operating system and relies on it for hardware access, which is the defining characteristic of Type 2 virtualisation, unlike bare-metal Type 1 hypervisors such as Xen or ESXi.

Why this answer

VirtualBox is classified as a Type 2 hypervisor because it runs as an application on top of a host operating system (Windows, Linux, macOS), relying on the host OS for scheduling, memory management, and I/O. It does not run directly on bare metal like Type 1 hypervisors. This hosted architecture is the defining characteristic of Type 2.

Exam trap

The trap here is confusing KVM's Linux-hosted appearance with a Type 2 hypervisor — candidates see 'runs on Linux' and pick KVM, missing that KVM is kernel-integrated and therefore Type 1.

How to eliminate wrong answers

Option B is wrong because KVM is a Type 1 hypervisor — it is implemented as a Linux kernel module (kvm.ko) that turns the host kernel itself into a hypervisor, running directly on hardware. Option C is wrong because VMware ESXi is a bare-metal Type 1 hypervisor with its own microkernel (vmkernel) and no underlying general-purpose OS. Option D is wrong because Xen is a Type 1 hypervisor that runs directly on hardware and hosts guest domains via the Xen hypervisor layer, even in its paravirtualized mode.

7
Multi-Selecthard

Which TWO of the following are true regarding the differences between rkt (Rocket) and Docker?

Select 2 answers
A.rkt only supported binary images
B.Docker is a sub-project of rkt
C.Docker never had a daemon
D.rkt utilized a daemonless architecture
E.rkt natively supported Kubernetes Pods
AnswersD, E

Rocket's daemonless design removes the long-running central daemon that Docker relied on, so containers launch directly via the rkt CLI without a persistent broker process. This satisfies the stem's architectural difference: no privileged daemon means a reduced attack surface and independent container lifecycle management.

Why this answer

Option D is correct because rkt was designed with a daemonless architecture, meaning containers were launched directly by the rkt CLI process without a long-running central daemon like Docker's dockerd. Option E is correct because rkt natively understood the concept of a Pod (a group of co-located containers sharing namespaces), which aligned with Kubernetes' Pod abstraction and allowed rkt to run Kubernetes Pods directly via its pod manifest support. Options A, B, and C are incorrect: rkt supported multiple image formats (including Docker images and ACI), Docker is not a sub-project of rkt (they are independent, competing container runtimes), and Docker has always relied on a daemon (dockerd) to manage containers.

Exam trap

The trap is mixing up which runtime had which feature — candidates often assume Docker was always daemonless or that rkt was Docker-based, but the exam tests the specific architectural contrast between the two.

8
MCQhard

In a FreeBSD Jail, how can you ensure the jail starts automatically at boot?

A.Set jail_enable=YES in /etc/rc.conf
B.Create a symlink in /etc/init.d
C.Use systemd
D.Add a cron job
AnswerA

Setting `jail_enable=YES` in `/etc/rc.conf` activates FreeBSD's `rc.d/jail` framework, which reads the `jail_list` variable and starts each named jail during the multi-user boot phase. This satisfies the stem's boot-persistence constraint directly, without requiring manual `jail` invocations or external schedulers.

Why this answer

On FreeBSD, the rc system reads /etc/rc.conf at boot, and setting `jail_enable="YES"` activates the jail subsystem so that jails defined in /etc/jail.conf (or jail_* variables) are started by the rc.d/jail script. Without this flag, jails must be started manually with `service jail start` or `jexec`.

Exam trap

The trap is assuming FreeBSD uses Linux-style init mechanisms (systemd, /etc/init.d), when in fact FreeBSD's rc.conf/rc.d system is entirely different and is the only correct answer.

How to eliminate wrong answers

Option B is wrong because /etc/init.d is a SysV-style init directory used on Linux distributions, not FreeBSD, which uses /etc/rc.d and rc.conf. Option C is wrong because systemd is a Linux init system and is not present on FreeBSD, which uses the BSD rc system. Option D is wrong because a cron job would only start the jail at a scheduled time, not at boot, and is not the idiomatic or reliable mechanism for boot-time jail startup.

9
Multi-Selectmedium

Which TWO of the following are common ways to connect to a virtual machine's console?

Select 2 answers
A.Telnet
B.VNC
C.HTTP
D.FTP
E.Spice
AnswersB, E

VNC provides graphical console access to a virtual machine by exposing a remote framebuffer, letting clients view and control the guest's display. It satisfies the stem's console-connection requirement, unlike SSH, which requires a running guest OS and network reachability.

Why this answer

VNC (Option B) is correct because it is a widely used remote framebuffer protocol that provides graphical console access to a virtual machine, commonly exposed by hypervisors such as KVM/QEMU, Xen, and VMware for out-of-band console connections. Spice (Option E) is also correct because it is a remote-display protocol designed specifically for virtualized environments (notably KVM/QEMU via libvirt) that delivers the VM's graphical console, including keyboard, video, and mouse. Telnet (Option A) is a text-based terminal protocol for remote shell access, not a VM graphical console mechanism, and it is insecure besides.

HTTP (Option C) is an application-layer protocol for serving web content, not a console-connection method. FTP (Option D) is a file-transfer protocol and has nothing to do with interactive console access.

Exam trap

The trap is picking generic remote-access protocols like Telnet or HTTP because they sound like 'console' technologies, when the question is specifically about graphical VM console protocols (VNC and Spice).

10
MCQmedium

A Docker host runs a container with the default bridge network. The container needs to resolve external DNS names, but `docker exec mycontainer ping example.com` fails with 'unknown host'. The host itself resolves names correctly. Which Docker daemon configuration should you check first?

A.The `--iptables` flag in the Docker daemon configuration
B.The `--userland-proxy` setting in the Docker daemon
C.The `--dns` flag or `dns` setting in `/etc/docker/daemon.json`
D.The `--bridge` flag specifying a custom bridge interface
AnswerC

Containers on the default bridge receive DNS configuration from the Docker daemon unless overridden per container. If the daemon's `dns` setting points to an unreachable resolver, name resolution fails inside the container even though the host resolves fine. Checking `/etc/docker/daemon.json` for a `dns` entry or the `--dns` daemon flag is the correct first step.

Why this answer

Containers using the default bridge network inherit DNS resolver settings from the Docker daemon. When the host resolves names but the container does not, the daemon's DNS configuration is the prime suspect. Inspecting `/etc/docker/daemon.json` for a `dns` key or the daemon's `--dns` flag reveals whether an unreachable or incorrect resolver was injected into the container.

Exam trap

The trap here is assuming that a working host resolver automatically means the container uses the same resolver, when Docker may inject its own DNS settings.

11
MCQmedium

Which Docker network driver should you use if you want containers to have their own IP addresses on the physical network, as if they were physically connected to the network?

A.bridge
B.overlay
C.ipvlan
D.macvlan
AnswerD

macvlan assigns each container its own MAC and IP address on the parent interface, making it appear directly attached to the physical network. This satisfies the stem's requirement for containers to hold their own IPs on the physical network, unlike bridge, which uses NAT.

Why this answer

The macvlan driver assigns each container a unique MAC address and IP address on the physical network, making containers appear as physical devices to the network. This is exactly the behavior described — containers get their own IPs on the physical network.

Exam trap

The trap is confusing macvlan with ipvlan; candidates see 'own IP addresses' and pick ipvlan, but the key differentiator is that macvlan gives each container a unique MAC address on the physical network, while ipvlan shares the MAC.

How to eliminate wrong answers

Option A is wrong because the bridge driver creates an internal virtual network with NAT, so containers do not appear on the physical network with their own IPs. Option B is wrong because overlay is for multi-host container communication across hosts, not for direct physical network presence. Option C is wrong because ipvlan shares the parent interface's MAC address and is used for L2/L3 mode routing, not for giving each container a distinct MAC on the physical network.

12
MCQmedium

You need to change the MAC address of a network interface for a virtual machine. Where is this configured?

A.Via the 'virsh set-mac' command
B.In the qemu-system-x86_64 startup parameters
C.In the host's /etc/network/interfaces
D.Inside the <interface> tag of the VM XML
AnswerD

Editing the `<interface>` element in the VM's XML definition sets the `mac address` attribute directly, satisfying the requirement to change a virtual machine's NIC hardware address. Libvirt applies this at the hypervisor layer, so the guest receives the new MAC on next start, independent of any guest OS configuration.

Why this answer

A VM's MAC address is defined in the libvirt domain XML inside the <interface> element, typically as <mac address='52:54:00:...'/> within <interface type='network'> or <interface type='bridge'>. Editing this XML and redefining the domain is the standard way to change a VM's MAC address.

Exam trap

The trap is inventing a virsh set-mac command that does not exist — candidates assume every VM attribute has a dedicated virsh verb, when in fact MAC changes go through XML editing.

How to eliminate wrong answers

Option A is wrong because there is no virsh set-mac command — virsh has no such subcommand; MAC changes are done via XML editing (virsh edit) or attach/detach operations. Option B is wrong because while QEMU does accept -net nic,macaddr=... on its command line, libvirt-managed VMs do not expose this directly; libvirt generates the QEMU command line from the domain XML, so editing QEMU parameters is not the configuration point. Option C is wrong because /etc/network/interfaces on the host configures the host's own physical NICs, not the virtual NICs of guest VMs.

13
MCQmedium

What is the purpose of the 'virt-install' tool?

A.Migrating virtual machines
B.Provisioning new virtual machines
C.Monitoring VM performance
D.Editing VM XML
AnswerB

virt-install creates and defines new libvirt domains, building the guest's XML definition and starting installation from a specified source. Provisioning new virtual machines is exactly its function, unlike virsh define, which only registers pre-existing XML without creating a guest.

Why this answer

virt-install is a command-line tool from the virt-manager suite used to provision new virtual machines on libvirt-managed hypervisors. It creates the domain XML, allocates resources (CPU, memory, disk, network), and starts the guest in one operation, optionally launching an installation via PXE, ISO, or network boot. Its core purpose is VM creation, not post-creation management.

Exam trap

The trap is conflating virt-install with other virt-* tools — candidates who don't distinguish provisioning (virt-install) from management (virsh) or monitoring (virt-top) pick the wrong verb.

How to eliminate wrong answers

Option A is wrong because VM migration is handled by virsh migrate or virt-manager's migration wizard, not virt-install. Option C is wrong because performance monitoring is done with tools like virt-top, virsh domstats, or host-level utilities such as top and iostat — virt-install has no monitoring role. Option D is wrong because editing VM XML is done with virsh edit or virsh define, not virt-install, which only creates new domains.

14
MCQhard

You are configuring a virtual network with a static IP address for a VM. Where do you define the DHCP host entry in the libvirt network XML?

A.<ip-assignment mac='...' ip='...'/>
B.<dhcp><host mac='...' name='...' ip='...'/></dhcp>
C.<dhcp-host mac='...' ip='...'/>
D.<static-ip mac='...' ip='...'/>
AnswerB

Static addressing in libvirt is delivered through the network's DHCP section, where a host element binds a MAC address to a fixed IP. Placing the host entry inside the dhcp block ensures the guest receives that reserved address instead of a pooled lease, meeting the stem's static IP requirement.

Why this answer

In libvirt's network XML schema, static DHCP reservations are declared inside the <dhcp> element using a <host> child element, which binds a MAC address to a fixed IP (and optionally a name). The syntax <dhcp><host mac='...' name='...' ip='...'/></dhcp> is the canonical form recognized by libvirt's network parser when the network is in 'nat' or 'isolated' forward mode with a DHCP range defined. This ensures dnsmasq hands the same IP to the VM every time it boots.

Exam trap

The trap here is confusing dnsmasq's native configuration keywords (dhcp-host) with libvirt's XML schema elements (<dhcp><host/>), causing candidates to pick the option that 'looks like' the dnsmasq directive rather than the actual libvirt XML.

How to eliminate wrong answers

Option A is wrong because <ip-assignment> is not a valid libvirt network XML element — no such tag exists in the schema. Option C is wrong because <dhcp-host> is a dnsmasq configuration directive, not a libvirt XML element; libvirt translates <dhcp><host/></dhcp> into dnsmasq's dhcp-host internally. Option D is wrong because <static-ip> is not part of the libvirt network XML vocabulary; static addressing is expressed via the DHCP host entry, not a dedicated static-ip tag.

15
Multi-Selectmedium

You are configuring a KVM guest to use a paravirtualized clock and to report its IP addresses to the host so that libvirt can display them with virsh domifaddr. (Choose two.)

Select 2 answers
A.Install and run the qemu-guest-agent inside the guest and add the agent channel to the domain XML.
B.Add a <timer name='kvmclock' present='yes'/> element under <clock> in the domain XML.
C.Set <features><acpi/></features> to enable ACPI shutdown handling in the guest.
D.Add <driver name='qemu' type='raw'/> to the disk definition to improve guest timekeeping.
E.Configure a <hostdev> entry for the guest's physical network interface to expose the IP address.
AnswersA, B

The QEMU guest agent communicates over a virtio-serial channel and allows the host to query guest network interfaces, including IP addresses. libvirt's virsh domifaddr --source agent relies on this agent. Adding the channel device and installing the agent package inside the guest satisfies the IP reporting requirement.

Why this answer

The paravirtualized clock is enabled through the kvmclock timer in the domain's clock configuration, and IP address reporting requires the QEMU guest agent running in the guest plus the associated virtio-serial channel. Together these two settings satisfy both requirements. ACPI, hostdev passthrough, and disk driver tuning address different concerns and do not provide either capability.

Exam trap

The trap here is conflating general guest configuration features such as ACPI or disk driver selection with the specific mechanisms that provide a paravirtualized clock and guest-reported IP addresses.

16
MCQeasy

When building a Dockerfile, which instruction should be used to define the user context for subsequent RUN, CMD, and ENTRYPOINT instructions?

A.USER
B.WORKDIR
C.RUN useradd
D.AS
AnswerA

USER sets the runtime user for all subsequent RUN, CMD and ENTRYPOINT instructions in the Dockerfile, satisfying the stem's user-context constraint. It changes the UID/GID used during build and at container start, unlike WORKDIR, which only alters the working directory.

Why this answer

The USER instruction in a Dockerfile sets the user (and optionally group) that subsequent RUN, CMD, and ENTRYPOINT instructions will execute as. It changes the runtime identity inside the image for all following instructions and for the container's default process. This is the standard way to drop root privileges in a container image.

Exam trap

The trap is confusing USER with WORKDIR or with RUN useradd — candidates assume creating a user is enough, forgetting that only USER actually switches the execution identity for subsequent instructions.

How to eliminate wrong answers

Option B is wrong because WORKDIR sets the working directory for subsequent instructions, not the user identity. Option C is wrong because RUN useradd creates a user account but does not switch the execution context — you would still need a USER instruction afterward to actually run as that user. Option D is wrong because AS is used with multi-stage builds (FROM ...

AS name) to name a build stage, not to set a user context.

17
MCQhard

When configuring a systemd-nspawn container, what is the effect of the --private-network option?

A.It isolates the container's network from the host
B.It forces the container to use a bridge
C.It disables network encryption
D.It restricts access to localhost
E.It prevents the container from starting
AnswerA

--private-network gives the container its own isolated network namespace, separate from the host's interfaces and routing table. This satisfies the requirement to isolate container traffic, preventing direct host network access unless a virtual Ethernet link is explicitly configured.

Why this answer

The --private-network option in systemd-nspawn creates a new, isolated network namespace for the container. This means the container gets its own loopback interface and no external network interfaces, completely separating its network stack from the host's. As a result, the container cannot communicate with the host or external networks unless additional virtual interfaces are configured.

Exam trap

The trap here is confusing network isolation with network configuration; candidates might think --private-network sets up a bridge or restricts localhost access, but it simply creates an isolated network namespace.

How to eliminate wrong answers

Option B is wrong because --private-network does not force the use of a bridge; bridging requires explicit configuration such as --network-bridge=, and the option itself only isolates the network namespace. Option C is wrong because network encryption is not a feature of systemd-nspawn's networking options; the option has nothing to do with encryption. Option D is wrong because restricting access to localhost is not the purpose; the container gets its own loopback, but the option does not restrict host localhost access specifically.

Option E is wrong because the option does not prevent the container from starting; it simply configures an isolated network namespace.

18
MCQmedium

A Docker container running a web server is unable to serve traffic on port 8080. You verify the Dockerfile exposes port 80. What is the correct way to map this for external access?

A.docker run -p 80:8080
B.docker run -p 8080:80
C.docker run --net host
D.docker run --expose 8080
E.docker run -P 8080
AnswerB

The -p 8080:80 flag publishes host port 8080 to container port 80, where the web server actually listens per the Dockerfile. EXPOSE alone only documents the port; explicit publishing is required for external access, satisfying the stem's mapping requirement.

Why this answer

The -p flag syntax is HOST_PORT:CONTAINER_PORT. Since the web server inside the container listens on port 80 (per the Dockerfile EXPOSE), and you want it reachable on host port 8080, the correct mapping is -p 8080:80 — host 8080 forwards to container 80. Docker's userland proxy or iptables DNAT rules then translate incoming traffic on the host's 8080 to the container's 80.

Exam trap

305-300 often tests whether candidates reverse the -p HOST:CONTAINER order or confuse EXPOSE (metadata only) with -p (actual publishing), leading them to pick -p 80:8080 or --expose.

How to eliminate wrong answers

Option A is wrong because -p 80:8080 maps host port 80 to container port 8080, but the container's web server listens on 80, so traffic would hit a closed port inside the container. Option C is wrong because --net host removes network isolation entirely, making the container share the host's network namespace — the server would bind directly to host port 80, not 8080, and this bypasses port mapping rather than solving it. Option D is wrong because --expose only documents a port in metadata; it does not publish it to the host, so external access is still impossible.

Option E is wrong because -P (capital) publishes all EXPOSEd ports to random host ports and does not accept a port argument like '8080'.

19
MCQmedium

Which libvirt network type uses a bridge on the host to connect virtual machines directly to the physical network?

A.bridge
B.nat
C.isolated
D.direct
AnswerA

A bridge network binds a host bridge interface to the physical NIC, so guest traffic shares the host's LAN segment and receives addresses from the same DHCP scope. This satisfies the requirement for direct physical-network connectivity rather than NAT or an isolated virtual switch.

Why this answer

A libvirt network of type 'bridge' uses an existing host bridge (e.g., br0) to connect guest interfaces directly to the physical LAN. The guests obtain IPs from the same DHCP server as the host and appear as peers on the physical network. This is the standard way to give VMs routable, first-class network presence.

Exam trap

The trap is confusing 'direct' (macvtap) with 'bridge' — both connect to the physical network, but only bridge uses a host bridge device.

How to eliminate wrong answers

Option B (nat) is wrong because NAT networks use libvirt's default virbr0 with dnsmasq and iptables masquerading, hiding guests behind the host's IP rather than bridging them to the physical network. Option C (isolated) is wrong because isolated networks have no uplink at all — guests can only talk to each other and the host, with no physical network connectivity. Option D (direct) is wrong because 'direct' uses macvtap to attach a guest NIC directly to a physical interface, bypassing the host bridge; it does not use a bridge on the host.

20
Multi-Selectmedium

Which TWO of the following are valid storage pool types in libvirt?

Select 2 answers
A.nfs-server
B.virtual-disk
C.logical
D.remote-disk
E.iscsi
AnswersC, E

logical is a libvirt storage pool type backed by an LVM volume group, where volumes are created as logical volumes. It is a genuine pool driver alongside dir, fs, netfs, disk, iscsi, scsi and mpath.

Why this answer

Option C (logical) is correct because libvirt defines a 'logical' storage pool type that manages LVM volume groups, allowing volumes to be created as logical volumes within an existing VG. Option E (iscsi) is correct because libvirt supports an 'iscsi' storage pool type that connects to an iSCSI target and exposes its LUNs as volumes via the iscsi-direct or iscsi pool driver. The other options are not valid libvirt pool types: 'nfs-server' is not a pool type (NFS is handled by the 'netfs' pool type), 'virtual-disk' is not a recognized libvirt pool type, and 'remote-disk' is not a libvirt pool type either.

Valid libvirt pool types include dir, fs, netfs, logical, disk, iscsi, scsi, mpath, rbd, sheepdog, gluster, zfs, and vstorage, which confirms that only logical and iscsi fit the scenario.

Exam trap

The trap is that candidates might think any storage-related term is a valid pool type, but libvirt has a specific set; 'nfs-server' and 'remote-disk' sound plausible but are not valid.

21
MCQmedium

You are running a Docker container and need to map port 8080 on the host to port 80 in the container. Which command argument should you use?

A.-p 80:8080
B.-p 8080:80
C.--port 8080:80
D.--map 8080:80
AnswerB

Docker's -p flag takes host-port:container-port order, so -p 8080:80 publishes host port 8080 and forwards it to port 80 inside the container. Reversing the pair would map the ports the wrong way round, failing the stem's stated mapping.

Why this answer

The -p flag (short for --publish) maps a host port to a container port using the format -p HOST_PORT:CONTAINER_PORT. Since the requirement is to expose container port 80 on host port 8080, the correct syntax is -p 8080:80. Docker's port publishing always places the host port on the left of the colon and the container port on the right.

Exam trap

The trap here is the ordering of host and container ports — candidates frequently reverse them under time pressure, forgetting that the host port always comes first in the -p HOST:CONTAINER syntax.

How to eliminate wrong answers

Option A is wrong because -p 80:8080 reverses the mapping, publishing container port 8080 on host port 80, which is the opposite of what was requested. Option C is wrong because --port is not a valid Docker CLI flag; the long form is --publish, not --port. Option D is wrong because --map is not a Docker CLI flag at all — Docker uses -p/--publish for port mapping, not --map.

22
MCQmedium

Which Dockerfile instruction is used to copy a file from the host file system into the image?

A.RUN
B.ADD
C.PUSH
D.COPY
E.IMPORT
AnswerD

COPY transfers files or directories from the build context on the host into the image filesystem at the specified destination. Unlike ADD, it performs no URL fetching or archive extraction, making it the precise instruction for the stem's host-to-image copy requirement.

Why this answer

The COPY instruction copies files or directories from the build context (host) into the image filesystem. It is the preferred instruction for straightforward file copying because it does not perform any automatic extraction or remote URL fetching. COPY is explicit and predictable.

Exam trap

The trap is choosing ADD over COPY because ADD sounds more capable, but the exam expects COPY as the explicit, predictable instruction for copying files from the host into the image.

How to eliminate wrong answers

Option A (RUN) is wrong because RUN executes commands during build (e.g., apt-get install) and does not copy files from the host. Option B (ADD) is wrong because while ADD can copy files, it also auto-extracts local tar archives and can fetch remote URLs, making it less predictable; the question asks for the instruction used to copy a file, and COPY is the canonical answer. Option C (PUSH) is wrong because it is not a Dockerfile instruction; docker push uploads images to a registry.

Option E (IMPORT) is wrong because it is not a Dockerfile instruction; docker import creates an image from a tarball.

23
MCQeasy

You are using Vagrant to manage a development environment. You need to run a shell script that installs dependencies after the VM boots for the first time. Which provisioner type should you use in your Vagrantfile?

A.shell
B.ansible_local
C.docker
D.file
AnswerA

The shell provisioner runs scripts or inline commands on the guest. It is commonly used to install packages and configure the VM. By specifying a shell script, Vagrant will execute it during provisioning, which meets the requirement of installing dependencies after boot.

Why this answer

Vagrant's shell provisioner is designed to execute shell scripts or inline commands on the guest machine. It is the standard way to install software and configure a VM during provisioning. Other provisioners like file, ansible_local, or docker serve different purposes and would not directly run a shell script to install dependencies.

Thus, the shell provisioner is the correct choice.

Exam trap

The trap here is overcomplicating the solution by choosing a configuration management tool when a simple shell script suffices.

24
MCQmedium

You have a qcow2 disk image that is growing too large. You want to shrink the file size on the host while keeping the virtual disk the same size. Which steps must you perform first?

A.Run fstrim in the guest, then use qemu-img convert -O qcow2.
B.Delete files in the guest and use qemu-img resize.
C.Use virsh blockpull.
D.Use qemu-img check -r all.
E.Run dd if=/dev/zero to fill the disk.
AnswerA

fstrim discards unused guest blocks so the qcow2 file no longer stores them, then qemu-img convert rewrites the image without those zeroed clusters. This satisfies the shrink-on-host constraint while preserving the virtual disk's nominal size.

Why this answer

To shrink a qcow2 file on the host while keeping the virtual disk size unchanged, you must first reclaim unused blocks inside the guest by running fstrim (which issues TRIM/discard to the virtual disk), then compact the image with qemu-img convert -O qcow2, which rewrites only allocated clusters into a new sparse file. This two-step process is the standard method for reducing qcow2 on-disk footprint without altering the guest's visible disk capacity.

Exam trap

The trap here is assuming that deleting files inside the guest or running qemu-img resize will shrink the qcow2 file, when in fact only fstrim followed by qemu-img convert reclaims host space without changing the virtual disk size.

How to eliminate wrong answers

Option B is wrong because deleting files in the guest does not automatically free clusters in the qcow2 file (the image remains sparse-allocated), and qemu-img resize changes the virtual disk size rather than compacting the file. Option C is wrong because virsh blockpull is used to merge a backing chain (e.g., after snapshots) into the base image, not to reclaim unused space. Option D is wrong because qemu-img check -r all repairs image metadata corruption; it does not shrink the file.

Option E is wrong because writing zeros with dd fills the disk with allocated zero clusters, which increases rather than decreases the image size (unless combined with discard, which is not the same as fstrim).

25
Multi-Selectmedium

Which THREE instructions in a Dockerfile can modify the image's filesystem?

Select 3 answers
A.ADD
B.ENV
C.EXPOSE
D.RUN
E.COPY
AnswersA, D, E

ADD copies files from a build context or remote URL into the image filesystem, creating a new layer that persists in the resulting image. This directly modifies image content, satisfying the question's requirement for instructions that change the filesystem, unlike metadata-only directives such as CMD or ENTRYPOINT.

Why this answer

ADD is correct because it copies files, directories, or remote URLs from the build context or a URL into the image filesystem, creating or modifying files in the resulting layer. RUN is correct because it executes a command in a new layer on top of the current image and commits the results, so commands like apt-get install or mkdir directly modify the image's filesystem. COPY is correct because it copies files or directories from the build context into the image filesystem, adding them as a new layer.

ENV is not correct because it only sets environment variables in the image metadata and does not alter any files. EXPOSE is not correct because it only documents the intended network port in image metadata and does not change the filesystem.

Exam trap

The trap is assuming metadata instructions like ENV or EXPOSE modify the filesystem — candidates must distinguish between instructions that create image layers (ADD, COPY, RUN) and those that only set metadata.

26
MCQeasy

What is the primary function of the libvirtd daemon?

A.To manage kernel modules for KVM
B.To emulate physical hardware for the host
C.To provide a graphical interface for QEMU
D.To act as a management API for virtualization technologies
AnswerD

libvirtd runs as a privileged daemon exposing a management API (via libvirt) that accepts remote or local calls to create, start, stop and inspect QEMU/KVM, Xen and LXC guests, decoupling management tooling from each hypervisor's native control interface.

Why this answer

The libvirtd daemon is the core management service in the libvirt ecosystem, providing a stable, hypervisor-agnostic API (via C, Python, etc.) that abstracts underlying virtualization technologies like KVM, QEMU, Xen, and LXC. It listens on a Unix socket (and optionally TCP) to accept management commands for creating, starting, stopping, and monitoring virtual machines. Thus, it acts as a management API for virtualization technologies, not as a hardware emulator or kernel module manager.

Exam trap

The trap here is confusing libvirtd with QEMU or KVM: candidates often think libvirtd emulates hardware or manages kernel modules, but it is purely a management API layer that abstracts hypervisors.

How to eliminate wrong answers

Option A is wrong because kernel modules for KVM (e.g., kvm.ko, kvm_intel.ko) are loaded by modprobe or udev, not by libvirtd; libvirtd only uses the KVM module via the hypervisor driver. Option B is wrong because hardware emulation for the host is performed by QEMU (or KVM in hardware-assisted mode), not by libvirtd; libvirtd orchestrates but does not emulate. Option C is wrong because libvirtd is a daemon with no graphical interface; graphical management is provided by tools like virt-manager, which communicate with libvirtd via its API.

27
MCQmedium

A KVM host runs a Windows guest whose virtual disk is backed by a raw image file on an NFS mount. After a host reboot, the guest fails to start with 'Permission denied' on the disk path, although the file exists and is readable by root. The host uses SELinux enforcing mode. Which action resolves the problem?

A.Add 'security_driver = "none"' to /etc/libvirt/qemu.conf and restart libvirtd.
B.Change the disk image ownership to 'qemu:qemu' with 'chown qemu:qemu' on the NFS-mounted file.
C.Set the SELinux boolean 'virt_use_nfs' with 'setsebool -P virt_use_nfs on'.
D.Run 'restorecon -R -v /var/lib/libvirt/images' to reset file contexts on the local image directory.
AnswerC

libvirt's QEMU process runs as a confined domain, and by default it is not permitted to access NFS-mounted storage. The virt_use_nfs boolean grants that access, and the -P flag makes it persistent across reboots. Enabling it lets the guest start immediately without relabeling files or disabling SELinux, which is the least-disruptive correct fix for this scenario.

Why this answer

A confined QEMU process cannot touch NFS storage unless the virt_use_nfs boolean is enabled, which is exactly what the Permission denied error after reboot indicates. The persistent form of setsebool applies the change across reboots. Relabeling local images, changing ownership, or disabling the security driver either targets the wrong path or weakens host security without solving the specific access denial.

Exam trap

The trap here is assuming any 'Permission denied' on a disk image is a UNIX ownership problem and reaching for chown instead of checking the SELinux AVC denial.

28
MCQmedium

You are configuring a KVM host that will run several guests. You want each guest to be able to communicate with other guests and the host on the same subnet, while still allowing external hosts to reach the guests directly. You decide to use a libvirt virtual network with a bridge. Which libvirt network configuration element must be present to enable direct Layer 2 connectivity between the guests and the physical LAN?

A.<forward mode='private'/> to isolate guest traffic from the host and external network.
B.<forward mode='nat'/> with a private subnet and DHCP range.
C.<forward mode='route'/> with a dedicated subnet and static routes on the physical router.
D.<forward mode='bridge'/> with a bridge name that matches an existing host bridge.
AnswerD

This is correct because a libvirt network using <forward mode='bridge'/> and a <bridge name='...'/> connects guests to an existing host bridge, giving them direct Layer 2 access to the physical LAN. Without this forwarding mode, libvirt would create an isolated NAT-based network, which would not allow external hosts to reach guests directly.

Why this answer

A libvirt network with forward mode bridge and a bridge name that matches an existing host bridge places guest interfaces directly on the physical LAN bridge, giving them Layer 2 connectivity to other guests, the host, and external hosts. NAT, routed, and private modes either hide guests behind NAT, require Layer 3 routing, or isolate them entirely, so they do not provide the required direct connectivity.

Exam trap

The trap here is assuming that any libvirt network with a DHCP range will automatically bridge guests onto the physical LAN, when in fact only forward mode bridge does that.

29
MCQmedium

Which file system format is specifically designed for QEMU/KVM to support advanced features like copy-on-write, snapshots, and compression?

A.vmdk
B.vhdx
C.qcow2
D.raw
AnswerC

qcow2 is QEMU's native disk image format, storing guest data in a sparse, redirect-on-write structure that natively supports internal snapshots, zlib/zstd compression and backing files. Raw images and VMDK lack these integrated copy-on-write capabilities, so qcow2 uniquely satisfies the stem's requirement for advanced QEMU/KVM features.

Why this answer

qcow2 (QEMU Copy-On-Write version 2) is the native QEMU/KVM disk image format designed to support copy-on-write, internal and external snapshots, zlib/zstd compression, and encryption. It grows dynamically as data is written and only allocates blocks on demand, making it ideal for VM images where space efficiency and snapshotting matter.

Exam trap

305-300 often tests whether candidates pick a widely known format like vmdk or raw based on familiarity, missing that qcow2 is the only one natively designed for QEMU/KVM copy-on-write, snapshots, and compression.

How to eliminate wrong answers

Option A is wrong because vmdk is VMware's disk format — QEMU can read/write it for compatibility, but it is not designed for QEMU/KVM's advanced features like qcow2 snapshots and compression. Option B is wrong because vhdx is Microsoft's Hyper-V format, again supported for interoperability but not the native format for QEMU/KVM advanced features. Option D is wrong because raw is a plain byte-for-byte image with no metadata, so it cannot support snapshots, copy-on-write, or compression natively — it is fast but feature-poor.

30
MCQmedium

You are configuring a Xen guest that requires direct hardware access to a specific network interface card. Which configuration parameter in the guest domain configuration file must be specified to enable PCI passthrough?

A.pci = [ '00:1f.1' ]
B.device_pass = 'eth0'
C.hw_access = '00:1f.1'
D.vif = [ 'type=pci, bus=00:1f.1' ]
AnswerA

The pci parameter in the guest domain configuration file lists host PCI devices to assign via passthrough, using BDF notation such as '00:1f.1'. Specifying it binds that NIC exclusively to the guest, satisfying the direct hardware access requirement.

Why this answer

In Xen guest configuration files, PCI passthrough is enabled by specifying the 'pci' parameter with a list of PCI addresses, e.g., pci = [ '00:1f.1' ]. This directly assigns the physical PCI device to the guest.

Exam trap

The trap is confusing network interface configuration (vif) with PCI passthrough, leading candidates to choose vif-based options.

How to eliminate wrong answers

Option B is wrong because 'device_pass' is not a valid Xen configuration parameter; PCI passthrough uses 'pci'. Option C is wrong because 'hw_access' is not a recognized parameter in Xen. Option D is wrong because 'vif' is used for virtual network interfaces, not PCI passthrough; the syntax 'type=pci' is invalid.

31
MCQmedium

When provisioning with Vagrant, which command is best used to apply changes to a configuration (like adding a new shell script) without destroying the existing virtual machine?

A.vagrant halt
B.vagrant reload
C.vagrant up
D.vagrant provision
AnswerD

`vagrant provision` re-runs the configured provisioners against the already-running guest, so a newly added shell script executes in place. It satisfies the stem's constraint of applying configuration changes without destroying the existing virtual machine, unlike `vagrant destroy` followed by `vagrant up`, which rebuilds from scratch.

Why this answer

The `vagrant provision` command is specifically designed to run provisioners (such as shell scripts, Ansible, Puppet, etc.) on a running Vagrant-managed VM without destroying or recreating it. When you modify a provisioning script or add a new one, `vagrant provision` applies those changes to the existing machine, ensuring the VM's state is updated according to the new configuration. This is the correct approach because it preserves the VM's current state while enforcing the updated provisioning logic.

Exam trap

The trap here is confusing `vagrant reload` with `vagrant provision`: many candidates assume that reloading the VM automatically re-runs provisioners, but by default it does not—you must add the `--provision` flag. Similarly, `vagrant up` is often mistakenly thought to re-provision an existing VM, but it only provisions on initial creation or when explicitly forced.

How to eliminate wrong answers

Option A is wrong because `vagrant halt` simply shuts down the running virtual machine gracefully; it does not apply any configuration changes or run provisioners. Option B is wrong because `vagrant reload` restarts the VM and, by default, does not re-run provisioners unless the `--provision` flag is explicitly added; without that flag, it only reloads the VM with the existing configuration. Option C is wrong because `vagrant up` is used to create and start a new VM from scratch or resume a halted one; if the VM is already running, it does nothing, and if it's halted, it starts it without necessarily re-provisioning unless the `--provision` flag is used, but it does not target an existing running VM for configuration updates.

32
MCQhard

You want to limit the bandwidth of a virtual network interface. Which XML element within <interface> allows you to configure this?

A.<bandwidth><inbound average='1000'/><outbound average='1000'/></bandwidth>
B.<limit-rate>1000</limit-rate>
C.<network-speed>1000</network-speed>
D.<traffic-control>1000</traffic-control>
AnswerA

The `<bandwidth>` element nests `<inbound>` and `<outbound>` children whose `average` attributes set throughput in kilobytes per second, directly satisfying the requirement to cap a virtual network interface's traffic. No other `<interface>` child exposes rate limiting, so this is the only element that configures the bandwidth constraint described.

Why this answer

The <bandwidth> element inside <interface> is the libvirt XML mechanism for traffic shaping on a virtual NIC. It contains <inbound> and <outbound> child elements, each accepting an 'average' attribute in kilobytes per second, which sets the token-bucket rate limit enforced by the host's traffic control subsystem.

Exam trap

The trap is that candidates may recall Linux tc as the underlying tool and pick a plausible-sounding tag like <traffic-control>, but libvirt's XML schema uses the specific <bandwidth> element with <inbound>/<outbound> children.

How to eliminate wrong answers

Option B is wrong because <limit-rate> is not a recognized libvirt interface element — no such tag exists in the domain XML schema. Option C is wrong because <network-speed> is not part of the libvirt interface specification; it resembles a made-up element. Option D is wrong because <traffic-control> is not a valid libvirt XML element for interface bandwidth; while Linux tc is the underlying mechanism, the XML tag is <bandwidth>.

33
MCQmedium

You are using systemd-nspawn to run a container and need to allow it to use the host's network stack directly, without any network namespace isolation. Which option should you pass to systemd-nspawn?

A.Do not specify any network-related option.
B.`--private-network`
C.`--network-namespace=host`
D.`--network-interface=host0`
AnswerA

By default, systemd-nspawn does not create a separate network namespace, so the container shares the host's network stack. If you omit all network options such as `--private-network` or `--network-interface`, the container uses the host's interfaces and routing directly. This is the intended way to achieve host network sharing with systemd-nspawn.

Why this answer

systemd-nspawn creates a new network namespace only when a network-related option is given. Without any such option, the container inherits the host's network namespace and thus shares its network stack. Options like `--private-network` or `--network-interface` would introduce isolation or a dedicated interface, which is not what the scenario requires.

Exam trap

The trap here is assuming that a special flag is needed to share the host network namespace, when in fact it is the default behavior.

34
MCQmedium

In a Vagrant environment, where should sensitive data like API keys be stored to avoid committing them to version control?

A.A box metadata file
B.The Vagrantfile
C.The provisioner script
D.A .env file excluded from git
AnswerD

A .env file excluded from git keeps API keys out of version control while remaining readable by provisioning scripts and applications at runtime. Adding it to .gitignore satisfies the stem's constraint of avoiding committed secrets, unlike hardcoding values or relying on tracked configuration files that would expose credentials in repository history.

Why this answer

Sensitive data such as API keys should be stored in a .env file that is excluded from version control (e.g., via .gitignore), so secrets are not committed to the repository. This keeps credentials out of source history while still allowing the application to load them at runtime.

Exam trap

305-300 often tests the misconception that secrets can be safely stored in the Vagrantfile or provisioner scripts, when in fact those are version-controlled and should never contain sensitive data.

How to eliminate wrong answers

Option A is wrong because a box metadata file describes the Vagrant box (name, version, provider) and is not intended for secrets; storing keys there would expose them and is not a supported pattern. Option B is wrong because the Vagrantfile is typically committed to version control and is meant for configuration, not secrets. Option C is wrong because provisioner scripts are also committed and would expose any embedded credentials.

35
Multi-Selectmedium

Which TWO of the following commands can be used to monitor VM resource utilization?

Select 2 answers
A.virsh domstats
B.virsh show-stats
C.virsh monitor-cpu
D.virsh check-load
E.virt-top
AnswersA, E

virsh domstats queries the libvirt hypervisor directly for per-domain metrics, returning CPU time, memory ballooning, block I/O and network interface counters for running guests. This satisfies the stem's requirement to monitor VM resource utilisation without relying on in-guest agents, which may be absent or unresponsive.

Why this answer

Option A, `virsh domstats`, is correct because it queries the libvirt hypervisor for detailed per-domain statistics such as CPU time, memory balloon usage, block I/O, and network interface counters, making it a valid VM resource-utilization monitoring command. Option E, `virt-top`, is correct because it is a top-like utility that displays real-time CPU, memory, and I/O utilization for individual guests running under libvirt/KVM. The remaining options do not belong: `virsh show-stats`, `virsh monitor-cpu`, and `virsh check-load` are not valid virsh subcommands, so they cannot be used to monitor VM resource utilization.

Exam trap

The trap here is confusing similar-sounding virsh subcommands; candidates might assume `virsh show-stats` or `virsh monitor-cpu` exist because they sound plausible, but only `virsh domstats` and `virt-top` are real monitoring tools.

36
MCQmedium

You are configuring LXC and want to set a CPU limit for a container. Which cgroup parameter is used to specify the quota of CPU time in microseconds?

A.lxc.cgroup.cpu.limit
B.lxc.cgroup.cpu.cfs_quota_us
C.lxc.cgroup.cpu.shares
D.lxc.cgroup.cpu.period_us
AnswerB

`lxc.cgroup.cpu.cfs_quota_us` sets the CFS bandwidth quota in microseconds per period, directly satisfying the stem's requirement for a CPU-time quota. Unlike `cpu.shares`, which only weights relative contention, this parameter enforces an absolute ceiling on runtime, so the container cannot exceed its allotted CPU time.

Why this answer

The cgroup CPU controller exposes the CFS (Completely Fair Scheduler) bandwidth control parameters cpu.cfs_quota_us and cpu.cfs_period_us. In LXC, these are set via the lxc.cgroup.cpu.cfs_quota_us key, which specifies the maximum CPU time (in microseconds) the container's tasks may consume within each period defined by cpu.cfs_period_us. Setting cfs_quota_us to 50000 with the default period of 100000 us effectively caps the container at 50% of one CPU core.

Exam trap

The trap here is confusing cpu.shares (relative weight, default 1024) with cpu.cfs_quota_us (absolute microsecond quota) — candidates who only remember 'shares controls CPU' pick option C.

How to eliminate wrong answers

Option A is wrong because lxc.cgroup.cpu.limit is not a real cgroup or LXC parameter — there is no 'cpu.limit' file in the cgroup v1 CPU controller, so this key would be silently ignored or cause an error. Option C is wrong because lxc.cgroup.cpu.shares sets a relative weight (default 1024) used by the CFS scheduler for proportional sharing when the CPU is contended, not an absolute quota of CPU time. Option D is wrong because lxc.cgroup.cpu.period_us defines the length of the scheduling period (default 100000 us) over which the quota is enforced, not the quota itself.

37
Multi-Selectmedium

You are reviewing a KVM host and need to identify which of the following CPU features must be exposed to a guest to allow hardware-assisted nested virtualization inside that guest. (Choose two.)

Select 2 answers
A.aes, to accelerate cryptographic operations in the guest
B.ept or npt, to provide second-level address translation
C.rdrand, to provide a hardware random number generator
D.hypervisor, to indicate the guest is running under a hypervisor
E.vmx or svm, depending on the host CPU vendor
AnswersB, E

Nested virtualization depends on hardware-assisted memory virtualization: Intel EPT or AMD NPT. These provide second-level address translation for the guest hypervisor's own guests. If the host does not expose ept or npt to the guest, nested VMs will either fail to start with hardware acceleration or fall back to slow shadow paging, making the feature impractical.

Why this answer

Hardware-assisted nested virtualization requires both the virtualization extension (vmx on Intel, svm on AMD) and the second-level address translation feature (ept on Intel, npt on AMD) to be exposed to the guest. Together they let the guest hypervisor run its own VMs with hardware acceleration. Flags like hypervisor, aes, and rdrand are unrelated to nesting and do not enable it.

Exam trap

The trap here is assuming that exposing only the vmx/svm flag is sufficient, when the second-level address translation feature (ept/npt) is equally required for practical nested virtualization.

38
MCQeasy

When configuring a VM in libvirt, you want to ensure the highest performance for disk I/O. Which driver type should you select for the disk device?

A.Virtio
B.SCSI
C.IDE
D.SATA
AnswerA

Virtio provides paravirtualised disk and network drivers, letting the guest cooperate with the host hypervisor rather than emulating real hardware. This bypasses the slow emulated IDE or SCSI path, delivering the highest disk I/O throughput and lowest latency the stem demands.

Why this answer

Virtio is a paravirtualized driver framework designed specifically for KVM/QEMU guests, allowing the guest to communicate with the host through shared memory rings rather than emulating real hardware. For disk I/O, virtio-blk (or virtio-scsi) bypasses much of the emulation overhead of IDE/SATA/SCSI, delivering significantly higher throughput and lower CPU utilization. That makes 'virtio' the correct choice when the goal is maximum disk I/O performance in libvirt.

Exam trap

The trap is assuming that 'SCSI' or 'SATA' sounds more modern or enterprise-grade than virtio, when in fact only virtio is paravirtualized — the exam tests whether you know that emulated controllers always lose to virtio for performance.

How to eliminate wrong answers

Option B is wrong because SCSI in a libvirt guest is typically emulated (e.g., LSI Logic or virtio-scsi) — plain emulated SCSI is slower than virtio-blk and only preferable when the guest lacks virtio drivers or needs SCSI-specific features. Option C is wrong because IDE is a legacy emulated controller with severe performance and device-count limitations (max 4 devices, no NCQ, slow PIO/DMA paths). Option D is wrong because SATA is also emulated and, while faster than IDE, still incurs full hardware emulation overhead compared to paravirtualized virtio.

39
Multi-Selecthard

Which THREE networking modes are natively supported by Docker?

Select 3 answers
A.bridge
B.gateway
C.tunnel
D.none
E.host
AnswersA, D, E

The bridge mode is Docker's default, creating a private internal network on the host and connecting containers to it through a virtual bridge interface. It is natively supported, making it one of the three networking modes the question requires.

Why this answer

Docker natively supports the bridge network driver (A), which creates a private internal network on the host and is the default mode for containers, allowing them to communicate via the docker0 virtual bridge. Docker also natively supports the none mode (D), which gives a container no network stack except a loopback interface, isolating it from all networking. The host mode (E) is natively supported as well, removing network isolation so the container shares the host's network namespace and IP stack directly.

The gateway (B) and tunnel (C) options are not Docker network drivers; gateway is a role or address concept rather than a mode, and tunnel describes overlay/VPN-style connectivity (e.g., Docker overlay or third-party plugins) rather than a native standalone Docker networking mode.

Exam trap

The trap is that 'gateway' and 'tunnel' sound like plausible network modes because they describe real networking concepts, but Docker's built-in driver list is specifically bridge, host, none, overlay, and macvlan — candidates who reason from general networking knowledge rather than Docker documentation pick the wrong options.

40
MCQmedium

You are provisioning a KVM guest with virt-install. The guest must use a pre-existing disk image located at /var/lib/libvirt/images/web.img and must not have the image created or modified by virt-install. Which option should you include in the virt-install command?

A.--disk path=/var/lib/libvirt/images/web.img,sparse
B.--disk path=/var/lib/libvirt/images/web.img,readonly
C.--disk path=/var/lib/libvirt/images/web.img,shareable
D.--disk path=/var/lib/libvirt/images/web.img,import
AnswerD

The import suboption tells virt-install to use the existing disk image without creating, resizing, or formatting it. This is the correct way to attach a pre-built image to a new domain definition. Without import, virt-install may attempt to create or modify the file, which is undesirable when the image already contains an installed OS.

Why this answer

When a disk image already exists and contains a bootable operating system, virt-install must be told not to create or format it. The import suboption within --disk achieves exactly this, allowing the new domain to boot from the existing image. Other suboptions such as readonly, shareable, or sparse address different storage behaviors and do not satisfy the requirement of reusing an unmodified image.

Exam trap

The trap here is confusing disk attributes like readonly or shareable with the import flag, which specifically prevents image creation or modification.

41
MCQeasy

You are using systemd-nspawn to run a container and want to ensure that the container's processes are isolated from the host's process tree. Which option should you use?

A.--private-users
B.--boot
C.Process isolation is enabled by default with PID namespaces; no additional option is needed.
D.--private-network
AnswerC

systemd-nspawn by default creates a PID namespace for the container, which isolates its processes from the host's process tree. Processes inside the container only see other processes in the same container, not those on the host. This is a fundamental isolation feature and does not require an extra flag. While other options like --private-users add user isolation, PID namespace isolation is always active unless explicitly disabled with --private-pid or similar, which is not the case here.

Why this answer

systemd-nspawn automatically sets up a PID namespace for each container, ensuring that processes inside the container are isolated from the host's process tree. This means container processes cannot see or interact with host processes, and vice versa. No additional option is needed to achieve this basic level of process isolation.

Other options like --private-users add user namespace isolation, but process isolation is a default behavior. Therefore, the correct answer is that no extra option is required.

Exam trap

The trap here is assuming that a specific flag is needed for process isolation, when in fact systemd-nspawn enables PID namespaces by default.

42
Multi-Selecthard

Which THREE features are provided by Linux Namespaces in the context of containers?

Select 3 answers
A.CPU scheduling
B.Disk quotas
C.PID isolation
D.Network isolation
E.Mount isolation
AnswersC, D, E

PID namespaces give each container its own process ID numbering, so processes inside see themselves starting at PID 1 and cannot observe or signal host processes. This delivers the process isolation the question asks for, preventing cross-container visibility of the host process tree.

Why this answer

Linux namespaces provide PID isolation (C), giving each container its own process ID tree so processes inside see their own PID 1 and cannot see host processes. Network isolation (D) is provided by the network namespace, which gives a container its own network interfaces, routing tables, and ports. Mount isolation (E) is provided by the mount namespace, allowing each container its own filesystem mount points independent of the host.

CPU scheduling (A) is handled by cgroups (cpu/cpuacct controllers), not namespaces, and disk quotas (B) are managed via filesystem quotas or cgroup blkio limits, not namespaces.

Exam trap

The trap is confusing namespaces (isolation) with cgroups (resource limiting), leading candidates to select CPU scheduling or disk quotas.

43
Multi-Selectmedium

Which THREE settings are commonly configured in the 'provider' block of a Vagrantfile for virtualbox?

Select 3 answers
A.gui
B.disk_size
C.cpus
D.network_type
E.memory
AnswersA, C, E

The `gui` setting in the VirtualBox provider block controls whether the virtual machine boots with a graphical interface or runs headless. Setting `gui = true` launches the VM window, satisfying scenarios requiring desktop interaction during provisioning, while the default headless mode suits automated, terminal-only workflows.

Why this answer

In a Vagrantfile, the provider block for VirtualBox accepts the settings gui, cpus, and memory, which are all valid VirtualBox provider options. Option A (gui) is correct because it controls whether the VirtualBox VM launches with a graphical user interface, a common provider-specific setting. Option C (cpus) is correct because it sets the number of virtual CPUs allocated to the VM through the VirtualBox provider.

Option E (memory) is correct because it specifies the amount of RAM in megabytes assigned to the VM by the VirtualBox provider. Option B (disk_size) is not a standard VirtualBox provider setting in Vagrant; disk resizing typically requires the vagrant-disksize plugin or manual VBoxManage commands. Option D (network_type) is not a valid Vagrant provider setting; networking is configured via config.vm.network with types like private_network or public_network.

Exam trap

The trap is including plausible-sounding but non-existent provider keys like `disk_size` or `network_type`, which belong to other configuration contexts (disk or network blocks) rather than the VirtualBox provider block.

44
MCQeasy

You are using QEMU/KVM with libvirt on a host and want to gracefully shut down a running domain named 'db01' so the guest OS performs its normal shutdown sequence. Which virsh command should you use?

A.virsh shutdown db01
B.virsh suspend db01
C.virsh destroy db01
D.virsh undefine db01
AnswerA

virsh shutdown sends an ACPI shutdown signal or, if the QEMU guest agent is configured, requests a graceful shutdown through the agent. The guest OS then runs its normal shutdown sequence, flushing filesystems and stopping services. This matches the requirement for a graceful shutdown of the running domain.

Why this answer

A graceful shutdown is initiated with virsh shutdown, which delivers an ACPI power-button event or uses the QEMU guest agent to request an orderly OS shutdown. This allows the guest to flush caches and stop services cleanly. Hard power-off, suspension, and configuration removal do not perform a graceful guest shutdown, so they do not meet the requirement.

Exam trap

The trap here is assuming virsh destroy is the standard 'stop' command, when it actually performs a hard power-off rather than a graceful shutdown.

45
MCQhard

A KVM host uses a bridged network 'br0' with the physical NIC enslaved. You want a guest to obtain an IP address from the same DHCP server as the host's physical LAN, without NAT. Which libvirt network interface definition in the domain XML achieves this?

A.<interface type='network'><source network='default'/><model type='virtio'/></interface>
B.<interface type='bridge'><source bridge='br0'/><model type='virtio'/></interface>
C.<interface type='ethernet'><target dev='vnet0'/><model type='virtio'/></interface>
D.<interface type='direct'><source dev='eth0' mode='bridge'/><model type='virtio'/></interface>
AnswerB

An interface of type bridge with source bridge br0 attaches the guest's virtio NIC directly to the host bridge, which is enslaved to the physical NIC. The guest then appears on the same Layer 2 segment as the host and can obtain an IP from the physical LAN's DHCP server without NAT, exactly as required.

Why this answer

To place a guest directly on the physical LAN through an existing host bridge, the domain XML must use an interface of type bridge whose source bridge is br0. This connects the guest's virtio NIC to the bridge enslaved to the physical NIC, so the guest shares the LAN segment and can use the same DHCP server without NAT. NAT networks, macvtap direct interfaces, and raw ethernet TAPs do not provide this exact behavior.

Exam trap

The trap here is assuming the libvirt 'default' network provides LAN-bridged connectivity, when it is actually a NAT network that isolates guests behind the host.

46
MCQeasy

When using Vagrant to manage a libvirt-based provider, which command verifies that the virtual machine is currently running and identifies the provider in use?

A.vagrant up
B.vagrant status
C.vagrant validate
D.vagrant box list
AnswerB

`vagrant status` queries the active Vagrant environment and reports each machine's state, showing "running" for the libvirt-backed VM, while the provider in use is confirmed through the environment's configuration. It satisfies both constraints in the stem: verifying the running state and identifying the libvirt provider.

Why this answer

The vagrant status command reports the current state of each machine defined in the Vagrantfile (running, poweroff, not created, etc.) and shows the provider in use (e.g., libvirt, virtualbox). It is the canonical way to verify that a VM is up and which provider is backing it.

Exam trap

The trap is confusing action commands (up, halt, destroy) with informational commands (status, validate, box list) — candidates must remember that only vagrant status reports both running state and provider.

How to eliminate wrong answers

Option A is wrong because vagrant up starts or resumes the machine rather than reporting its state — it is an action, not a status query. Option C is wrong because vagrant validate checks the syntax and structure of the Vagrantfile without touching running VMs or reporting provider state. Option D is wrong because vagrant box list enumerates installed box images on the host, not the running state or provider of a specific VM.

47
Multi-Selecthard

Which THREE of the following are valid components of a libvirt domain XML configuration?

Select 3 answers
A.<os>
B.<kernel-module>
C.<cpu>
D.<devices>
E.<network-config>
AnswersA, C, D

The <os> element defines the guest operating system type and boot configuration, including <type> for the hypervisor (hvm or kvm) and optional <loader> or <boot> entries. It is a mandatory child of the libvirt domain element, so it is a valid component of domain XML.

Why this answer

The <os> element (A) is a valid top-level component of a libvirt domain XML; it defines the guest OS boot configuration such as the boot device order and the type of firmware (for example <type>hvm</type> or <type>arch</type>). The <cpu> element (C) is also valid and specifies the CPU model and features exposed to the guest, such as <model>host-passthrough</model> or a named model like qemu64. The <devices> element (D) is a required top-level container in a libvirt domain XML that holds all guest device definitions, including disks, network interfaces, graphics, and controllers.

The unmarked options do not belong: <kernel-module> (B) is not a recognized libvirt domain XML element, and <network-config> (E) is not a valid libvirt domain XML element either (network configuration is expressed through <interface> entries inside <devices> and separate libvirt network XML files).

Exam trap

305-300 often tests whether candidates invent plausible-sounding XML elements like <network-config> or <kernel-module> that do not exist in the libvirt schema.

48
MCQeasy

What does the 'docker rm' command do?

A.Renames a container
B.Stops a container
C.Removes an image
D.Removes a container
AnswerD

'docker rm' deletes a stopped container from the local Docker host, removing its writable layer and metadata. It does not touch images, volumes, or running containers unless forced with -f, distinguishing it from 'docker rmi', which removes images.

Why this answer

docker rm removes one or more containers from the host, deleting their writable layer and metadata. It does not touch images, does not stop running containers unless -f is used, and does not rename anything. This is the counterpart to docker rmi, which removes images.

Exam trap

The trap is confusing docker rm (remove container) with docker rmi (remove image) — the similar names cause candidates to pick 'Removes an image' incorrectly.

How to eliminate wrong answers

Option A (Renames a container) is wrong because renaming is done with docker rename, not docker rm. Option B (Stops a container) is wrong because stopping is done with docker stop (or docker kill); docker rm only removes containers and will refuse to remove a running one without -f. Option C (Removes an image) is wrong because image removal uses docker rmi (or docker image rm); docker rm operates on containers, not images.

49
MCQeasy

Which hypervisor type is considered 'Type 1' virtualization?

A.VMware Workstation
B.VirtualBox
C.Xen
D.QEMU (user mode)
AnswerC

Xen is a bare-metal hypervisor that runs directly on host hardware beneath guest domains, which defines Type 1. It does not require a host operating system, unlike Type 2 products such as VirtualBox or VMware Workstation.

Why this answer

Xen is a Type 1 (bare-metal) hypervisor because it runs directly on the host hardware, with the hypervisor itself acting as the lowest software layer and managing guest domains. Type 1 hypervisors do not require a host OS underneath them, giving better performance and isolation for production virtualization. Xen's dom0 and domU architecture is a textbook example of this model.

Exam trap

The trap is that candidates associate 'virtualization software' with Type 1 and pick VMware Workstation or VirtualBox, forgetting that those are Type 2 because they require a host OS.

How to eliminate wrong answers

Option A is wrong because VMware Workstation is a Type 2 hypervisor that runs as an application on top of a host OS like Windows or Linux. Option B is wrong because VirtualBox is also a Type 2 hypervisor, installed as software on an existing operating system. Option D is wrong because QEMU in user mode performs CPU emulation and process-level virtualization without hardware-assisted bare-metal hypervisor behaviour; it is not a Type 1 hypervisor.

50
MCQmedium

A Docker container is failing to connect to an external database despite the host being able to ping it. You suspect a bridge networking issue. Which command allows you to inspect the current NAT rules created by Docker?

A.docker network inspect bridge
B.iptables -t nat -L -n
C.ip link show docker0
D.sysctl -a | grep net.bridge
AnswerB

Docker adds rules to the NAT table for port forwarding and masquerading.

Why this answer

The correct command is `iptables -t nat -L -n` because Docker uses iptables NAT rules to perform outbound masquerading for containers on bridge networks. When a container sends traffic to an external database, the packet is SNAT'd to the host's IP via rules in the nat table's POSTROUTING chain. Inspecting this table reveals whether Docker's MASQUERADE rule is present and correctly configured, which is essential for diagnosing connectivity failures.

Exam trap

The trap here is confusing network inspection commands (like `docker network inspect`) with packet-level NAT rule inspection; candidates often assume Docker's network inspect shows all networking details, but it does not reveal iptables NAT rules.

How to eliminate wrong answers

Option A is wrong because `docker network inspect bridge` only shows the bridge network's configuration (subnet, gateway, connected containers) but does not display the underlying iptables NAT rules that handle address translation. Option C is wrong because `ip link show docker0` only verifies the existence and state of the docker0 bridge interface, not the NAT rules that govern outbound traffic. Option D is wrong because `sysctl -a | grep net.bridge` lists kernel parameters related to bridge behavior (e.g., bridge-nf-call-iptables) but does not show the actual NAT rules created by Docker.

51
MCQhard

You need to add a second NIC to a VM via XML. How do you ensure the second NIC uses a different MAC address than the first one?

A.You cannot have two NICs in one VM
B.Add a second <interface> block with a unique <mac/>
C.Libvirt assigns the same MAC automatically
D.Use the same <mac/> but different <source/>
AnswerB

Each <interface> element defines one NIC, and its nested <mac address='...'/> sets that NIC's hardware address. Supplying a second interface block with a distinct MAC value guarantees the new NIC differs from the first, which libvirt requires to avoid conflicts.

Why this answer

Each network interface in a libvirt domain is defined by an <interface> element containing a <mac address='...'/> child. To add a second NIC, you add another <interface> block with a unique MAC address. Libvirt can auto-generate a MAC if omitted, but explicitly specifying a unique one ensures no conflict with the first NIC.

Exam trap

The trap is the misconception that libvirt automatically handles MAC uniqueness or that reusing a MAC with a different source is acceptable, when in fact duplicate MACs cause layer-2 conflicts.

How to eliminate wrong answers

Option A is wrong because libvirt fully supports multiple NICs per domain, up to the limit imposed by the guest OS and bus type. Option C is wrong because libvirt does not assign the same MAC automatically; it generates a random unique MAC per interface if not specified, and duplicate MACs would cause network conflicts. Option D is wrong because using the same MAC on two interfaces causes duplicate MAC address conflicts on the virtual network, breaking connectivity and violating Ethernet standards.

52
MCQmedium

Which file is primarily responsible for defining the configuration and environment variables for an OpenVZ container?

A./etc/openvz/config
B./var/lib/vz/config
C./etc/vz/container.conf
D./etc/vz/vz.conf
E./etc/vz/conf/CTID.conf
AnswerE

/etc/vz/conf/CTID.conf holds each OpenVZ container's configuration, including environment variables and resource limits, with CTID replaced by the container's numeric ID. This satisfies the stem's requirement for the file defining configuration and environment variables, since OpenVZ reads per-container settings from this path rather than a global file.

Why this answer

OpenVZ stores per-container configuration files in /etc/vz/conf/ using the container ID (CTID) as the filename, e.g., /etc/vz/conf/101.conf. This file defines resource limits, network settings, and environment variables for that specific container. The global OpenVZ configuration is in /etc/vz/vz.conf, but per-container settings live in the CTID.conf file.

Exam trap

The trap is confusing the global OpenVZ configuration file (/etc/vz/vz.conf) with the per-container configuration file (/etc/vz/conf/CTID.conf), or selecting plausible but nonexistent paths like /etc/openvz/config.

How to eliminate wrong answers

Option A is wrong because /etc/openvz/config is not a standard OpenVZ path; OpenVZ uses /etc/vz/. Option B is wrong because /var/lib/vz/config is not the per-container config location; /var/lib/vz is used by Proxmox for storage, not OpenVZ container configs. Option C is wrong because /etc/vz/container.conf is not a real file; the global config is vz.conf.

Option D is wrong because /etc/vz/vz.conf is the global OpenVZ configuration file, not the per-container one.

53
MCQhard

You are using systemd-nspawn. How do you create an image of a container to be used as a template?

A.tar -cvf
B.docker export
C.lxc-copy
D.machinectl export-tar
AnswerD

Using `machinectl export-tar` streams a running or stopped container's entire filesystem into a tar archive, which can later be imported as a template. This satisfies the stem's requirement to create a reusable image from a systemd-nspawn container, since nspawn containers are managed as machines via machinectl rather than Docker-style commits.

Why this answer

machinectl export-tar is the systemd-nspawn command that exports a running or stopped container's filesystem as a tar archive, which can then be imported as a template image. It is part of the systemd-machined toolset and is the native way to snapshot an nspawn container for reuse.

Exam trap

The trap is mixing up container tooling ecosystems — candidates pick docker export or lxc-copy because they recognize 'export' or 'copy', forgetting that systemd-nspawn uses machinectl exclusively.

How to eliminate wrong answers

Option A is wrong because tar -cvf only creates a generic archive of files — it does not understand nspawn container metadata or produce a machinectl-importable image. Option B is wrong because docker export is a Docker-specific command and has no relationship to systemd-nspawn containers. Option C is wrong because lxc-copy is an LXC/LXD tool, not part of the systemd-nspawn ecosystem.

54
MCQmedium

What is the purpose of the virtio-balloon driver in a guest?

A.To speed up network transfers
B.To provide disk caching
C.To enable memory ballooning
D.To enable 3D graphics
AnswerC

The virtio-balloon driver lets the host reclaim guest memory dynamically by inflating or deflating a balloon inside the guest; inflated pages are returned to the hypervisor, satisfying the need to adjust guest RAM at runtime without rebooting.

Why this answer

The virtio-balloon driver enables memory ballooning, a technique that allows the hypervisor to dynamically adjust the amount of memory allocated to a guest. The driver inflates or deflates a 'balloon' inside the guest, reclaiming or returning memory pages to the host. This helps optimize memory usage across VMs.

It does not speed up network transfers, provide disk caching, or enable 3D graphics.

Exam trap

The trap is confusing virtio-balloon with other virtio drivers; candidates might think it handles network or disk, but its sole purpose is memory management.

How to eliminate wrong answers

Option A is wrong because network acceleration is handled by virtio-net, not virtio-balloon. Option B is wrong because disk caching is managed by storage drivers like virtio-blk or virtio-scsi. Option D is wrong because 3D graphics is provided by GPU virtualization solutions like virtio-gpu or GPU passthrough.

55
MCQmedium

You need to ensure that a specific package is installed during the first boot of a cloud instance. Which cloud-init key should be added to the configuration?

A.packages
B.yum_install
C.software
D.install_packages
AnswerA

The packages key lists packages for cloud-init to install during first boot, invoking the system package manager before configuration modules run. Placing package names here guarantees installation on initial provisioning, satisfying the requirement without custom scripts or manual intervention.

Why this answer

The cloud-init configuration key `packages` is the standard directive for specifying a list of packages to install during instance initialization. It is processed by the `package-update-upgrade-install` module, which runs early in the boot sequence, ensuring the packages are present before other configuration steps. This key works across distributions by using the native package manager (apt, yum, dnf, etc.) to install the listed packages.

Exam trap

The trap here is confusing cloud-init's generic `packages` key with package-manager-specific commands like `yum_install` or intuitive but incorrect names like `install_packages`, leading candidates to choose a plausible-sounding but invalid option.

How to eliminate wrong answers

Option B is wrong because `yum_install` is not a valid cloud-init key; cloud-init uses `packages` and delegates to the appropriate package manager, so specifying a yum-specific key would be redundant and unsupported. Option C is wrong because `software` is not a cloud-init configuration key; it does not exist in any cloud-init module or schema. Option D is wrong because `install_packages` is not a recognized cloud-init key; the correct key is simply `packages`.

56
MCQeasy

Which command is used to display the configuration of a Packer build in a readable format?

A.packer inspect
B.packer view
C.packer show
D.packer list
AnswerA

`packer inspect` parses a template and prints its declared variables, builders, provisioners and post-processors as structured, human-readable output, without executing a build. This directly satisfies the stem's requirement to display build configuration readably, unlike `packer validate`, which only checks syntax, or `packer build`, which runs the build.

Why this answer

`packer inspect` is the dedicated Packer CLI subcommand that parses a template (HCL2 or legacy JSON) and prints its declared components — builders, provisioners, post-processors, and variables — in a human-readable summary without executing a build. It is the canonical way to review what a template will do before running `packer build`.

Exam trap

305-300 often tests whether candidates confuse Packer's real subcommands with plausible-sounding verbs borrowed from Terraform (`show`) or generic tooling (`view`, `list`), so memorising the actual Packer CLI surface is essential.

How to eliminate wrong answers

Option B is wrong because `packer view` is not a valid Packer subcommand; Packer's CLI exposes build, validate, inspect, fmt, init, console, fix, and version, but no 'view'. Option C is wrong because `packer show` does not exist in the Packer CLI — 'show' is a Terraform-style verb, not a Packer one. Option D is wrong because `packer list` is not a Packer subcommand either; listing installed plugins is handled by `packer plugins` in newer versions, not `packer list`.

57
MCQmedium

What is the primary function of a Docker Registry?

A.To store and distribute images
B.To build images
C.To run containers
D.To manage networking
AnswerA

A registry acts as the central repository that stores versioned container images and serves them to hosts on request, satisfying the need to persist and distribute artefacts. It is not a build tool or runtime; its function is storage plus retrieval over the network, enabling consistent image pulls across environments.

Why this answer

A Docker Registry is a stateless, server-side application that stores and distributes Docker images, acting as the central repository for pushing and pulling image layers. Tools like `docker push` and `docker pull` communicate with the registry's HTTP API (typically on port 5000 or 443) to upload or retrieve images. Docker Hub, Amazon ECR, and Harbor are all examples of registries.

Exam trap

The trap here is confusing the registry (stores/distributes images) with the Docker daemon or engine (builds and runs containers), since both are 'Docker' components and candidates often conflate their roles.

How to eliminate wrong answers

Option B is wrong because building images is the job of the Docker client/daemon via `docker build` and a Dockerfile, not the registry. Option C is wrong because running containers is performed by the Docker Engine (containerd/runc) on a host, not by the registry. Option D is wrong because networking (bridge, overlay, host drivers) is managed by the Docker daemon and CNI plugins, not by a registry.

58
Multi-Selecthard

You are configuring a rootless Podman container that must persist data across container restarts and also needs to communicate with other containers on the same host using a user-defined network. Which two actions must you perform to achieve these goals? (Choose two.)

Select 2 answers
A.Use a bind mount to a host directory and set the --userns=host flag to avoid permission issues.
B.Add the --ipc=host flag to allow containers to share memory and communicate.
C.Run the container with the --privileged flag to allow volume mounting and network access.
D.Create a user-defined network with podman network create and attach the container to it.
E.Create a named volume with podman volume create and mount it into the container.
AnswersD, E

User-defined networks in Podman allow containers to communicate with each other by name via an embedded DNS server. Creating a network with podman network create and then running the container with --network <name> enables inter-container communication. This is necessary because the default network may not provide name resolution or isolation. It fulfills the requirement for communication between containers on the same host.

Why this answer

To persist data across restarts in rootless Podman, a named volume created with podman volume create and mounted into the container is the correct approach. For containers to communicate by name on the same host, a user-defined network created with podman network create and attached to the container is required. The other options either introduce unnecessary privileges or do not address both requirements.

Exam trap

The trap here is thinking that running a container with --privileged or sharing the host IPC namespace is necessary for volume persistence and inter-container networking, when these features work without such broad privileges.

59
MCQhard

You are troubleshooting a Docker container that fails to start with the error message: 'Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting /proc: no such file or directory'. The host is running a recent Linux kernel and Docker is using the default runtime. What is the most likely cause?

A.The Docker daemon is not running with the correct seccomp profile.
B.The container's root filesystem is missing the /proc directory.
C.The host's /proc filesystem is not mounted or is inaccessible.
D.The container image is corrupted and needs to be pulled again.
AnswerB

During container initialization, runc attempts to mount a new proc filesystem at /proc inside the container's root filesystem. If the /proc directory does not exist in the container image, the mount call fails with 'no such file or directory'. This is a common issue when building minimal images from scratch without creating the standard directories. The solution is to ensure the image includes an empty /proc directory.

Why this answer

The error occurs because runc tries to mount a new proc filesystem at /proc inside the container, but the target directory does not exist in the container's root filesystem. Minimal images built from scratch often lack standard directories like /proc, /sys, and /dev. Creating these directories in the Dockerfile resolves the issue.

The other options do not match the specific error message about a missing file or directory during mount.

Exam trap

The trap here is focusing on the host or daemon configuration when the error actually points to a missing directory inside the container image itself.

60
MCQmedium

What is the purpose of 'virt-top'?

A.To manage network bridges
B.To show real-time statistics for VMs
C.To edit VM configuration files
D.To install new guest OSs
AnswerB

virt-top displays live resource statistics for running virtual machines, including CPU, memory, disk and network usage, refreshed continuously like top. It satisfies the requirement for real-time per-VM monitoring rather than static inventory or configuration reporting.

Why this answer

virt-top is a command-line utility that provides real-time performance statistics for virtual machines managed by libvirt. It is modeled after the Unix top command and displays metrics such as CPU usage, memory allocation, and I/O activity for each running guest. This allows administrators to monitor VM resource consumption dynamically, similar to how top monitors processes on a physical host.

Exam trap

The trap here is confusing virt-top with other virt-* tools like virt-manager, virt-install, or virsh, which serve different purposes such as management, installation, or configuration.

How to eliminate wrong answers

Option A is wrong because network bridge management is typically handled by tools like brctl, ip, or virsh net-* commands, not virt-top. Option C is wrong because editing VM configuration files is done via virsh edit or direct XML file modification, not through virt-top. Option D is wrong because installing new guest OSs is performed using virt-install or virt-manager, not virt-top.

61
MCQmedium

When defining a Vagrant network configuration for a libvirt provider, which mode allows the VM to receive an IP address directly from the physical network's DHCP server?

A.nat
B.public_network
C.forwarded_port
D.private_network
AnswerB

A public_network bridges the VM's virtual NIC onto the host's physical interface, so DHCP broadcasts reach the physical network's server and the VM obtains a routable address from that subnet. This satisfies the stem's requirement for an IP assigned directly by the external DHCP server rather than by libvirt's private NAT.

Why this answer

In Vagrant with the libvirt provider, the 'public_network' mode bridges the VM's network interface to a physical network, allowing it to obtain an IP address from the physical network's DHCP server. This makes the VM appear as a separate device on the LAN.

Exam trap

The trap is confusing public_network with private_network or nat; candidates might think private_network provides DHCP from the physical network, but it does not.

How to eliminate wrong answers

Option A is wrong because 'nat' uses network address translation, where the VM gets a private IP and shares the host's IP, not a DHCP address from the physical network. Option C is wrong because 'forwarded_port' is for port forwarding, not direct network bridging. Option D is wrong because 'private_network' creates a private network between host and VM, typically with a static IP or host-only DHCP, not the physical network's DHCP.

62
MCQmedium

A guest was created with a 20 GB qcow2 disk and has been running for months. The administrator wants to give the guest additional space without recreating the disk, and the guest uses a single ext4 partition with no LVM. Which approach is valid with virsh and standard tools?

A.Edit the domain XML to change the disk's '<target dev>' from vda to vdb and restart the guest.
B.Use 'virsh attach-disk' to add a second qcow2 image and merge the two disks with mdadm inside the guest.
C.Run 'qemu-img resize disk.qcow2 +10G' and then immediately run 'resize2fs' on the host against the qcow2 file.
D.Run 'virsh vol-resize --pool default --vol disk.qcow2 30G' to enlarge the backing file, then grow the partition and filesystem inside the guest.
AnswerD

virsh vol-resize enlarges the qcow2 volume in the pool, after which the guest sees a larger block device and the partition and filesystem can be grown from inside. This keeps the existing disk and data intact, which is exactly what the scenario requires. It is the supported way to add capacity to a libvirt-managed qcow2 volume.

Why this answer

Enlarging a libvirt-managed qcow2 volume is done with virsh vol-resize, after which the extra space appears as a larger block device the guest can partition and grow. Device renaming, attaching an unrelated disk, or running resize2fs against the qcow2 file on the host do not extend the existing disk and filesystem in the required way.

Exam trap

The trap here is thinking the filesystem can be grown from the host by pointing resize2fs at the qcow2 file instead of growing the volume first and then the filesystem inside the guest.

63
MCQeasy

Which file in a Vagrant project directory is processed by default to define the virtual environment configuration?

A.settings.json
B.Vagrantfile
C.provision.sh
D.config.yml
AnswerB

Vagrant reads the Vagrantfile in the project root automatically on every vagrant command, using Ruby syntax to declare the box, provider, networking and provisioning. No other file is parsed by default, so this is the configuration entry point the stem asks for.

Why this answer

Vagrant automatically reads a file named 'Vagrantfile' in the project directory to determine the configuration of the virtual environment, including the box to use, network settings, provisioning scripts, and provider configuration. This file is written in Ruby DSL syntax and is the single source of truth for a Vagrant project. Without a Vagrantfile, the 'vagrant up' command cannot determine what VM to create.

Exam trap

The trap is confusing Vagrant's configuration file with other common config formats like JSON or YAML — candidates may pick settings.json or config.yml because those are familiar, but Vagrant specifically uses the Ruby-DSL Vagrantfile.

How to eliminate wrong answers

Option A is wrong because settings.json is not a Vagrant configuration file — it is commonly used by VS Code and other tools, but Vagrant does not process it. Option C is wrong because provision.sh is a shell script that may be referenced by the Vagrantfile for provisioning, but it is not the default configuration file itself. Option D is wrong because config.yml is a YAML configuration file used by tools like Ansible, Docker Compose, or CI systems, but Vagrant does not read it by default.

64
MCQeasy

You are configuring a virtual network in libvirt that allows VMs to communicate with each other and the host, but prevents them from accessing the external network. Which mode should you select for this network?

A.Bridge
B.Isolated
C.Direct
D.NAT
AnswerB

An isolated libvirt network provides connectivity between guest VMs and the host through a virtual bridge, but applies no NAT or forwarding to external networks. This satisfies the stem's constraint of internal communication while blocking outbound access, unlike routed or NAT modes.

Why this answer

An isolated libvirt network allows VMs to communicate with each other and with the host but provides no route to the external network, which is exactly the requirement. It uses a virtual bridge with no forwarding to a physical interface or NAT. The other modes all provide some form of external connectivity.

Exam trap

305-300 often tests the difference between libvirt network modes — the trap is confusing 'isolated' (no external access) with 'NAT' (outbound-only external access) or 'bridge' (full external access).

How to eliminate wrong answers

Option A is wrong because a bridge network connects VMs directly to a physical host interface, giving them full external network access (they appear as peers on the LAN). Option C is wrong because direct (macvtap) mode attaches the VM's NIC directly to a physical interface, bypassing the host's virtual network and providing external connectivity. Option D is wrong because NAT mode gives VMs outbound access to the external network via the host's IP (masquerading), which violates the 'no external access' requirement.

65
MCQmedium

You are using QEMU to emulate an ARM architecture on an x86_64 host. You need to ensure the guest has access to the host's filesystem directly without configuring network shares. Which option is the correct way to pass a directory through to the guest?

A.-fsdev share,path=/data,id=host_data
B.-netdev user,hostfwd=dir:/data
C.-virtfs local,path=/data,mount_tag=host_data,security_model=passthrough
D.-drive file=/data,format=raw,if=virtio
AnswerC

This is the correct command-line argument for virtio-9p filesystem passthrough.

Why this answer

The -virtfs option with local,path=/data,mount_tag=host_data,security_model=passthrough configures a virtio-9p filesystem share that allows the guest to mount the host directory directly. This is the correct QEMU mechanism for passing a host directory to the guest without network shares.

Exam trap

305-300 often tests the confusion between network-based file sharing (NFS/SMB) and QEMU's built-in virtfs/9p mechanism, so candidates must recognize the correct -virtfs syntax and avoid invalid -fsdev or -netdev options.

How to eliminate wrong answers

Option A is wrong because -fsdev share is not a valid fsdev type; valid types include local, handle, proxy, and synth, and the syntax is incorrect. Option B is wrong because -netdev user,hostfwd=dir:/data is not a valid hostfwd syntax (hostfwd forwards TCP/UDP ports, not directories) and does not provide filesystem access. Option D is wrong because -drive file=/data,format=raw,if=virtio treats /data as a raw disk image, not a directory share, and would fail or expose the directory as a block device incorrectly.

66
Multi-Selectmedium

You are configuring an LXC container and need to limit its CPU and memory usage. Which TWO of the following configuration options in the container's config file are valid for this purpose? (Choose two.)

Select 2 answers
A.lxc.cgroup2.cpu.max = 50000 100000
B.lxc.cgroup2.cpuset.cpus = 0-1
C.lxc.cgroup2.memory.max = 512M
D.lxc.memory.limit = 1G
E.lxc.cpu.limit = 2
AnswersA, C

This option sets a CPU bandwidth limit using cgroup v2. The values represent quota and period in microseconds, so 50000 100000 means the container can use 50% of one CPU core. It is a valid and current way to restrict CPU usage in LXC when using cgroup v2, which is the default on modern systems.

Why this answer

LXC uses cgroup v2 settings to enforce resource limits. The options lxc.cgroup2.cpu.max and lxc.cgroup2.memory.max are valid and directly limit CPU bandwidth and memory usage, respectively. The other options either use non-existent configuration keys or, in the case of cpuset.cpus, control CPU affinity rather than usage limits.

Thus, only the cgroup2-based limits achieve the goal.

Exam trap

The trap here is assuming that any configuration key containing 'cpu' or 'memory' will work, when in fact LXC requires specific cgroup2-prefixed keys for resource limiting.

67
MCQmedium

When using 'docker-compose', which file format is used to define the services?

A.YAML
B.INI
C.XML
D.JSON
AnswerA

Compose's declarative service definitions rely on YAML's indentation-based mapping, which expresses nested services, images and volumes without the verbosity of JSON or XML. The stem asks which format defines services, and Compose reads docker-compose.yml as YAML by default.

Why this answer

Docker Compose uses YAML (Yet Another Markup Language / YAML Ain't Markup Language) files, conventionally named docker-compose.yml or compose.yaml, to define services, networks, volumes, and build contexts. YAML's indentation-based structure maps cleanly to Compose's nested service definitions. INI, XML, and JSON are not supported by Compose for its primary configuration file.

Exam trap

The trap is that YAML is technically a JSON superset, so candidates who know JSON is valid YAML may pick JSON — but the exam asks for Compose's defined file format, which is YAML.

How to eliminate wrong answers

Option B (INI) is wrong because INI's flat section/key format cannot express the nested lists and maps Compose requires (e.g., multiple ports, environment arrays, depends_on). Option C (XML) is wrong because Compose has never used XML; XML's verbosity and lack of native list semantics make it unsuitable for the Compose schema. Option D (JSON) is wrong because although YAML is a superset of JSON and some tools accept JSON, Docker Compose's documented and canonical format is YAML — JSON is not the file format used.

68
MCQmedium

When using Docker volumes, which type of mount should you use if you want the data to persist on the host filesystem at a specific, user-defined path?

A.Named volume
B.Anonymous volume
C.Bind mount
D.Tmpfs mount
AnswerC

A bind mount maps a specific host directory path, chosen by the user, into the container, so data written there persists on the host filesystem at that exact location. Named volumes persist too, but Docker manages their path rather than the user defining it.

Why this answer

A bind mount maps a specific host directory or file path directly into the container, giving the user full control over the exact host location where data persists. This is the correct choice when the requirement is a user-defined, specific host path, because named and anonymous volumes are managed by Docker in its own storage area (/var/lib/docker/volumes) and do not let you choose an arbitrary host path. Bind mounts are the only Docker volume type that satisfies the 'specific, user-defined path' requirement.

Exam trap

The trap is assuming 'persistent' automatically means 'named volume' — candidates overlook that the question specifies a user-defined host path, which only bind mounts provide, since named volumes use Docker-managed paths.

How to eliminate wrong answers

Option A is wrong because named volumes are stored in Docker's managed volume directory and referenced by name; while persistent, the host path is chosen by Docker, not the user. Option B is wrong because anonymous volumes are also Docker-managed and get random hashed names, offering no control over host location and being harder to reference. Option D is wrong because tmpfs mounts store data in memory only and are lost on container stop, so they cannot provide host filesystem persistence at all.

69
MCQmedium

You are configuring a QEMU-KVM guest to use VirtIO-net. Which parameter in the QEMU command line correctly enables the virtio-net-pci device with a tap interface named tap0?

A.-device virtio-net,backend=tap0
B.-netdev tap,id=net0,ifname=tap0 -device virtio-net-pci,netdev=net0
C.-netdev tap,id=tap0 -device virtio-net-pci,id=tap0
D.-net tap,ifname=tap0,model=virtio
AnswerB

The `-netdev tap` backend binds the host tap0 interface, while `-device virtio-net-pci,netdev=net0` attaches the paravirtualised NIC and links it via the matching id. This two-part split satisfies the stem's requirement to enable virtio-net-pci with a tap interface named tap0.

Why this answer

The correct QEMU command line uses '-netdev tap,id=net0,ifname=tap0' to define a tap network backend with a unique ID, and then '-device virtio-net-pci,netdev=net0' to attach a virtio-net-pci device to that backend. This two-part syntax is required in modern QEMU to separate the network backend from the device frontend.

Exam trap

The trap is using outdated or incorrect syntax that conflates the netdev backend with the device frontend, such as using 'backend=' or mismatched IDs.

How to eliminate wrong answers

Option A is wrong because '-device virtio-net,backend=tap0' is not valid syntax; the virtio-net device requires a 'netdev' parameter referencing a netdev ID, not a 'backend' parameter. Option C is wrong because it uses 'id=tap0' for the netdev and then 'id=tap0' for the device, but the device must reference the netdev via 'netdev=' not 'id='. Option D is wrong because '-net tap,ifname=tap0,model=virtio' is the legacy syntax that combines backend and device, but it does not use the modern '-netdev' and '-device' separation, and may not work with all QEMU versions.

70
MCQeasy

What is the purpose of the 'virsh' tool?

A.To monitor host CPU temperature
B.To compile QEMU
C.To write disk images to USB
D.To manage virtual domains
AnswerD

virsh is the command-line interface to libvirt, managing virtual domains — starting, stopping, listing, snapshotting and reconfiguring them. This satisfies the requirement to manage virtual domains, offering scripting and remote control over the libvirt API.

Why this answer

The 'virsh' tool is a command-line interface for managing libvirt-based virtual machines (domains). It allows administrators to create, start, stop, migrate, and configure virtual domains, as well as manage networks, storage pools, and other resources. It is not used for monitoring CPU temperature, compiling QEMU, or writing disk images to USB.

Exam trap

The trap is assuming virsh is a low-level tool like 'dd' or a monitoring tool; candidates might overlook its primary role as a management interface for libvirt domains.

How to eliminate wrong answers

Option A is wrong because monitoring host CPU temperature is typically done with tools like 'sensors' or IPMI, not virsh. Option B is wrong because compiling QEMU is a build process unrelated to virsh; virsh manages running domains. Option C is wrong because writing disk images to USB is done with tools like 'dd' or 'usbimager', not virsh.

71
Multi-Selecthard

Which THREE configuration items can be managed via cloud-init 'write_files' module?

Select 3 answers
A.Target path (path)
B.Service status
C.Permissions (permissions)
D.Kernel parameters
E.Content (content)
AnswersA, C, E

The write_files module's path key specifies the absolute filesystem location where each file is created, which is mandatory for every entry. This satisfies the stem's requirement by defining where the managed file content is written on the instance.

Why this answer

The cloud-init write_files module is designed to create arbitrary files on an instance during boot, and each file entry is defined by three key attributes: the destination path (option A, 'path'), the file's permissions (option C, 'permissions'), and the file's content (option E, 'content'). The 'path' specifies where the file is written on the filesystem, the 'permissions' sets the octal mode (e.g., '0644') applied to the file, and 'content' supplies the actual data written to that file. Options B and D are incorrect because service status is managed by cloud-init's 'runcmd' or systemd/service modules, and kernel parameters are handled by the 'sysctl' module or bootloader configuration, not by write_files.

Exam trap

The trap is assuming any boot-time setting (services, sysctl, kernel params) belongs to `write_files` — candidates must recall that `write_files` only handles file path, content, and permissions/ownership.

72
MCQhard

In a Vagrantfile, which method is used to pass environment variables into the guest virtual machine during the provisioning phase?

A.config.env.set
B.config.vm.env
C.vagrant.env.set
D.config.vm.provision "shell", env: { "VAR" => "value" }
AnswerD

The `env` hash on a shell provisioner injects the specified variables directly into the guest's provisioning environment, satisfying the requirement to pass values during provisioning rather than at boot. Vagrant exports these into the script's process, so the guest sees them without editing the box or using a separate configuration management tool.

Why this answer

In a Vagrantfile, environment variables are passed to a shell provisioner using the `env` option on the provisioner block: `config.vm.provision "shell", env: { "VAR" => "value" }`. This injects the variables into the environment of the provisioning script running inside the guest. It is the documented, supported way to make host-side values available to guest provisioning.

Exam trap

305-300 often tests the difference between valid Vagrantfile DSL methods and plausible-sounding but nonexistent ones like `config.env.set` or `config.vm.env`, so candidates who guess at syntax rather than recalling the documented `env:` option on the provisioner block get it wrong.

How to eliminate wrong answers

Option A is wrong because `config.env.set` is not a valid Vagrantfile method; Vagrant does not expose a global `config.env` namespace for this purpose. Option B is wrong because `config.vm.env` is not a Vagrant configuration method — there is no such setting on the VM config object. Option C is wrong because `vagrant.env.set` is not a Vagrant DSL method; `vagrant` is a CLI command, not a configuration object in the Vagrantfile.

73
MCQmedium

A KVM host runs libvirt with a default storage pool at /var/lib/libvirt/images. You need to create a new qcow2-backed volume named 'app-disk.qcow2' with a virtual size of 40 GB inside the pool named 'default'. Which single virsh command accomplishes this?

A.virsh vol-clone app-disk.qcow2 default --capacity 40G --format qcow2
B.virsh pool-create-as default app-disk.qcow2 40G --format qcow2
C.virsh vol-create default --name app-disk.qcow2 --capacity 40G --format qcow2
D.virsh vol-create-as default app-disk.qcow2 40G --format qcow2
AnswerD

virsh vol-create-as creates a new volume inside an existing storage pool, taking the pool name, volume name, and capacity as positional arguments. The --format qcow2 flag ensures the volume is created as a qcow2 image rather than a raw sparse file. This is the correct, direct way to allocate a 40 GB qcow2 volume in the 'default' pool.

Why this answer

The virsh vol-create-as subcommand is purpose-built for creating a volume inside an existing storage pool with a specified name, capacity, and format. Supplying the pool name, volume name, size, and --format qcow2 produces a qcow2-backed image of the requested virtual size. The other commands either target pools instead of volumes, expect XML input, or attempt to clone a nonexistent source.

Exam trap

The trap here is confusing pool-level commands (pool-create-as) with volume-level commands (vol-create-as), since both use similar 'create-as' syntax.

74
MCQhard

You are troubleshooting a container networking issue. You notice that traffic from the container is not being SNATed. What should you check in the iptables rules?

A.nat table, PREROUTING chain
B.nat table, POSTROUTING chain
C.filter table, FORWARD chain
D.mangle table, OUTPUT chain
AnswerB

Source NAT for outbound container traffic is performed in the nat table's POSTROUTING chain, where MASQUERADE or SNAT rules rewrite the source address after routing. Inspecting this chain reveals whether the SNAT rule is present, correctly matched, or bypassed by an earlier rule.

Why this answer

SNAT (Source NAT) is performed in the nat table's POSTROUTING chain, which is traversed after the routing decision and just before the packet leaves the interface. If container traffic is not being SNATed, the POSTROUTING chain in the nat table is where the MASQUERADE or SNAT rule should exist. Checking this chain will reveal whether the rule is missing, misordered, or not matching the container's source subnet.

Exam trap

The trap is confusing DNAT (PREROUTING) with SNAT (POSTROUTING); candidates often pick PREROUTING because it is the first nat chain they think of.

How to eliminate wrong answers

Option A is wrong because the nat table's PREROUTING chain handles DNAT (destination NAT), such as port forwarding to containers, not SNAT. Option C is wrong because the filter table's FORWARD chain controls whether packets are allowed to be routed between interfaces, not whether their source address is translated. Option D is wrong because the mangle table's OUTPUT chain is used for packet header alteration (e.g., TOS, TTL) for locally generated packets, not for SNAT of forwarded container traffic.

75
MCQeasy

Which command is used to remove an unused Docker image?

A.docker rm
B.docker image delete
C.docker prune image
D.docker rmi
AnswerD

docker rmi removes images from the local image store, deleting tagged references and, with -f, dependent layers. It is the dedicated image-removal command, directly satisfying the stem's requirement to delete an unused image rather than containers or volumes.

Why this answer

The docker rmi command removes one or more Docker images from the local image store. 'rmi' stands for 'remove image' and accepts image names or IDs. This is the direct counterpart to docker rm, which removes containers.

Exam trap

The trap is confusing docker rm (containers) with docker rmi (images), and inventing plausible but non-existent subcommands like docker image delete or docker prune image.

How to eliminate wrong answers

Option A (docker rm) is wrong because it removes containers, not images. Option B (docker image delete) is wrong because 'delete' is not a valid Docker CLI subcommand; the correct form is docker image rm or docker rmi. Option C (docker prune image) is wrong because the correct syntax is docker image prune (or docker system prune), which removes dangling images, not a specific unused image by name.

Page 1 of 3

Page 2

All pages