Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free LPI LPIC-3: Virtualization and Containerization - Exam 305, (version 3.0) 305-300 Exam Questions

Last updated: · 12 practice questions with answers and explanations

Page: 1 / 13 Total 121 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Full Virtualization

Skill tested: Selects an appropriate hypervisor architecture for hardware-assisted virtual machines.

A hosting team must run unmodified Linux and Windows guests with hardware-assisted virtualization on x86 servers. The team needs mature device emulation and wants to manage the environment through libvirt. Performance matters, but the operating system must retain direct control of the physical hardware rather than run as a guest beneath a separate hypervisor. Which architecture best meets these requirements?

Correct Answer: B. Run QEMU with KVM acceleration on the Linux host, using libvirt to manage the domains.
Explanation:

QEMU with KVM uses the Linux kernel's hardware virtualization facilities to execute guest code efficiently, while QEMU supplies virtual devices and libvirt can manage the virtual machines. This keeps Linux as the host operating system rather than placing it in a Xen guest domain. Xen Dom0 is a privileged guest domain, not a design in which Linux remains the hardware-owning host in the stated sense. QEMU software emulation can run guests without KVM but does not meet the performance preference, and libvirt does not itself provide hardware virtualization.

Question 2

New Multiple answers

Topic: Full Virtualization

Skill tested: Distinguishes Xen paravirtualized guests from hardware-assisted fully virtualized guests.

An enterprise has legacy x86 servers without Intel VT-x or AMD-V and must consolidate several Linux workloads under Xen. The Linux kernels can be rebuilt, and the workloads do not require unmodified guest operating systems. The team wants to avoid emulating a complete processor for these guests and accepts that guest-kernel support is required. Which two statements accurately describe an appropriate Xen design? Select TWO.

Correct Answer: D. Use paravirtualized guests that cooperate with the hypervisor through guest-kernel interfaces.; E. Use PV guests where supported; they can avoid the need for hardware-assisted full virtualization for guest CPU execution.
Explanation:

Xen paravirtualization relies on a guest kernel that is aware of the hypervisor and uses hypervisor-specific interfaces, making it suitable when hardware-assisted full virtualization is unavailable and guest kernels can be modified. HVM guests provide hardware-assisted full virtualization for unmodified operating systems and do not remove the need for the relevant CPU support in this scenario. Dom0 is the privileged management domain, not a substitute kernel for every guest. QEMU TCG is software translation, not hardware-assisted virtualization, and it does not convert Xen HVM into a viable hardware-accelerated design.

Question 3

New Single answer

Topic: Full Virtualization

Skill tested: Chooses a libvirt hypervisor connection URI that targets the local system QEMU driver.

A systems engineer is logged in on a Linux virtualization host and needs to inspect locally managed QEMU/KVM domains through virsh. The host also has remote virtualization servers, and the engineer's shell environment sometimes supplies a default libvirt connection URI. To prevent commands from accidentally operating on a remote system or a different driver, the engineer must specify the target explicitly. Which connection URI should be used for the local system instance?

Correct Answer: D. qemu:///system
Explanation:

The URI qemu:///system selects the local QEMU driver's system connection, which is the appropriate scope for host-managed virtual machines and avoids dependence on a possibly inherited default URI. qemu:///session selects a per-user session connection, which has a different privilege and resource scope. xen:///system targets the Xen driver, not QEMU. qemu+ssh is for a remote connection over SSH and does not identify the local system instance.

Question 4

New Multiple answers

Topic: Libvirt Virtual Machine Management

Skill tested: Uses libvirt lifecycle commands and persistent domain definitions safely.

A service team deploys a VM from an XML domain definition. They need the VM to start immediately, remain defined after shutdown, and automatically start on subsequent host boots. The team wants to use virsh rather than a graphical tool. No existing domain with the same name is present. Which two actions satisfy the requirements? Select TWO.

Correct Answer: B. Run `virsh define domain.xml`, then run `virsh start vmname`.; C. Run `virsh define domain.xml`, then `virsh autostart vmname`.
Explanation:

`virsh define` registers the XML as a persistent domain definition. `virsh start` starts that defined domain immediately, while `virsh autostart` configures it to start automatically when the relevant libvirt service starts. Therefore B and D each provide the requested persistent definition and immediate start or autostart behavior. `virsh create` starts a transient domain that is not retained as a persistent definition. Autostart does not create an undefined domain, and `virsh start` expects a domain identifier rather than an XML path.

