Courseiva

CCNA Full Virtualization Questions

75 of 90 questions · Page 1/2 · Full Virtualization topic · Answers revealed

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 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.

4
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.

5
Multi-Selectmedium

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

Select 2 answers
B.VNC
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).

6
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.

7
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.

8
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.

9
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.

10
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.

11
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.

12
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).

13
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.

14
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.

15
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.

16
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.

17
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.

18
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>.

19
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.

20
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.

21
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.

22
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.

23
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.

24
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.

25
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.

26
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.

27
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.

28
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.

29
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.

30
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.

31
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.

32
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.

33
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.

34
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.

35
Multi-Selecthard

Which THREE of the following attributes can be defined within the <memoryBacking> XML block?

Select 3 answers
A.<hugepages/>
B.<source type='file'/>
C.<swap-limit/>
D.<balloon-rate/>
E.<locked/>
AnswersA, B, E

The `<hugepages/>` element sits inside `<memoryBacking>` and enables backing the guest's memory with pre-allocated huge pages, reducing TLB pressure. This satisfies the stem's requirement that the attribute be definable within that block, since libvirt documents hugepages as a valid memoryBacking child alongside locked and nosharepages.

Why this answer

In libvirt domain XML, the <memoryBacking> element controls how a guest's memory is backed, and it accepts the <hugepages/>, <locked/>, and <source type='file'/> sub-elements. Option A, <hugepages/>, is correct because it instructs libvirt to back the guest RAM with huge pages (e.g., via the hugepages mount) instead of regular 4 KiB pages. Option B, <source type='file'/>, is correct because it specifies a file-backed memory source (used with shared memory such as a memory-backend-file), which is valid inside <memoryBacking>.

Option E, <locked/>, is correct because it sets the VFIO/MLOCK-style locking of guest memory in RAM, preventing it from being swapped out. Options C (<swap-limit/>) and D (<balloon-rate/>) are not valid <memoryBacking> children; swap limits and ballooning rates are configured through other mechanisms (e.g., memtune or the <memballoon> device), so they do not belong here.

Exam trap

The trap is that candidates pick plausible-sounding tuning knobs like swap-limit or balloon-rate because they sound like memory controls, when memoryBacking only accepts hugepages, source, locked, and access/discard/allocation sub-elements.

36
MCQhard

You are troubleshooting a libvirt migration that fails with 'Operation not supported: Migration requires a storage pool'. You need to perform a block migration where the storage is copied to the destination host. Which command-line flag enables this functionality?

A.--copy-storage-all
B.--live-disk
C.--migrate-storage
D.--block-migrate
AnswerA

--copy-storage-all copies every guest disk to the destination as part of the migration, removing the shared-storage requirement that triggered the error. This enables true block migration when the destination has no access to the source's storage pool.

Why this answer

The --copy-storage-all flag tells libvirt to copy all disk images from the source host to the destination during migration, enabling block migration when shared storage is not available. This directly addresses the 'Migration requires a storage pool' error by supplying the missing storage transfer behavior.

Exam trap

The trap is inventing plausible-sounding flags like --block-migrate or --migrate-storage — candidates must recall the actual libvirt flags --copy-storage-all and --copy-storage-inc.

How to eliminate wrong answers

Option B is wrong because --live-disk is not a valid virsh migrate flag — it is a fabricated option that does not exist in libvirt's CLI. Option C is wrong because --migrate-storage is not a recognized flag; the actual storage-related flags are --copy-storage-all, --copy-storage-inc, and --migrate-disks. Option D is wrong because --block-migrate is not a libvirt flag — block migration is achieved via --copy-storage-all (full copy) or --copy-storage-inc (incremental copy).

37
MCQmedium

Which QEMU-KVM feature allows you to save the state of a VM to a file and resume it later?

A.virsh save
B.virsh snapshot
C.virsh checkpoint
D.virsh suspend
AnswerA

virsh save writes the VM's complete memory and device state to a file and stops it, allowing later restoration via virsh restore. This matches the stem's requirement to save state to a file and resume it later.

Why this answer

The 'virsh save' command writes the complete state of a running domain (VM) — including CPU registers, memory contents, and device state — to a file, allowing it to be restored later with 'virsh restore'. This is a full VM state save, not just a disk snapshot. It is the libvirt equivalent of hibernation for a virtual machine.

Exam trap

The trap is conflating 'virsh save' with 'virsh snapshot' or 'virsh suspend' — all three touch VM state, but only 'save' writes state to a file that survives host reboot and can be restored later.

How to eliminate wrong answers

Option B is wrong because 'virsh snapshot' creates a point-in-time snapshot of a domain's disk and/or memory but is managed as a snapshot object with its own lifecycle (snapshot-create, snapshot-list, snapshot-revert) — it is not the save-to-file-and-resume mechanism the question describes. Option C is wrong because 'virsh checkpoint' is not a standard virsh command for saving VM state; checkpoints in libvirt relate to incremental backup metadata, not state save/restore. Option D is wrong because 'virsh suspend' merely pauses a running VM in memory without writing its state to a file — the VM stays resident and cannot survive a host reboot.

38
MCQeasy

A junior administrator needs to start the libvirt-managed guest 'db01' and confirm that it is running. Which pair of commands accomplishes this?

A.virsh define db01 and virsh dominfo db01
B.virsh start db01 and virsh list --all
C.virsh create db01 and virsh list
D.virsh start db01 and virsh list
AnswerD

virsh start boots a defined, persistent domain, and virsh list displays only domains that are currently running. Together they start db01 and confirm its running state in one step. This is the standard operational workflow for libvirt-managed guests and matches the administrator's goal exactly.

Why this answer

Starting a persistent libvirt domain is done with virsh start, and the running state is confirmed with virsh list, which shows only active domains. The alternatives either use commands that expect XML files, list inactive domains as well, or never actually boot the guest, so they do not fulfill both parts of the task.

Exam trap

The trap here is reaching for virsh create, which takes an XML file and makes a transient domain, instead of virsh start, which boots a defined persistent guest.

39
MCQmedium

You need to attach a new block device to a running VM. What virsh command achieves this?

A.virsh attach-device-file vm_name /path/to/img
B.virsh add-device vm_name /path/to/img
C.virsh hotplug-disk vm_name /path/to/img
D.virsh attach-disk vm_name /path/to/img vda
AnswerD

virsh attach-disk adds a block device to a running domain, hot-plugging the image at the specified target such as vda. This satisfies the requirement to attach a new disk without shutting down the VM, provided the guest supports hot-plug.

Why this answer

The virsh attach-disk command is the standard way to hot-plug a new block device to a running domain. Its syntax is 'virsh attach-disk <domain> <source> <target>' where source is the host image path and target is the guest device name (e.g., vda, vdb). This command modifies the domain's live XML and, with --persistent, also updates the saved configuration.

Exam trap

The trap is that candidates may invent plausible-sounding virsh subcommands like 'hotplug-disk' or 'add-device' instead of recalling the actual 'attach-disk' syntax with source and target arguments.

How to eliminate wrong answers

