Free LPI LPIC-3 305-300 practice questions

10 free LPI LPIC-3 305-300 practice questions with the correct answer and a full explanation for each, taken from the CertStash pack of 55 questions. Work through them, then open each answer to check your reasoning.

Question 1

What is the purpose of the command vagrant init?

  1. It executes a provisioning tool in a running box.
  2. It starts a Vagrant box.
  3. It creates a Vagrant configuration file.
  4. It installs Vagrant on a Linux host.
  5. It downloads a Vagrant box.
Show answer and explanation

Correct answer: C. It creates a Vagrant configuration file.

The vagrant init command creates a Vagrantfile, which is the configuration file that defines how a Vagrant environment should be set up. This file specifies the box to use, provider settings, networking, and provisioning instructions. It is the first step in setting up a new Vagrant project.

Why the other options are wrong

  • A. Provisioning is performed by vagrant provision, not vagrant init.
  • B. Starting a box is done with vagrant up, not vagrant init.
  • D. Vagrant is installed on the host system beforehand, not via vagrant init.
  • E. Downloading a box happens during vagrant up or with vagrant box add, not vagrant init.

Question 2

In order to use the option dom0_mem to limit the amount of memory assigned to the Xen Domain-0, where must this option be specified?

  1. In the bootloader configuration, when Xen is booted.
  2. In any of Xen’s global configuration files.
  3. In its .config file, when the Domain-0 kernel is built.
  4. In the configuration file /etc/xen/Domain-0.cfg, when Xen starts.
  5. In its Makefile, when Xen is built.
Show answer and explanation

Correct answer: A. In the bootloader configuration, when Xen is booted.

The dom0_mem parameter is a Xen hypervisor parameter that must be passed to the hypervisor at boot time. This is specified in the bootloader configuration (such as GRUB) so that the parameter is available when Xen starts and can allocate the specified amount of memory to Domain-0 before any domains are created.

Why the other options are wrong

  • B. Xen's global configuration files cannot pass parameters to the hypervisor at boot time.
  • C. The Domain-0 kernel's .config file controls kernel features, not hypervisor memory allocation.
  • D. Domain-0.cfg is used for Domain-0 virtual machine configuration, not hypervisor initialization parameters.
  • E. The Xen build Makefile controls compilation but not runtime hypervisor parameters.

Question 3

What is the default provider of Vagrant?

  1. lxc
  2. hyperv
  3. virtualbox
  4. vmware_workstation
  5. docker
Show answer and explanation

Correct answer: C. virtualbox

VirtualBox is the default provider for Vagrant. When a Vagrant configuration does not explicitly specify a provider, Vagrant will use VirtualBox to create and manage virtual machines. VirtualBox is widely available across different operating systems and requires no additional licensing.

Why the other options are wrong

  • A. LXC is a container provider, not the default.
  • B. Hyper-V is a Windows-specific provider and not the default across platforms.
  • D. VMware Workstation is a commercial provider that must be explicitly configured.
  • E. Docker is a container provider that must be explicitly specified as the provider.

Question 4

In an IaaS cloud, what is a common method for provisioning new computing instances with an operating system and software?

  1. Each new instance is connected to the installation media of a Linux distribution and provides access to the installer by logging in via SSH.
  2. Each new instance is created based on an image file that contains the operating system as well as software and default configuration for a given purpose.
  3. Each new instance is a clone of another currently running instance that includes all the software, data and state of the original instance.
  4. Each new instance is connected via a VPN with the computer that started the provisioning and tries to PXE boot from that machine.
  5. Each new instance contains a minimal live system running from a virtual CD as the basis from which the administrator deploys the target operating system.
Show answer and explanation

Correct answer: B. Each new instance is created based on an image file that contains the operating system as well as software and default configuration for a given purpose.

The standard method for provisioning IaaS instances is to create them from pre-built image files (sometimes called machine images, AMIs, or templates) that contain a complete operating system, software stack, and default configurations. This approach is fast, reproducible, and scalable. Users simply instantiate new instances from these images rather than installing from scratch.

Why the other options are wrong

  • A. Connecting new instances to installation media and using SSH-based installers is inefficient and not the common practice in IaaS.
  • C. Cloning a running instance including its state is not standard provisioning; it captures a specific point in time.
  • D. PXE booting from a remote provisioning machine is cumbersome and not typical for IaaS cloud providers.
  • E. Using a minimal live system as a basis and then deploying the OS is a more manual approach than using pre-built images.

Question 5

Which command within virsh lists the virtual machines that are running on the current host?

  1. view
  2. list-vm
  3. list
  4. show
  5. list-all
Show answer and explanation

Correct answer: C. list

The virsh list command displays the virtual machines currently running on the host. By default, it shows only running VMs, though the –all flag can be used to display all VMs including inactive ones. This is the standard command for viewing the status of virtual machines managed by libvirt.

Why the other options are wrong

  • A. view is not a valid virsh command.
  • B. list-vm is not the correct virsh syntax; the command is simply list.
  • D. show is used to display configuration details of a specific domain, not to list all VMs.
  • E. list-all is not the correct syntax; use list –all instead.

Question 6

