Which command checks the status of the libvirtd service?
Correct systemd command.
Why this answer
systemctl status libvirtd is the standard method for checking service status on systemd systems.
194 questions total · 3pages · All types, answers revealed
Page 1 of 3
Page 2Which command checks the status of the libvirtd service?
Correct systemd command.
Why this answer
systemctl status libvirtd is the standard method for checking service status on systemd systems.
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?
This command creates an internal snapshot of the domain's state and disks.
Why this answer
The 'virsh snapshot-create-as' command is the standard way to create internal snapshots managed by libvirt.
Which hypervisor is known for being 'Type 2'?
VirtualBox is a Type 2 hypervisor.
Why this answer
VirtualBox and VMware Workstation are hosted hypervisors (Type 2).
Which TWO of the following are true regarding the differences between rkt (Rocket) and Docker?
rkt was designed to run without a persistent system-wide daemon.
Why this answer
rkt focused on pods and a daemonless architecture, whereas Docker initially used a centralized daemon.
In systemd-nspawn, how can you execute a command inside a container that is already running?
This allows interacting with a running machine.
Why this answer
'machinectl shell' is the command used to spawn a shell inside a running container.
In a FreeBSD Jail, how can you ensure the jail starts automatically at boot?
This enables the jail service.
Why this answer
Setting 'jail_enable="YES"' in /etc/rc.conf is required for the jails subsystem to start.
Which TWO of the following are common ways to connect to a virtual machine's console?
Common remote console protocol.
Why this answer
VNC and Spice are the standard remote display protocols for KVM guests.
Which Docker network driver should you use if you want containers to have their own IP addresses on the physical network, as if they were physically connected to the network?
This bridges the container to the host's physical network.
Why this answer
The 'macvlan' driver allows containers to be assigned a MAC address and IP on the physical network.
You need to change the MAC address of a network interface for a virtual machine. Where is this configured?
The <mac address='...'/> element defines it.
Why this answer
The MAC address is configured within the <interface> block of the domain XML.
What is the purpose of the 'virt-install' tool?
Correct purpose of virt-install.
Why this answer
virt-install is a command-line tool for provisioning new virtual machines.
Correct syntax for static DHCP lease.
Why this answer
The <host> element inside the <dhcp> block of a <network> definition is used for static leases.
When building a Dockerfile, which instruction should be used to define the user context for subsequent RUN, CMD, and ENTRYPOINT instructions?
This command effectively switches the security context.
Why this answer
The USER instruction sets the UID/GID for processes executed in subsequent steps.
When configuring a systemd-nspawn container, what is the effect of the --private-network option?
This creates a private network namespace for the container.
Why this answer
The --private-network flag creates a virtual network namespace for the container, ensuring it cannot access the host's network interfaces.
A Docker container running a web server is unable to serve traffic on port 8080. You verify the Dockerfile exposes port 80. What is the correct way to map this for external access?
This maps host port 8080 to container port 80.
Why this answer
The -p flag in docker run is used to map host ports to container ports.
Which THREE of the following are valid virtio device types?
SCSI controller driver.
Why this answer
virtio-blk, virtio-net, and virtio-scsi are standard virtio devices.
Which libvirt network type uses a bridge on the host to connect virtual machines directly to the physical network?
The bridge mode provides transparent network access.
Why this answer
A 'bridge' network mode in libvirt attaches the guest NIC directly to an existing host bridge, allowing the guest to obtain an IP on the physical network.
Which TWO of the following are valid storage pool types in libvirt?
LVM based pool.
Why this answer
'logical' (LVM) and 'iscsi' are valid storage pool types.
You are configuring a virtual network with a bridge. You want to disable DNS services for that network. What XML element within the <network> definition do you remove or comment out?
Removing or omitting this block disables DNS.
Why this answer
The <dns> block is responsible for the network's DNS service.
You are running a Docker container and need to map port 8080 on the host to port 80 in the container. Which command argument should you use?
Correct mapping format.
Why this answer
The -p flag (or --publish) defines port mapping.
Which Dockerfile instruction is used to copy a file from the host file system into the image?
COPY transfers files from the host to the image.
Why this answer
The COPY instruction is the standard way to move files from the build context into the image.
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?
Fstrim notifies the disk of unused blocks, and convert -O compacts the file.
Why this answer
To shrink a qcow2 image, you must first deflate the filesystem within the guest, then use qemu-img to convert/compact the image file.
Which THREE instructions in a Dockerfile can modify the image's filesystem?
Adds files or URLs to the image.
Why this answer
RUN, COPY, and ADD all add or modify content within the image layers.
What is the primary function of the libvirtd daemon?
libvirtd is the core management daemon.
Why this answer
libvirtd provides a management layer (API) to control various virtualization technologies like KVM, Xen, and LXC.
Which THREE features are provided by the Vagrant 'synced_folder' functionality?
Supports bi-directional file updates.
Why this answer
Synced folders provide shared storage, allow file editing on the host, and enable code synchronization between host and guest.
Which file system format is specifically designed for QEMU/KVM to support advanced features like copy-on-write, snapshots, and compression?
qcow2 provides all listed features.
Why this answer
QCOW2 (QEMU Copy-On-Write version 2) is the standard format for KVM that supports these features.
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?
Correct syntax for passing a PCI device to a Xen guest.
Why this answer
The pci option in the Xen domain configuration file allows passing through physical PCI devices to the guest domain.
Which signal is sent to a QEMU process when you run 'virsh destroy'?
SIGKILL forces immediate process termination.
Why this answer
virsh destroy forces a shutdown, typically by sending SIGKILL to the QEMU process.
When provisioning with Vagrant, which command is best used to apply changes to a configuration (like adding a new shell script) without destroying the existing virtual machine?
This applies provisioners to an existing VM.
Why this answer
'vagrant provision' triggers the configured provisioners (shell, ansible, etc.) on a running VM without destroying it.
You want to limit the bandwidth of a virtual network interface. Which XML element within <interface> allows you to configure this?
Correct syntax for bandwidth limiting.
Why this answer
The <bandwidth> element allows setting inbound and outbound throughput limits.
In a Vagrant environment, where should sensitive data like API keys be stored to avoid committing them to version control?
This keeps secrets out of the repository.
Why this answer
The 'vagrant-env' plugin or simply using local environment variables are common, but the best practice is to load variables from a file excluded by git, such as '.env' or a separate file.
Which TWO of the following commands can be used to monitor VM resource utilization?
Provides statistics on a domain.
Why this answer
virsh domstats and top (or virt-top) are used for monitoring.
You are configuring LXC and want to set a CPU limit for a container. Which cgroup parameter is used to specify the quota of CPU time in microseconds?
This defines the hard CPU limit in microseconds.
Why this answer
lxc.cgroup.cpu.cfs_quota_us defines the number of microseconds the container can run in a period.
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?
Virtio is a paravirtualized driver providing near-native disk performance.
Why this answer
Virtio is the paravirtualized driver standard for high-performance I/O in libvirt/KVM environments.
Which THREE networking modes are natively supported by Docker?
Default for standalone containers.
Why this answer
Bridge, host, and none are standard Docker network drivers.
Which THREE features are provided by Linux Namespaces in the context of containers?
Separates process trees.
Why this answer
Namespaces provide isolation for Process IDs, Networking, and Mount points.
Which THREE settings are commonly configured in the 'provider' block of a Vagrantfile for virtualbox?
Toggles the virtual monitor window.
Why this answer
The 'provider' block for VirtualBox allows setting memory, CPU count, and enabling GUI mode.
Which kernel feature provides the isolation necessary for namespaces in container virtualization?
Namespaces are the primary mechanism for process isolation.
Why this answer
Namespaces are a Linux kernel feature that partition kernel resources, such as PID, network, and mount points.
When using Vagrant to manage a libvirt-based provider, which command verifies that the virtual machine is currently running and identifies the provider in use?
This displays the status and the provider.
Why this answer
'vagrant status' provides the current state of the machine and the provider used for that specific instance.
Which THREE of the following are valid components of a libvirt domain XML configuration?
Contains boot configuration.
Why this answer
<os>, <devices>, and <cpu> are standard top-level or child blocks in the domain XML.
What does the 'docker rm' command do?
Correct for container removal.
Why this answer
'docker rm' deletes one or more stopped containers.
Which hypervisor type is considered 'Type 1' virtualization?
Xen is a Type 1 bare-metal hypervisor.
Why this answer
Type 1 hypervisors (bare metal) run directly on the hardware, such as Xen.
A Docker container is failing to connect to an external database despite the host being able to ping it. You suspect a bridge networking issue. Which command allows you to inspect the current NAT rules created by Docker?
Docker adds rules to the NAT table for port forwarding and masquerading.
Why this answer
Docker manages iptables rules for container networking.
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?
Each interface needs a unique MAC.
Why this answer
You define a new <interface> block with a unique <mac address='...'/>.
Which file is primarily responsible for defining the configuration and environment variables for an OpenVZ container?
The CTID.conf file contains all parameters for the specific container ID.
Why this answer
In OpenVZ, containers are managed via configuration files located in /etc/vz/conf/.
Which THREE of the following are valid options for 'virsh shutdown'?
Sends ACPI power signal.
Why this answer
The --mode flag can accept 'acpi', 'agent', and 'initctl'.
You are using systemd-nspawn. How do you create an image of a container to be used as a template?
This exports the container to a tar archive.
Why this answer
'machinectl export-tar' is used to export a systemd-nspawn container (machine) to a tarball.
What is the purpose of the virtio-balloon driver in a guest?
It facilitates host-guest memory management.
Why this answer
The balloon driver allows the host to communicate with the guest for memory reclaiming.
You need to ensure that a specific package is installed during the first boot of a cloud instance. Which cloud-init key should be added to the configuration?
This is the correct configuration key.
Why this answer
The 'packages' list under cloud-init config allows specifying a list of packages to be installed by the system package manager.
Which command is used to display the configuration of a Packer build in a readable format?
This displays template details.
Why this answer
'packer inspect' is used to view information about a template, including variables and provisioners.
What is the primary function of a Docker Registry?
Registries act as a central repository for images.
Why this answer
A registry stores and distributes Docker images.
When configuring cloud-init 'network-config', which format is primarily used to describe network interfaces?
YAML is the standard configuration format.
Why this answer
Cloud-init uses the 'network-config' key, often structured using the 'v1' (YAML) or 'v2' (Netplan) format.
What is the purpose of 'virt-top'?
It monitors VM resource usage.
Why this answer
virt-top is a utility similar to 'top' that shows performance statistics for virtual machines.
This bridges the VM to the external network.
Why this answer
The 'public_network' mode bridges the VM's interface to the host's physical network interface, allowing it to act like a physical machine on that segment.
Which file in a Vagrant project directory is processed by default to define the virtual environment configuration?
This is the required configuration filename.
Why this answer
Vagrant looks for a file named 'Vagrantfile' in the directory where the 'vagrant' command is executed.
Which TWO of the following are valid ways to configure VM networking?
Standard mode.
Why this answer
Bridging and NAT are both native libvirt network configuration methods.
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?
Isolated mode restricts traffic to the local virtual bridge only.
Why this answer
The 'isolated' network mode (often implemented as a bridge without an uplink to the host's physical interface) prevents external traffic.
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?
This is the correct command-line argument for virtio-9p filesystem passthrough.
Why this answer
The virtio-9p-pci device allows for high-performance filesystem passthrough between the host and guest in QEMU.
When using systemd-nspawn, you want to limit the memory usage of a container to 512MB. Which flag should be passed to the systemd-nspawn command?
This flag correctly limits the container memory usage.
Why this answer
systemd-nspawn uses the --memory-limit flag to restrict the memory consumption of the spawned container.
When using 'docker-compose', which file format is used to define the services?
Compose files are written in YAML.
Why this answer
Docker Compose uses YAML files.
When using Docker volumes, which type of mount should you use if you want the data to persist on the host filesystem at a specific, user-defined path?
This allows mounting a specific host directory.
Why this answer
Bind mounts allow mapping a specific host path to a container path, providing persistence at a known location.
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?
This correctly maps the backend tap device to the virtio frontend.
Why this answer
The -netdev tap,id=net0,ifname=tap0 argument defines the backend, and -device virtio-net-pci,netdev=net0 defines the frontend.
What is the purpose of the 'virsh' tool?
virsh is the primary management CLI.
Why this answer
virsh is the main command-line interface for managing libvirt-based virtualization.
Which THREE configuration items can be managed via cloud-init 'write_files' module?
The absolute path to the file.
Why this answer
The 'write_files' module allows defining content, file permissions, and target paths for arbitrary files.
In a Vagrantfile, which method is used to pass environment variables into the guest virtual machine during the provisioning phase?
This is the correct syntax for passing environment variables.
Why this answer
The 'config.vm.provision "shell"' block accepts an 'env' hash to define environment variables for the shell script.
You are troubleshooting a container networking issue. You notice that traffic from the container is not being SNATed. What should you check in the iptables rules?
MASQUERADE rules are added here to handle SNAT.
Why this answer
The POSTROUTING chain in the nat table is responsible for MASQUERADE rules used for SNAT.
Which command is used to remove an unused Docker image?
This removes images.
Why this answer
'docker rmi' is the command to remove an image.
Which TWO of the following are valid container orchestration platforms?
The industry standard orchestrator.
Why this answer
Kubernetes and HashiCorp Nomad are widely used orchestration platforms.
Which TWO commands are used to manage images in Docker?
Labels an image.
Why this answer
'docker build' creates images, and 'docker tag' renames/labels them.
Which THREE of the following attributes can be defined within the <memoryBacking> XML block?
Enables hugepages.
Why this answer
hugepages, locked, and source (type) are all valid components of memory backing.
Which THREE storage drivers are supported by Docker?
Older, block-device-based driver.
Why this answer
Overlay2, devicemapper, and aufs are well-known Docker storage drivers.
What is the main advantage of using a container over a virtual machine?
Shared kernel enables efficiency.
Why this answer
Containers share the host kernel, making them significantly lighter and faster to start than VMs.
You need to inspect the metadata of a specific Docker image without pulling it from a remote registry. Which command should you use?
This retrieves metadata directly from the registry.
Why this answer
docker manifest inspect allows retrieving information about an image's manifest without downloading the layers.
You are debugging a Docker image buildup that fails at the 'RUN' instruction due to missing network access during the build. What command option should be checked if the build environment uses a proxy?
Passes environment variables to the docker build process.
Why this answer
Docker builds do not automatically inherit environment variables from the host's shell unless specified via --build-arg.
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?
This flag forces the migration of all local storage associated with the domain.
Why this answer
The --copy-storage-all flag in 'virsh migrate' instructs libvirt to copy all non-shared disk images to the destination host.
You are using BSD Jails and need to start a jail. Which utility is the standard management tool for jail administration?
The jail command is the base utility for jail management.
Why this answer
jail is the command to create or start a jail, and jailctl is also sometimes used in managed environments, but jexec is used for executing commands inside.
Page 1 of 3
Page 2Practice 305-300 by domain
Target a specific domain to shore up weak areas.
See all domains with question counts →