Option A is wrong because 'attach-device-file' is not a virsh subcommand; attach-device exists but takes an XML file, not a raw image path. Option B is wrong because 'add-device' is not a valid virsh command. Option C is wrong because 'hotplug-disk' is not a virsh command; hot-plugging is achieved via attach-disk or attach-device with an XML definition.

40
MCQhard

A production KVM guest uses a virtio-blk disk and experiences periodic I/O stalls during heavy write bursts. You want to switch the guest disk to virtio-scsi with multiple queues to improve parallelism without reinstalling the guest OS. Which change should you make to the domain XML?

A.Add <driver name='qemu' type='qcow2' queues='4'/> to the existing virtio-blk disk and restart the guest.
B.Set <driver name='qemu' type='raw' cache='none' io='native'/> on the disk and increase the guest's nr_requests.
C.Add a <controller type='scsi' model='virtio-scsi'/> with queues='4' and change the disk target bus to scsi.
D.Replace the disk with <disk type='network' device='disk'> using an NBD backend exported by the host.
AnswerC

Virtio-scsi multi-queue parallelism is configured on the SCSI controller via the queues attribute, and the disk must be attached to that controller by setting its target bus to scsi. This combination enables multiple virtqueues between guest and host, improving throughput under concurrent I/O without touching the guest OS installation itself, since virtio-scsi drivers are present in modern Linux guests.

Why this answer

Virtio-scsi multi-queue is enabled by adding queues to the virtio-scsi controller element and attaching the disk to that controller through its target bus. This gives the guest multiple virtqueues for parallel I/O processing, which reduces stalls during write bursts. The other options either misuse the queues attribute, change image formats without addressing parallelism, or introduce a network block backend that does not provide the requested feature.

Exam trap

The trap here is assuming the queues attribute applies to the disk driver element, when it actually belongs to the virtio-scsi controller.

41
MCQeasy

In the context of virtualization, what does 'ballooning' refer to?

A.Scaling network bandwidth for a VM
B.Increasing the number of virtual CPUs
C.Dynamically resizing guest memory
D.Compressing disk images on the fly
AnswerC

Ballooning uses a paravirtualised driver to inflate or deflate a guest's memory allocation at runtime, reclaiming unused pages for other VMs. This satisfies the requirement to dynamically resize guest memory without rebooting, unlike static allocation at domain start.

Why this answer

Ballooning is a memory reclamation technique where a special 'balloon' driver inside the guest OS inflates by allocating guest memory pages, forcing the guest to swap or release them back to the hypervisor for use by other VMs. When the hypervisor needs memory, it tells the balloon to inflate; when memory pressure subsides, the balloon deflates and returns pages to the guest. This allows dynamic resizing of guest memory without rebooting the VM.

Exam trap

The trap here is confusing memory ballooning with other dynamic resource features like CPU hot-add or disk compression — candidates who only skim 'dynamically resizing' may pick the wrong resource type.

How to eliminate wrong answers

Option A is wrong because network bandwidth scaling is handled by virtual NIC configuration and QoS/bandwidth throttling, not by memory ballooning — ballooning has nothing to do with network throughput. Option B is wrong because adding vCPUs is a CPU hot-plug or VM reconfiguration operation, unrelated to memory management. Option D is wrong because on-the-fly disk image compression is a storage feature (e.g., qcow2 compression or virt-sparsify), not a memory reclamation mechanism.

42
Multi-Selecthard

An administrator is configuring a KVM host that will run a latency-sensitive guest. The goal is to reduce scheduling jitter and improve cache locality for that guest's vCPUs. Which TWO measures are appropriate? (Choose two.)

Select 2 answers
A.Isolate host CPUs from the general scheduler using the kernel's isolcpus or cpuset controls and assign the guest to them.
B.Increase the number of vCPUs assigned to the guest so the scheduler has more threads to choose from.
C.Set the guest's disk cache mode to 'none' in the domain XML.
D.Pin the guest's vCPU threads to specific host physical CPUs using CPU affinity.
E.Enable the virtio-balloon driver and set a memory balloon target for the guest.
AnswersA, D

Removing a set of host CPUs from the general scheduler means other host tasks will not run there, so the guest's pinned vCPUs are not preempted by unrelated work. Combined with pinning, this sharply reduces jitter and keeps the guest's working set in cache. It is a core technique for latency-sensitive virtualization on Linux.

Why this answer

Reducing jitter and improving cache locality for a latency-sensitive guest is achieved by dedicating host CPUs to it and preventing the scheduler from moving or preempting its vCPU threads. Pinning vCPU threads to specific physical CPUs and isolating those CPUs from the general scheduler via isolcpus or cpusets together provide that isolation. Disk cache settings, memory ballooning, and adding vCPUs do not address CPU scheduling jitter.

Exam trap

The trap here is treating any performance-tuning option as helpful, when only CPU affinity and CPU isolation actually reduce scheduling jitter for the guest.

43
MCQmedium

You need to convert a raw disk image to QCOW2 format to enable snapshotting. Which command is correct?

A.qemu-img convert -i raw -o qcow2 source.img target.qcow2
B.virsh image-convert source.img target.qcow2
C.qemu-img change -f raw -t qcow2 source.img
D.qemu-img convert -f raw -O qcow2 source.img target.qcow2
AnswerD

qemu-img convert with -f raw and -O qcow2 reads the source as a raw image and writes QCOW2 output, satisfying the snapshotting requirement. The explicit input and output format flags prevent misdetection, unlike qemu-img create or resize.

Why this answer

The correct syntax is 'qemu-img convert -f raw -O qcow2 source.img target.qcow2'. The -f flag specifies the source format and -O (capital O) specifies the destination format. This is the canonical way to convert a raw image into QCOW2 so that snapshots, compression, and backing files become available.

Exam trap

The trap here is confusing qemu-img's -f/-O (format flags) with generic -i/-o input/output flags that candidates assume exist from other CLI tools.

How to eliminate wrong answers

Option A is wrong because qemu-img uses -f/-O, not -i/-o; -i and -o are not valid convert flags (lowercase -o is used for options in some subcommands, but not as a format specifier here). Option B is wrong because 'virsh image-convert' does not exist — virsh manages domains, networks, and pools, not image format conversion. Option C is wrong because 'qemu-img change' is not a valid subcommand; the correct subcommand is 'convert', and -t is not a format flag.

44
Multi-Selectmedium

Which TWO of the following commands can be used to manage virtual networks in libvirt?

Select 2 answers
A.virsh net-define
B.virsh net-config
C.virsh net-start-all
D.virsh net-status
E.virsh net-list
AnswersA, E

`virsh net-define` imports a persistent network definition from an XML file, registering it with libvirt without starting it. This satisfies the requirement to manage virtual networks, since defining, editing and removing networks are core management operations, and the command operates on the network object itself rather than on individual domains.

Why this answer

Option A, virsh net-define, is correct because it defines a persistent virtual network in libvirt from an XML configuration file, creating the network object that can later be started and made autostart. Option E, virsh net-list, is correct because it lists the virtual networks known to libvirt and can show their state (active/inactive) and autostart flag, making it a core management command. Option B, virsh net-config, does not exist as a libvirt subcommand; network XML is edited via virsh net-edit or net-define.