What is the purpose of cloud-init?

  1. Replace common Linux init systems, such as systemd or SysV init.
  2. Assign an IaaS instance to a specific computing node within a cloud.
  3. Standardize the configuration of infrastructure services, such as load balancers or virtual firewalls in a cloud.
  4. Orchestrate the creation and start of multiple related IaaS instances.
  5. Prepare the generic image of an IaaS instance to fit a specific instance’s configuration.
Show answer and explanation

Correct answer: E. Prepare the generic image of an IaaS instance to fit a specific instance’s configuration.

cloud-init is a tool used during IaaS instance initialization to customize a generic cloud image to match the specific requirements of a particular instance. It handles tasks such as setting hostname, configuring network interfaces, installing packages, running scripts, and applying user-provided configuration. This allows a single generic image to be deployed across many instances with different configurations.

Why the other options are wrong

  • A. cloud-init does not replace init systems; it runs early in the boot process alongside them.
  • B. cloud-init does not assign instances to specific computing nodes; that is handled by the cloud orchestration layer.
  • C. cloud-init is instance-level configuration, not infrastructure-wide service standardization.
  • D. Orchestrating multiple related instances is the role of orchestration tools like Terraform or CloudFormation, not cloud-init.

Question 7

What is the purpose of the packer inspect subcommand?

  1. Retrieve files from an existing Packer image.
  2. Execute commands within a running instance of a Packer image.
  3. List the artifacts created during the build process of a Packer image.
  4. Show usage statistics of a Packer image.
  5. Display an overview of the configuration contained in a Packer template.
Show answer and explanation

Correct answer: E. Display an overview of the configuration contained in a Packer template.

The packer inspect command reads a Packer template file and displays an overview of its configuration, including the variables, builders, provisioners, and post-processors defined in the template. This is useful for understanding what a template does before executing it.

Why the other options are wrong

  • A. Retrieving files from a built image would require different tools, not the inspect subcommand.
  • B. Executing commands within a running instance is not the purpose of inspect; that is handled by provisioners during the build.
  • C. Listing artifacts is related to the build output, not the purpose of the inspect subcommand.
  • D. Retrieve usage statistics is not a function of Packer's inspect command.

Question 8

What is the purpose of capabilities in the context of container virtualization?

  1. Map potentially dangerous system calls to an emulation layer provided by the container virtualization.
  2. Restrict the disk space a container can consume.
  3. Enable memory deduplication to cache files which exist in multiple containers.
  4. Allow regular users to start containers with elevated permissions.
  5. Prevent processes from performing actions which might infringe the container.
Show answer and explanation

Correct answer: E. Prevent processes from performing actions which might infringe the container.

Capabilities in container virtualization are Linux kernel features that restrict what privileged operations a process can perform. They allow fine-grained control over elevated permissions by breaking down root's authority into discrete units, preventing processes from performing dangerous actions even if they run with elevated privileges. This is a core security mechanism for containers.

Why the other options are wrong

  • A. System call emulation is handled by seccomp or ptrace mechanisms, not capabilities.
  • B. Disk space restrictions are enforced by cgroups (storage limits), not capabilities.
  • C. Memory deduplication is a hypervisor or kernel memory management feature, unrelated to capabilities.
  • D. Capabilities restrict what elevated users can do; they don't grant regular users elevated permissions.

Question 9

Which directory is used by cloud-init to store status information and configuration information retrieved from external sources?

  1. /var/lib/cloud/
  2. /etc/cloud-init/cache/
  3. /proc/sys/cloud/
  4. /tmp/.cloud/
  5. /opt/cloud/var/
Show answer and explanation

Correct answer: A. /var/lib/cloud/

This includes instance metadata, configuration files processed during initialization, and status information about previous cloud-init executions.

Why the other options are wrong

  • B. /etc/cloud-init/cache/ is not the standard cloud-init storage location for runtime data.
  • C. /proc/sys/cloud/ does not exist; /proc is for kernel parameters, not cloud-init storage.
  • D. /tmp/.cloud/ is temporary and would not reliably persist cloud-init state across reboots.
  • E. /opt/cloud/var/ is not a standard cloud-init directory.

Question 10

How does Packer interact with system images?

  1. Packer has to be installed within the target image and is executed during the image’s first boot in order to execute preparation tasks.
  2. Packer installs a client within the image which has to be run periodically via cron in order to retrieve the latest template from the Packer server and apply it locally.
  3. Packer periodically connects through the network to the Packer daemons of all running Packer images in order to re-apply the whole template to the running instance.
  4. Packer downloads and extracts an image in order to make changes to the image’s file system, repack the modified image and upload it again.
  5. Packer creates an instance based on a source image, prepares the instance through a network connection and bundles the resulting instance as a new system image.
Show answer and explanation

Correct answer: E. Packer creates an instance based on a source image, prepares the instance through a network connection and bundles the resulting instance as a new system image.

Packer is an image building tool that creates instances from source images, applies configurations and customizations through provisioners (which connect via network to the running instance), and then captures the modified instance as a new system image. This process happens before deployment, not during runtime on the host system.

Why the other options are wrong

  • A. Packer executes preparation tasks during the build process, not during the image's first boot.
  • B. Packer does not install clients within images that periodically fetch updates from a Packer server.
  • C. Packer does not connect to running instances after they are deployed; it prepares images before deployment.
  • D. Packer uses provisioners and builders to configure instances, not by directly extracting and modifying file systems offline.

That was 10 of 55.

The full LPI LPIC-3 305-300 pack has all 55 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.

Get the full pack