Question 5

New Single answer

Topic: Libvirt Virtual Machine Management

Skill tested: Performs a safe live migration using libvirt and shared VM storage.

Two KVM hosts are managed by the same libvirt environment and have compatible CPUs and networking. A critical VM uses a disk image on storage mounted at the same path on both hosts. The operations team must move the running VM to the second host without copying its disk and with minimal service interruption. They have verified that the destination has sufficient memory and that the VM's network is available there. Which approach is most appropriate?

Correct Answer: A. Use `virsh migrate --live` to the destination and retain the shared disk, with compatible host and network configuration.
Explanation:

Live migration transfers a running domain's execution state to the destination; shared storage avoids the need to transfer the disk image, provided both hosts can access it consistently and the destination's CPU, memory, networking, and libvirt configuration are suitable. Shutting down and copying XML is a cold relocation, not live migration. Saving and restoring is not a concurrent live move and must not leave two active copies. Offline migration is unnecessary and does not meet the minimal-interruption requirement; shared storage is commonly used precisely to avoid disk-copy migration.

Question 6

New Multiple answers

Topic: Libvirt Virtual Machine Management

Skill tested: Applies persistent CPU and memory resource limits to libvirt domains.

A virtualization administrator must cap a tenant VM at four virtual CPUs and 8 GiB of memory. The VM is currently running, but the limits must still apply after a guest shutdown and later restart. The administrator also needs the running VM to adopt the change without scheduling downtime, and the guest operating system supports the relevant hotplug operations. Which two management practices are appropriate? Select TWO.

Correct Answer: A. Use `virsh setvcpus` and `virsh setmem` with live and config scopes as supported by the domain and hypervisor.; C. Set the persistent domain's maximum vCPU count and memory allocation in its configuration, then apply changes to the live domain using supported live-update mechanisms.
Explanation:

Resource policy must be represented in the persistent domain configuration so it survives shutdown, while the running domain requires supported live updates if the change must take effect without downtime. `virsh setvcpus` and `virsh setmem` provide live and configuration scopes where supported; their exact use must respect hotplug limits and domain capabilities. Editing only the guest does not impose host-side allocation limits. Editing XML on disk does not automatically alter a running domain, and live-only changes are not inherently copied back into the persistent definition.

Question 7

New Single answer

Topic: Virtual Machine Disk Image Management

Skill tested: Selects a safe backing-file strategy for space-efficient VM disk provisioning.

A virtualization team provisions many short-lived test VMs from an unchanged, golden qcow2 image. Each VM needs independent writes, rapid creation, and low initial storage consumption. The team can keep the base image available for the entire lifetime of the test VMs, and it accepts that a base-image change must be handled through a controlled process. Which disk-image design best matches these requirements?

Correct Answer: C. Create qcow2 overlays that use the golden image as a backing file, keeping the backing image immutable.
Explanation:

A qcow2 overlay stores changes separately while reads can fall through to the backing image, enabling quick provisioning and reducing initial space use. The backing image must remain available and should not be modified in place, because overlays depend on its contents and metadata. Full copies consume more storage and take longer to create. Sharing one writable image between independent guests risks corruption and does not isolate writes. Blank images require repeated population and do not provide the requested clone efficiency.

Question 8

New Multiple answers

Topic: Virtual Machine Disk Image Management

Skill tested: Checks qcow2 backing chains and image integrity before changing disk files.

An administrator is preparing to archive a VM whose active qcow2 image is an overlay backed by another qcow2 image. The VM must remain recoverable, and the administrator wants to avoid a broken backing chain or an unsafe modification to an image still in use. Which two actions are appropriate before archiving? Select TWO.

Correct Answer: B. Inspect the image metadata and backing-file chain with `qemu-img info` before deciding what must be archived.; E. Arrange a consistent shutdown or supported snapshot/backup procedure, then preserve all required files in the backing chain.
Explanation:

`qemu-img info` reveals format and backing-file relationships, allowing the administrator to identify dependencies. An overlay is not necessarily self-contained, so the backing image or a properly flattened image is needed for recovery. A consistent shutdown or a backup procedure designed for a running VM avoids capturing disk state at an unsafe point; the complete required chain must be preserved. Copying only the overlay or copying active files without consistency guarantees can produce an unusable archive. `qemu-img check` examines image-level structures, not mounted guest filesystems.

Question 9

New Single answer

Topic: Virtual Machine Disk Image Management

Skill tested: Uses qcow2 conversion and flattening to remove a backing-file dependency.

A VM's qcow2 overlay depends on a base image stored on temporary infrastructure that will soon be decommissioned. The VM must be moved to a host that will not have access to that base image, and the destination should receive one self-contained qcow2 image. The VM can be stopped for the conversion, and sufficient destination storage is available. Which action best satisfies the requirement?

Correct Answer: B. Use `qemu-img convert` on the overlay to produce a new qcow2 image that incorporates the visible disk contents, then validate the result.
Explanation:

Converting the active overlay to a new standalone qcow2 image reads the logical disk contents, including data inherited from the backing file, and writes them into the destination image. This removes the runtime dependency on the temporary base, assuming the source chain is accessible during conversion and the VM is quiesced as specified. Merely copying or relinking the overlay leaves the dependency intact, and renaming the base does not flatten the overlay. The resulting image should be inspected and tested before the original chain is retired.

Question 10

New Multiple answers

Topic: Container Virtualization

Skill tested: Differentiates Linux namespaces from cgroup resource controls.

A team runs several Linux containers on one host. A production service sees CPU contention and can inspect host processes that belong to other containers. The team wants each container to have isolated process and mount views and wants a hard CPU resource control. It does not want to introduce a separate guest kernel. Which two kernel mechanisms directly address these requirements? Select TWO.

Correct Answer: A. Use cgroups to account for and limit CPU resources assigned to container processes.; E. Use PID and mount namespaces to provide isolated process and mount views.
Explanation:

Namespaces isolate views of kernel resources: PID namespaces provide distinct process ID spaces and mount namespaces isolate mount tables. Control groups organize processes and account for or limit resources such as CPU; they do not create separate kernels. A network namespace isolates network resources rather than process visibility. User namespaces map user and group IDs and can help limit privilege, but they do not implement CPU quotas. Both isolation and resource control are needed to address the two symptoms.

Question 11

New Single answer

Topic: Container Virtualization

Skill tested: Selects container isolation controls to reduce host privilege and resource exposure.

A company runs an untrusted build workload in a Linux system container. The workload needs its own process and network views, must not gain host root privileges, and must have a bounded CPU allocation. The host kernel is shared, so the security team wants layered controls rather than treating the container boundary as equivalent to a VM boundary. Which configuration is the best starting point?

Correct Answer: C. Use user, PID, and network namespaces; drop unnecessary capabilities and apply cgroup CPU limits.
Explanation:

User namespaces can map container root to an unprivileged host identity, while PID and network namespaces isolate process and network views. Dropping unneeded capabilities reduces the operations available to the workload, and cgroups enforce the CPU bound. These are layered safeguards appropriate to a shared-kernel environment, though they do not make containers identical to separate-kernel virtual machines. Running as host root with only a network namespace leaves excessive privilege, and a writable host root mount creates serious exposure.

Question 12

New Multiple answers

Topic: Container Virtualization

Skill tested: Applies least privilege and filesystem isolation to Linux container workloads.

An operations group discovers that a containerized application can modify host configuration files and perform privileged kernel-related operations. The application needs only to read its own configuration, write to a designated data directory, and communicate over the network. The organization requires changes that reduce host risk without replacing the container runtime or moving the workload into a VM. Which two measures are most appropriate? Select TWO.

Correct Answer: B. Run the container in a user namespace so container root does not map directly to host root.; D. Drop capabilities the application does not need and grant only the minimum required privileges.
Explanation:

A user namespace can map container identities to less-privileged host identities, reducing the impact of container-root processes. Dropping unnecessary capabilities limits privileged kernel operations, following least privilege. A writable bind mount of the host root expands rather than confines access. CPU cgroups control resource consumption, not filesystem authorization or kernel privileges. Network namespaces affect network isolation and do not prevent filesystem writes. Together, user mapping and capability reduction directly address both classes of exposure.