Option C, virsh net-start-all, is not a valid virsh command; individual networks are started with virsh net-start, and autostart is set with virsh net-autostart. Option D, virsh net-status, is not a real libvirt subcommand; network state is obtained through virsh net-list or virsh net-info.

Exam trap

The trap here is that candidates assume virsh follows a uniform verb pattern (net-config, net-status) mirroring other tools, when libvirt actually uses net-define, net-edit, net-info, and net-list — so plausible-sounding but nonexistent subcommands look correct.

45
MCQeasy

Which command is used to list all defined virtual networks in Libvirt?

A.brctl show
B.virsh net-list --all
C.virsh domiflist
D.virsh list-networks
AnswerB

`virsh net-list --all` queries the libvirt daemon and returns every network defined in the hypervisor, including inactive ones. The `--all` flag satisfies the stem's requirement to list *all* defined virtual networks, whereas the bare `virsh net-list` shows only currently active networks.

Why this answer

The `virsh net-list --all` command queries libvirt's virtual network driver and displays every network defined in the hypervisor, including those that are currently inactive. The `--all` flag is essential because without it, virsh only shows networks that are actively running. This is the canonical libvirt-native way to enumerate virtual networks, as opposed to inspecting the underlying Linux bridge layer.

Exam trap

The trap here is confusing libvirt's network abstraction with the underlying Linux bridge layer — candidates who know `brctl show` from general Linux networking pick it, forgetting that libvirt networks and kernel bridges are not 1:1 and that inactive networks won't appear in bridge listings.

How to eliminate wrong answers

Option A is wrong because `brctl show` lists Linux bridge interfaces at the kernel level, not libvirt virtual networks — a libvirt network may exist without a corresponding bridge (e.g., when inactive), and bridges can exist outside libvirt's management. Option C is wrong because `virsh domiflist` lists the network interfaces attached to a specific domain (guest VM), not the defined virtual networks themselves. Option D is wrong because `virsh list-networks` is not a valid virsh subcommand; the correct syntax is `virsh net-list`.

46
MCQhard

You need to enable hugepages for a VM in libvirt to improve memory performance. What XML entry do you add?

A.<system-memory hugepages='true'/>
B.<memoryBacking><hugepages/></memoryBacking>
C.<memory mode='hugepages'/>
D.<hugepages enabled='yes'/>
AnswerB

Placing `<hugepages/>` inside `<memoryBacking>` instructs libvirt to back the guest's memory with huge pages rather than standard 4 KiB pages, satisfying the stem's requirement to enable hugepages for the VM. The element must sit within `<memoryBacking>` in the domain XML; standalone placement is invalid.

Why this answer

To enable hugepages for a libvirt VM, you add a memoryBacking element containing a hugepages child element inside the domain's XML. This tells libvirt/QEMU to back the guest's memory with host hugepages rather than standard 4KB pages. The other XML snippets are not valid libvirt schema.

Exam trap

305-300 often tests the exact XML structure for libvirt features — the trap is inventing plausible-looking but invalid elements instead of the correct memoryBacking/hugepages nesting.

How to eliminate wrong answers

Option A is wrong because <system-memory hugepages='true'/> is not a valid libvirt domain XML element — there is no system-memory element in the domain schema. Option C is wrong because <memory mode='hugepages'/> is not valid; the memory element uses unit and model attributes, not a hugepages mode. Option D is wrong because <hugepages enabled='yes'/> is not a recognized element; hugepages configuration must be nested under memoryBacking.

47
MCQeasy

You are managing a KVM host and need to create a new storage pool that uses a directory on the host filesystem to store disk images. After creating the directory /var/lib/libvirt/images/extra, you want to define and start a libvirt storage pool named 'extra-pool' that uses this directory. Which sequence of virsh commands accomplishes this?

A.virsh pool-define-as extra-pool dir --target /var/lib/libvirt/images/extra; virsh pool-start extra-pool
B.virsh pool-create-as extra-pool dir --target /var/lib/libvirt/images/extra
C.virsh vol-create-as extra-pool /var/lib/libvirt/images/extra 10G
D.virsh pool-define-as extra-pool logical --target /var/lib/libvirt/images/extra
AnswerA

This sequence defines a directory-type storage pool with the given target path and then starts it, making it active. The pool-define-as command creates a persistent definition, and pool-start activates it. This is the correct way to create and enable a directory-based pool without using an XML file.

Why this answer

The correct approach is to define a persistent directory-based pool using pool-define-as with type dir and the target path, then start it with pool-start. This creates a reusable pool definition and activates it immediately. Using pool-create-as would only create a transient pool, and the other commands either target volumes or use the wrong pool type.

Exam trap

The trap here is confusing pool-define-as with pool-create-as; the former creates a persistent definition, while the latter creates a transient pool that disappears after a restart.

48
MCQeasy

What does the term 'KVM' stand for?

A.Kernel-based Virtual Machine
B.K-Hypervisor Virtual Machine
C.Kernel Virtual Module
AnswerA

Kernel-based Virtual Machine is the Linux kernel module that turns the kernel itself into a type-1 hypervisor, exposing hardware virtualisation extensions (Intel VT-x or AMD-V) through /dev/kvm. This directly satisfies the stem's request for the expansion of the acronym KVM, distinguishing it from keyboard-video-mouse switching hardware.

Why this answer

KVM stands for Kernel-based Virtual Machine. It is a Linux kernel module that turns the Linux kernel into a Type-1 hypervisor by exposing hardware virtualization extensions (Intel VT-x, AMD-V) through /dev/kvm. QEMU typically runs on top of KVM to provide full machine emulation and device models.

Exam trap

The trap is a simple acronym recall test where fabricated expansions like 'Kernel Virtual Module' sound plausible to candidates who have not memorized the official name.

How to eliminate wrong answers

Option B (K-Hypervisor Virtual Machine) is wrong because there is no such term — KVM is not named after a 'K-Hypervisor'. Option C (Kernel Virtual Module) is wrong because KVM is a virtualization subsystem, not a loadable module concept by that name (though it is delivered as kvm.ko, the expansion is Kernel-based Virtual Machine). Option D (Kilo-Virtual Machine) is wrong because 'Kilo' is not part of the acronym; it is a fabricated distractor.

49
MCQmedium

Which utility is best for creating a new libvirt storage pool?

A.virsh pool-create
B.virt-pool-builder
C.virsh pool-define-as
D.virsh add-pool
AnswerC

pool-define-as creates a persistent pool definition in libvirt's configuration without starting it, letting you specify type, name and source devices. This is the correct utility for establishing a new pool before building or starting it.

Why this answer

virsh pool-define-as creates a persistent storage pool definition in libvirt's configuration without starting it, which is the correct first step for creating a new pool. After defining, you run virsh pool-build (if needed) and virsh pool-start to activate it.

Exam trap

The trap is confusing pool-create with pool-define-as — pool-create works immediately but is transient, while pool-define-as is the persistent definition step, which is what 'creating a new pool' properly requires.

How to eliminate wrong answers

Option A is wrong because virsh pool-create creates a transient (non-persistent) pool that disappears after libvirt restarts — it is not the best choice for a permanent new pool. Option B is wrong because virt-pool-builder is not a real utility; the virt-* tools include virt-install, virt-clone, virt-manager, and virt-viewer, but no pool builder. Option D is wrong because virsh add-pool is not a valid virsh subcommand — the correct verbs are pool-define, pool-define-as, pool-create, and pool-create-as.

50
MCQmedium

You need to create a new storage pool for KVM guests using the virsh command-line tool. The pool should use a directory on the host filesystem at /var/lib/libvirt/images/extra. Which command correctly defines and starts this pool?

A.virsh pool-define-as extra dir --target /var/lib/libvirt/images/extra && virsh pool-start extra
B.virsh pool-create-as extra dir --target /var/lib/libvirt/images/extra
C.virsh pool-define extra --type dir --path /var/lib/libvirt/images/extra && virsh pool-start extra
D.virsh pool-add extra dir /var/lib/libvirt/images/extra && virsh pool-start extra
AnswerA

The pool-define-as command creates a persistent pool definition. The first argument is the pool name, followed by the pool type (dir), and then the target path. After defining, the pool must be started with pool-start. This correctly sets up a directory-based storage pool. The pool will be automatically started on host boot if pool-autostart is set, but pool-start is needed for immediate use.

Why this answer

To create a persistent directory-based storage pool, you use virsh pool-define-as with the pool name, type 'dir', and the target path. Then you start it with virsh pool-start. This ensures the pool is defined in libvirt's configuration and is immediately available for use.

The pool-create-as command creates a transient pool that is lost on reboot, which is not suitable for a permanent addition.

Exam trap

The trap here is confusing pool-define-as (persistent) with pool-create-as (transient). Both can create a pool, but only pool-define-as makes it persistent.

51
Multi-Selectmedium

You are troubleshooting a KVM guest that fails to boot after you changed its XML configuration. You want to verify and correct the guest's definition without starting it. Which TWO of the following actions are appropriate? (Choose two.)

Select 2 answers
A.Use virsh undefine guestname then virsh define guest.xml to replace the configuration.
B.Use virsh define /path/to/guest.xml to update the persistent domain definition from an edited XML file.
C.Use virsh edit guestname to modify the domain XML in place, which validates the XML before saving.
D.Use virsh dumpxml guestname > guest.xml, edit the file, then run virsh create guest.xml to apply changes persistently.
E.Use virsh start guestname --validate to check the XML and start the guest if valid.
AnswersB, C

virsh define loads a new persistent configuration for the domain from the specified XML file. This is the correct way to apply changes to a guest's definition without starting it. It replaces the existing persistent definition, so you can correct errors and then start the guest when ready.

Why this answer

To correct a guest's persistent XML without starting it, you can either edit the XML directly with virsh edit, which validates before saving, or prepare an edited XML file and apply it with virsh define. Both update the persistent definition. Using virsh create would only start a transient guest, and undefining is destructive and unnecessary.

Exam trap

The trap here is assuming that virsh create updates the persistent configuration; it actually starts a transient domain, leaving the original definition unchanged.

52
MCQmedium

What is the default location for libvirt domain configuration XML files?

A./etc/libvirt/qemu/
B./var/lib/libvirt/domains/
C./etc/libvirt/networks/
D./usr/share/libvirt/
AnswerA

Libvirt stores persistent domain definitions as individual XML files under /etc/libvirt/qemu/, named after each guest. This satisfies the question's requirement for the default configuration location, since transient domains exist only in memory and the runtime state directory /var/run/libvirt/qemu/ holds no persistent XML.

Why this answer

The default location for libvirt domain configuration XML files is /etc/libvirt/qemu/. This directory holds the persistent XML definitions for QEMU/KVM domains, which are used by libvirt to manage and start virtual machines. When a domain is defined with virsh define, its XML is stored here.

Exam trap

305-300 often tests the distinction between configuration files (/etc) and runtime data (/var), so candidates may incorrectly choose /var/lib/libvirt/domains/ assuming all VM-related data resides under /var.

How to eliminate wrong answers

Option B is wrong because /var/lib/libvirt/domains/ is not a standard libvirt directory; libvirt stores runtime state and disk images under /var/lib/libvirt, but domain XMLs are not kept there. Option C is wrong because /etc/libvirt/networks/ is for network configuration XML files, not domain definitions. Option D is wrong because /usr/share/libvirt/ contains read-only data like documentation and schema files, not mutable domain configuration.

53
MCQeasy

Which file system structure is typically used for QEMU virtual disk images when using LVM?

A./mnt/storage/disk.qcow2
B./dev/vg_name/lv_name
C./dev/sda1
D./var/lib/libvirt/images/disk.img
AnswerB

LVM presents logical volumes as block devices under /dev/vg_name/lv_name, which QEMU can attach directly as a virtual disk backing file. This satisfies the stem's LVM constraint, since the path resolves through the volume group to the logical volume rather than exposing a raw partition or plain image file.

Why this answer

When QEMU/KVM virtual disks are backed by LVM, the logical volume is exposed as a block device at /dev/<volume_group>/<logical_volume>, and that path is what QEMU uses as the disk source. LVM presents storage as block devices, not as file paths inside a filesystem.

Exam trap

305-300 often tests the distinction between file-based disk images (qcow2/img paths) and block-device-backed storage, so candidates pick a filesystem path like /var/lib/libvirt/images/disk.img instead of the LVM device path.

How to eliminate wrong answers

Option A is wrong because /mnt/storage/disk.qcow2 is a file path for a qcow2 image stored on a mounted filesystem, not an LVM logical volume. Option C is wrong because /dev/sda1 is a physical partition device, not an LVM logical volume, and using it directly bypasses LVM management. Option D is wrong because /var/lib/libvirt/images/disk.img is the default libvirt storage pool path for a raw image file, not an LVM-backed block device.

54
MCQhard

You are troubleshooting a performance issue and want to pin a VM process to specific physical CPU cores. Which XML element is used?

A.<pinning vcpu='0' cores='0'/>
B.<cpu-pinning vcpu='0' cpu='0'/>
C.<cputune><vcpupin vcpu='0' cpuset='0-1'/></cputune>
D.<affinity vcpu='0' host-cpu='0'/>
AnswerC

The cputune element with vcpupin binds a virtual CPU to a host cpuset, satisfying the pinning requirement. Placing it under cputune rather than cpu or numa distinguishes per-vCPU affinity from topology definitions or memory placement.

Why this answer

The <cputune> element in libvirt domain XML is the dedicated container for CPU tuning parameters, and <vcpupin> is the child element that binds a guest vCPU to a specific host CPU set. The vcpu attribute identifies the guest virtual CPU, while cpuset specifies the host physical CPUs (as a range or list) it may run on. This is the canonical, documented way to pin VM processes to physical cores in KVM/QEMU environments managed by libvirt.

Exam trap

The trap here is that candidates recall the concept of CPU pinning but invent plausible-sounding XML tags like <pinning> or <cpu-pinning> instead of remembering the actual libvirt schema element <cputune>/<vcpupin>.

How to eliminate wrong answers

Option A is wrong because <pinning> is not a valid libvirt XML element — no such tag exists in the domain schema. Option B is wrong because <cpu-pinning> is a fabricated element; the correct parent is <cputune> and the child is <vcpupin>, not <cpu-pinning>. Option D is wrong because <affinity> with host-cpu attributes is not part of the libvirt domain XML schema; CPU affinity is expressed via <vcpupin> inside <cputune>, not through an <affinity> tag.

55
MCQmedium

Which command is used to list all active running domains?

A.virsh domlist
B.virsh status
C.virsh list --all
D.virsh list
AnswerD

virsh list queries the libvirt daemon and enumerates running domains on the local hypervisor, matching the stem's requirement to list active running domains. Other virsh subcommands target storage pools, networks or interfaces, or require the --all flag to include inactive, shut-off domains.

Why this answer

The virsh list command lists all currently running domains (VMs) by default, showing their ID, name, and state. This is the standard libvirt CLI command for enumerating active guests. Adding --all extends the output to include inactive and shut-off domains, but the base command answers the question as asked.

Exam trap

The trap is the distinction between virsh list (running only) and virsh list --all (running plus inactive) — candidates who reflexively add --all for completeness pick the wrong option when the question specifies active running domains.

How to eliminate wrong answers

Option A is wrong because virsh domlist is not a valid virsh subcommand — the correct command is list, and domlist does not exist in the virsh command set. Option B is wrong because virsh status is not a valid subcommand; status is not how virsh enumerates domains. Option C is wrong because virsh list --all includes inactive domains as well, so it does not list only active running domains as the question specifies.

56
MCQhard

You are migrating a running KVM guest from hostA to hostB with virsh migrate --live. The migration fails immediately with 'error: internal error: Attempt to migrate guest to the same host'. Both hosts share the same NFS storage and have identical CPU models. Which condition most likely explains this failure?

A.hostB resolves to the same IP address as hostA, or the migration URI points back to hostA.
B.The guest uses a virtio-net device without a configured migration address.
C.The guest's disk image is stored on local storage instead of the shared NFS mount.
D.The libvirt daemon on hostB is listening only on a Unix socket and not on TCP.
AnswerA

libvirt refuses to migrate a domain to what it considers the same host. If the destination URI resolves to the source host's address, for example due to a stale /etc/hosts entry or a mistaken qemu+tcp:// URI, the check fails with exactly this message. Verifying name resolution and the destination argument is the correct first step.

Why this answer

libvirt compares the destination against the source host identity and aborts when they match, which is exactly what the 'same host' error indicates. The common causes are incorrect DNS or /etc/hosts entries, using a URI that resolves locally, or accidentally passing the local hostname as the destination. Confirming that hostB resolves to a distinct, reachable address and that the migration URI targets it resolves the issue.

Exam trap

The trap here is focusing on storage or device configuration, when the error text specifically signals a host identity comparison failure in libvirt's migration validation.

57
Multi-Selectmedium

Which THREE of the following are valid Libvirt storage pool types?

Select 3 answers
A.ram
B.iscsi
C.lvm
D.usb
E.dir
AnswersB, C, E

Libvirt provides an iscsi storage pool type that connects to an iSCSI target and exposes its LUNs as volumes. It is a recognised pool driver, distinct from dir, fs, netfs, logical, disk, scsi, mpath, rbd, gluster and zfs.

Why this answer

Option B (iscsi) is correct because Libvirt supports an iSCSI storage pool type that connects to an iSCSI target and exposes its LUNs as volumes. Option C (lvm) is correct because Libvirt can use an existing LVM volume group as a storage pool, creating logical volumes as pool volumes. Option E (dir) is correct because the directory pool type is the most basic Libvirt pool, managing files in a local directory.

Options A (ram) and D (usb) are not valid Libvirt storage pool types; Libvirt's defined pool types include dir, disk, fs, netfs, logical (LVM), iscsi, scsi, mpath, rbd, sheepdog, gluster, and zfs, but not ram or usb.

Exam trap

305-300 often tests whether candidates confuse host device passthrough types (usb, pci) with storage pool backends, so 'usb' looks plausible but is not a pool type.

58
MCQmedium

You want to optimize disk I/O performance for a KVM guest. Which bus type should you configure in the libvirt domain XML for the virtual disk?

A.scsi
B.usb
C.ide
D.virtio
AnswerD

Virtio provides a paravirtualised block driver, letting the guest issue I/O through shared memory rings rather than emulating a full storage controller. This bypasses the trap-and-emulate overhead of IDE or SATA emulation, delivering the lowest latency and highest throughput — exactly the disk I/O optimisation the scenario demands.

Why this answer

Virtio is a paravirtualized I/O driver framework designed specifically for KVM guests, providing near-native disk I/O performance by reducing the overhead of full hardware emulation. Configuring the disk bus as virtio in the libvirt domain XML (using <target dev='vda' bus='virtio'/>) allows the guest to use the virtio-blk or virtio-scsi driver, which significantly outperforms emulated IDE or SCSI controllers. This is the recommended bus type for production KVM workloads.

Exam trap

305-300 often tests the misconception that SCSI is always faster than virtio, when in fact virtio is a paravirtualized driver that outperforms emulated SCSI in KVM environments.

How to eliminate wrong answers

Option A is wrong because SCSI, while better than IDE, still involves emulation overhead unless combined with virtio-scsi; plain SCSI is not the optimal choice for performance. Option B is wrong because USB is a slow, external bus intended for peripherals, not primary virtual disks, and would severely bottleneck I/O. Option C is wrong because IDE is a legacy emulated controller with high CPU overhead and limited throughput, making it the worst choice for performance.

59
MCQeasy

You are preparing a KVM guest for a maintenance window and need to shut it down gracefully so the guest OS can flush buffers and stop services. Which virsh command should you use?

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

The shutdown subcommand sends an ACPI shutdown signal or, if the QEMU guest agent is configured, a guest-agent shutdown request. This lets the guest OS perform an orderly halt, flushing buffers and stopping services. It matches the requirement for a graceful maintenance shutdown.

Why this answer

A graceful shutdown requires notifying the guest OS so it can stop services and flush buffers. The shutdown subcommand does this via ACPI or the guest agent. destroy is a forced power-off, suspend is a pause, and undefine removes configuration, so none of those provide an orderly halt.

Exam trap

The trap here is assuming that destroy performs a clean shutdown because the word sounds like it removes the domain safely, when in fact it is a hard power-off.

60
MCQhard

In a Xen environment, which command would you use to change the number of VCPUs allocated to a running domain 'dom1' to 4?

A.virsh setvcpus dom1 4
B.xl mem-set dom1 4
C.xl vcpu-set dom1 4
D.xm set-vcpu dom1 4
AnswerC

xl vcpu-set adjusts the virtual CPU count of a running domain through the Xen hypervisor toolstack, applying the new value to dom1 immediately. It changes the live allocation to four VCPUs without rebooting the guest.

Why this answer

In a Xen environment managed via the xl toolstack (the modern replacement for xm), the xl vcpu-set command is used to change the number of virtual CPUs assigned to a running domain. The syntax 'xl vcpu-set dom1 4' sets domain dom1 to 4 VCPUs. This is the Xen-native equivalent of virsh setvcpus in libvirt-managed environments.

Exam trap

The trap here is confusing libvirt's virsh command set with Xen's native xl/xm toolstack — candidates who default to virsh forget that the question specifies a Xen environment, not a libvirt-managed one.

How to eliminate wrong answers

Option A is wrong because virsh setvcpus is a libvirt command, not a native Xen xl/xm command — it works only when the host is managed through libvirt, not directly through the Xen toolstack. Option B is wrong because xl mem-set adjusts memory allocation, not VCPU count. Option D is wrong because xm set-vcpu is not a valid xm subcommand (the correct legacy form is 'xm vcpu-set'), and xm itself is deprecated in favor of xl.

61
Multi-Selectmedium

You need to enable and configure a UEFI firmware boot for a new KVM guest on a libvirt host. Which TWO of the following steps are required? (Choose two.)

Select 2 answers
A.Disable the QEMU guest agent channel because it conflicts with UEFI variable services.
B.Convert the guest disk image from qcow2 to raw format because UEFI firmware cannot boot from qcow2.
C.Set the domain's <os> element to use <loader type='pflash'> with the OVMF code and variable store paths, or select the UEFI firmware via the firmware autoselection feature.
D.Add a <boot dev='uefi'/> element to the domain's <os> section to select UEFI boot order.
E.Install the OVMF firmware package on the host so the OVMF_CODE and OVMF_VARS files are available.
AnswersC, E

The domain XML must reference the UEFI firmware through a pflash loader or the newer firmware autoselection attributes. This tells QEMU to boot via UEFI and where to find the code and variable store. Without this configuration change, the guest would still boot with legacy BIOS.

Why this answer

Enabling UEFI boot requires the OVMF firmware files to be present on the host and the domain XML to reference them via a pflash loader or firmware autoselection. Neither the disk image format nor the guest agent is relevant to UEFI support, and there is no 'uefi' boot device value in libvirt XML.

Exam trap

The trap here is inventing a boot dev value for UEFI or assuming disk format matters, when the real requirement is firmware files plus a loader definition.

62
MCQhard

You are using QEMU to emulate an ARM architecture on an x86 host. Which binary would you typically use to execute this?

A.qemu-x86_64-arm
B.qemu-system-arm
C.qemu-arm
D.qemu-system-x86_64
AnswerB

qemu-system-arm is the full-system emulator binary that models an ARM machine, so it can boot an ARM kernel and OS on an x86 host. The stem specifies full ARM architecture emulation, which qemu-arm-user (user-mode only) cannot provide.

Why this answer

qemu-system-arm is the QEMU binary that emulates a full ARM system, including CPU, memory, and peripherals, allowing you to run an ARM operating system on an x86 host. The 'system' prefix indicates full-system emulation, as opposed to user-mode emulation. This is the correct binary for booting an ARM kernel or OS image.

Exam trap

The trap is confusing user-mode (qemu-arm) with system-mode (qemu-system-arm) emulation — candidates who remember 'qemu-arm' may pick it without realizing it cannot boot an OS.

How to eliminate wrong answers

Option A is wrong because 'qemu-x86_64-arm' is not a valid QEMU binary name; QEMU user-mode binaries follow the pattern qemu-<target-arch> (e.g., qemu-arm), not qemu-<host>-<target>. Option C is wrong because qemu-arm is the user-mode emulation binary, which runs individual ARM Linux binaries on a host but does not emulate a full system or boot an OS. Option D is wrong because qemu-system-x86_64 emulates an x86_64 system, which is the host architecture, not the ARM target the question asks for.

63
Multi-Selecthard

Which THREE of the following are legitimate security concerns when managing a virtualization host?

Select 3 answers
A.Unencrypted VNC connections
B.Unauthorized access to the libvirt socket
C.Network interface speed
D.Guest-to-host breakout exploits
E.Hard drive fragmentation
AnswersA, B, D

VNC traffic is unencrypted by default, so credentials and screen data traverse the network in cleartext and can be captured by anyone with access to the path. This satisfies the scenario's requirement to identify a legitimate security concern affecting virtualisation host management.

Why this answer

Option A is correct because VNC is often used to remotely access a virtualization host's console or guest consoles, and VNC traffic is unencrypted by default, allowing credentials and session data to be intercepted on the network. Option B is correct because the libvirt socket (typically /var/run/libvirt/libvirt-sock) provides privileged management access to virtual machines; if permissions are misconfigured, unauthorized users could start, stop, or reconfigure guests. Option D is correct because guest-to-host breakout exploits target hypervisor or emulation vulnerabilities to escape the VM boundary and gain code execution on the host, which is a fundamental virtualization security risk.

Option C is not a security concern but a performance/availability consideration, and option E is a storage performance issue rather than a security threat.

Exam trap

The trap is that candidates may select performance-related items like network speed or disk fragmentation as security concerns, confusing operational efficiency with actual security vulnerabilities.

64
MCQhard

Which option for 'qemu-img create' allows you to create a preallocated image?

A.-o preallocation=full
B.--prealloc=true
C.-p full
D.-f preallocated
AnswerA

Using `-o preallocation=full` instructs qemu-img to allocate every data block on the host filesystem immediately, rather than lazily on first write. This satisfies the stem's requirement for a preallocated image, avoiding fragmentation and runtime allocation overhead during guest writes.

Why this answer

The correct syntax is qemu-img create -f qcow2 -o preallocation=full disk.qcow2, where preallocation is a format-specific option passed via -o. Setting preallocation=full allocates all the space on the host immediately, avoiding fragmentation and improving write performance at the cost of disk usage. Other valid values are off, metadata, and falloc.

Exam trap

The trap is assuming qemu-img uses long-form flags like --prealloc or a dedicated -p switch, when in fact all format-specific tuning goes through the -o key=value syntax.

How to eliminate wrong answers

Option B is wrong because --prealloc is not a valid qemu-img flag; qemu-img uses -o for format options, not long GNU-style flags. Option C is wrong because -p is not a preallocation switch — it is not a recognized qemu-img create option at all. Option D is wrong because -f specifies the image format (e.g., qcow2, raw), not a preallocation mode, so '-f preallocated' would be interpreted as an unknown format.

65
MCQmedium

You administer a KVM host running libvirt. A developer needs a guest to be able to communicate with the host directly over a private network without any NAT or bridging to the physical LAN. You decide to use libvirt's default virtual network. Which virsh command will display the XML definition of this default network so you can inspect its forwarding mode and DHCP range?

A.virsh net-dhcp-leases default
B.virsh net-list --info default
C.virsh net-dumpxml default
D.virsh iface-dumpxml default
AnswerC

The net-dumpxml subcommand outputs the full XML definition of a libvirt virtual network. For the default network it reveals the forward mode='nat' element, the 192.168.122.0/24 address range, and the DHCP configuration. This is exactly the inspection needed to confirm how guests on the default network reach the host and external networks.

Why this answer

The net-dumpxml subcommand is the canonical way to retrieve the XML configuration of a libvirt virtual network. Inspecting the default network's XML reveals its NAT forwarding mode and DHCP range, which is precisely what the scenario requires. Other net-* subcommands either list runtime state or leases rather than the full definition.

Exam trap

The trap here is assuming that any virsh net-* subcommand will reveal the network's configuration, when only net-dumpxml outputs the full XML definition.

66
Multi-Selecthard

Which THREE of the following are necessary to enable QEMU guest agent integration?

Select 3 answers
A.Installing qemu-guest-agent inside the guest
B.Adding a channel device for the agent to the XML
C.Adding a network bridge
D.Restarting the VM to apply the channel configuration
E.Enabling VNC password
AnswersA, B, D

Installing qemu-guest-agent inside the guest provides the in-VM daemon that communicates over the virtio-serial channel, enabling the host to issue commands such as graceful shutdown and filesystem freeze. Without this agent running, the host has no channel endpoint, so guest-agent integration cannot function regardless of host-side configuration.

Why this answer

Option A is correct because the QEMU guest agent requires the qemu-guest-agent package (or equivalent, e.g., qemu-ga) to be installed and running inside the guest OS so it can communicate over the virtio-serial channel. Option B is correct because the VM's libvirt XML must define a channel device of type 'unix' with the target name 'org.qemu.guest_agent.0' (typically using a virtio-serial port) to provide the host-guest communication path. Option D is correct because the channel device is only instantiated at VM start, so the guest must be restarted (or the domain rebooted) for the new channel to become available and the agent to connect.

Option C is not required because the guest agent uses a virtio-serial channel, not a network bridge, so no bridge configuration is needed. Option E is not required because VNC password authentication is unrelated to guest agent integration and only affects graphical console access.

Exam trap

The 305-300 exam often tests the specific components of guest agent integration, and the trap is selecting a plausible but unrelated networking option (bridge or VNC) instead of the required channel device and guest-side installation.

67
MCQeasy

What is a 'snapshot' in virtualization?

A.A virtual hardware configuration
B.A log file of guest activity
C.A backup of the entire host system
D.A saved state of a virtual machine at a point in time
AnswerD

A snapshot captures the complete state of a virtual machine — disk, memory, and configuration — at a specific moment, enabling rollback to that exact point. This differs from clones, which create independent copies rather than point-in-time restore states.

Why this answer

A snapshot in virtualization is a saved state of a virtual machine at a specific point in time, capturing disk contents (and optionally memory/CPU state) so the VM can be reverted to that state. It is not a hardware config, log, or full host backup. Snapshots enable rollback after changes or failures.

Exam trap

305-300 often tests the definition of a snapshot — the trap is confusing it with a full backup or a VM configuration file, when it is specifically a point-in-time state capture.

How to eliminate wrong answers

Option A is wrong because a virtual hardware configuration is the VM's XML definition (CPU, memory, devices), not a snapshot. Option B is wrong because a log file records guest activity/events; it does not capture VM state for restoration. Option C is wrong because a snapshot captures a single VM's state, not the entire host system — host-level backups are a different concept.

68
MCQeasy

Which component is responsible for the actual hardware-assisted virtualization in KVM?

A.Virt-manager GUI
B.KVM kernel module
C.Libvirtd daemon
D.QEMU user-mode binary
AnswerB

The KVM kernel module operates in kernel space and uses hardware virtualisation extensions (Intel VT-x or AMD-V) to execute guest code directly on the CPU. It satisfies the stem's requirement for hardware-assisted virtualisation, unlike QEMU, which handles device emulation in user space.

Why this answer

The KVM kernel module (kvm.ko and hardware-specific modules like kvm_intel or kvm_amd) is responsible for hardware-assisted virtualization. It leverages CPU virtualization extensions (Intel VT-x or AMD-V) to execute guest code directly on the host CPU while trapping privileged instructions. This provides near-native performance for virtual machines.

Exam trap

The trap is attributing virtualization to management tools (virt-manager, libvirtd) or QEMU, when the actual hardware-assisted virtualization is performed by the KVM kernel module.

How to eliminate wrong answers

Option A is wrong because virt-manager is a graphical management tool for libvirt, not a virtualization component. Option C is wrong because libvirtd is a daemon that manages hypervisors and provides an API, but it does not perform virtualization itself. Option D is wrong because QEMU user-mode binary performs emulation and I/O, but hardware-assisted virtualization is handled by KVM; QEMU without KVM is pure software emulation.

69
Multi-Selecthard

Which THREE of the following are valid elements inside the <interface type='bridge'> block?

Select 3 answers
A.<source bridge='br0'/>
B.<ip address='...'/>
C.<gateway address='...'/>
D.<model type='virtio'/>
E.<mac address='...'/>
AnswersA, D, E

The `<source bridge='br0'/>` element names the host bridge that the guest's virtual NIC attaches to, satisfying the requirement for a valid child element within `<interface type='bridge'>`. Libvirt uses this attribute to bind the domain interface to an existing Linux bridge, so traffic egresses via br0 rather than a virtual network.

Why this answer

Option A is correct because <source bridge='br0'/> is the required child element that tells libvirt which host bridge the guest interface should be attached to, and it is valid inside <interface type='bridge'>. Option D is correct because <model type='virtio'/> is a valid child element that selects the emulated NIC model presented to the guest, with virtio being the paravirtualized option. Option E is correct because <mac address='...'/> is a valid child element used to assign a specific MAC address to the guest interface.

Options B and C are not valid here: <ip address='...'/> and <gateway address='...'/> are not children of <interface type='bridge'>; IP/gateway configuration belongs in the guest OS or in higher-level network definitions, not in the interface's bridge block.

Exam trap

305-300 often tests the distinction between interface-level and network-level configuration elements, tricking candidates into adding IP or gateway settings inside the interface block.

70
MCQeasy

Which of these is a valid virtualization storage pool type supported by libvirt?

A.cpu
B.interface
C.network
D.dir
AnswerD

The dir pool type stores volumes as ordinary files within an existing host directory, and libvirt supports it natively alongside disk, logical, iSCSI, and similar backends. It satisfies the stem's requirement for a valid libvirt storage pool type.

Why this answer

libvirt supports several storage pool types, including 'dir' (directory), 'disk', 'fs', 'logical', 'netfs', 'iscsi', 'scsi', 'mpath', 'rbd', 'sheepdog', and 'gluster'. The 'dir' type is a directory-based storage pool that uses a local directory to store volume files. Options like 'cpu', 'interface', and 'network' are not storage pool types; they are related to other libvirt objects such as CPU models, network interfaces, and virtual networks.

Exam trap

The trap here is confusing libvirt object types: candidates might think 'network' or 'interface' are storage-related because they involve I/O, but they are separate concepts.

How to eliminate wrong answers

Option A is wrong because 'cpu' is not a storage pool type; it refers to CPU configuration or models in libvirt. Option B is wrong because 'interface' is not a storage pool type; it relates to network interfaces. Option C is wrong because 'network' is not a storage pool type; it refers to virtual networks managed by libvirt.

71
MCQeasy

You are managing a KVM host and need to gracefully shut down a running guest named 'dbserver'. Which virsh command should you use?

A.virsh stop dbserver
B.virsh shutdown dbserver
C.virsh destroy dbserver
D.virsh halt dbserver
AnswerB

virsh shutdown sends an ACPI shutdown signal to the guest, requesting a graceful shutdown. The guest OS will then initiate its normal shutdown process, closing services and unmounting filesystems. This is the correct way to gracefully shut down a guest. It requires that the guest OS supports ACPI and has the necessary drivers, which is typical for modern operating systems.

Why this answer

The virsh shutdown command sends an ACPI shutdown request to the guest, allowing the guest operating system to perform a clean shutdown. This is the preferred method for gracefully stopping a virtual machine. The virsh destroy command forcibly powers off the guest, which can cause data loss.

The other options are not valid virsh commands.

Exam trap

The trap here is assuming that virsh destroy performs a graceful shutdown because the word 'destroy' might imply a clean removal, but it actually performs a hard power off.

72
Multi-Selectmedium

Which THREE of the following are necessary components for a successful KVM virtualization environment on Linux?

Select 3 answers
A.The kvm kernel module
B.QEMU userspace tools
C.Hardware support for Intel VT-x or AMD-V
D.A dedicated storage network switch
E.A full Xen hypervisor installed
AnswersA, B, C

The kvm kernel module provides the hardware-assisted virtualisation layer, exposing Intel VT-x or AMD-V extensions to userspace so guests execute near-natively. Without it, QEMU falls back to slow software emulation, failing the stem's requirement for a genuine KVM environment. It is the foundational component every other KVM tool depends upon.

Why this answer

Option A (the kvm kernel module) is correct because KVM is implemented as a Linux kernel module that exposes the /dev/kvm interface and provides the core virtualization capability, so without loading kvm (or kvm_intel/kvm_amd) no guest can execute. Option B (QEMU userspace tools) is correct because KVM only handles CPU and memory virtualization in the kernel; QEMU provides the userspace device emulation, BIOS/firmware, and the qemu-system-x86_64 process that actually creates and runs the VM. Option C (hardware support for Intel VT-x or AMD-V) is correct because KVM requires CPU virtualization extensions (vmx or svm) exposed in the CPU flags; without them KVM cannot run hardware-accelerated guests.

Option D (a dedicated storage network switch) is not required, since KVM guests can use local disks, files, or any existing network via virtio, and a separate storage switch is only an optional design choice. Option E (a full Xen hypervisor installed) is not required and is in fact an alternative hypervisor; KVM does not depend on Xen, and installing Xen would be a different virtualization stack.

Exam trap

305-300 often tests whether candidates can distinguish core KVM prerequisites from optional management or networking components — picking a storage switch or Xen reflects confusion between essential and peripheral requirements.

73
MCQeasy

Which command is used to start a VM that has been defined?

A.virsh launch vm_name
B.virsh start vm_name
C.virsh boot vm_name
D.virsh run vm_name
AnswerB

virsh start instructs libvirt to boot a previously defined but inactive domain, matching the requirement to start an already-defined VM. Alternatives such as virsh define or create either register or transiently launch domains rather than starting a persistent definition.

Why this answer

The correct command to start a defined but inactive libvirt domain (VM) is `virsh start vm_name`. This command initiates the domain from its persistent XML definition, transitioning it from the 'shut off' state to 'running'. It is the standard counterpart to `virsh shutdown` and `virsh destroy`.

Exam trap

The trap here is confusing the correct virsh subcommand with similar-sounding verbs like 'launch', 'boot', or 'run', which are not valid in libvirt. Candidates often assume any intuitive verb works, but only 'start' is recognized.

How to eliminate wrong answers

Option A is wrong because `virsh launch` is not a valid virsh subcommand; the correct verb is 'start'. Option C is wrong because `virsh boot` does not exist; booting is implied by starting the domain. Option D is wrong because `virsh run` is not a valid subcommand; 'run' is used in other contexts (e.g., `virsh run` does not exist in standard libvirt).

74
MCQmedium

How do you define a new libvirt virtual network from an XML file named 'net.xml'?

A.virsh net-define net.xml
B.virsh net-load net.xml
C.virsh define net.xml
D.virsh net-create net.xml
AnswerA

The virsh net-define subcommand parses the supplied XML and registers a persistent libvirt network definition without starting it, satisfying the requirement to define a new network from net.xml. It creates the configuration only; a separate net-start is needed to activate it.

Why this answer

The virsh net-define command parses an XML file and defines a persistent libvirt virtual network from it, registering the network configuration with libvirt without starting it. This is the correct command to load a network definition from net.xml into libvirt's configuration.

Exam trap

The trap is confusing 'virsh define' (for domains/VMs) with 'virsh net-define' (for networks), and confusing 'net-define' (persistent, inactive) with 'net-create' (transient, active) — candidates often pick net-create thinking it 'creates' the persistent network.

How to eliminate wrong answers

Option B is wrong because virsh net-load is not a valid virsh subcommand — there is no net-load operation in libvirt's CLI. Option C is wrong because virsh define net.xml defines a domain (VM) from XML, not a network; the correct domain command is 'virsh define', but for networks you must use 'virsh net-define'. Option D is wrong because virsh net-create creates and starts a transient (non-persistent) network from XML — it does not define a persistent network, and the network disappears after shutdown.

75
MCQhard

You are troubleshooting a KVM guest that fails to start with the error 'unsupported configuration: CPU mode 'host-passthrough' requires KVM'. Which of the following is the most likely cause?

A.The host CPU is too old and does not support the host-passthrough mode.
B.The guest's XML configuration has a typo in the CPU mode attribute.
C.The guest is configured to use a CPU mode that is only supported by the KVM hypervisor, but the hypervisor is not KVM (e.g., QEMU TCG).
D.The host CPU does not support hardware virtualization extensions.
AnswerC

The host-passthrough CPU mode exposes the host CPU features directly to the guest and requires hardware virtualization (KVM). If libvirt is using a different hypervisor, such as QEMU's TCG (software emulation), this mode is not supported. The error clearly states that host-passthrough requires KVM, so the most likely cause is that the guest is running under a non-KVM hypervisor, possibly due to KVM not being enabled or the domain XML specifying a different hypervisor.

Why this answer

The error 'unsupported configuration: CPU mode 'host-passthrough' requires KVM' occurs when the guest is configured with <cpu mode='host-passthrough'/> but libvirt is not using the KVM hypervisor. This can happen if KVM is not enabled on the host, or if the domain XML explicitly sets a different hypervisor type. host-passthrough exposes the host CPU model and features directly to the guest, which is only possible with hardware virtualization.

Exam trap

The trap here is assuming the error relates to CPU hardware capabilities, when it is actually about the hypervisor type not being KVM.

Page 1 of 2 · 90 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Full Virtualization questions.