Running Linux as a virtualization guest
Running Linux as a guest: how a virtual machine differs from a container, what has to be made unique when a system image is cloned, and what cloud-init is for.
Lesson 6 of 6 in objective 102. Linux installation and package management, part of LPIC-1 Exam 101-500.
Virtual machines and containers are not the same isolation
A virtual machine runs its own kernel on virtualized hardware, so it can be a completely different operating system from its host, and it pays for that with the overhead of a second kernel and a full boot. A container shares the host kernel and is isolated by namespaces and cgroups, so it starts in milliseconds and cannot run a different kernel or a different operating system family. Guest drivers — virtio disks and network cards, or the vendor's guest additions — exist to give a virtual machine near-native speed by letting it talk to the hypervisor directly rather than pretending to drive emulated hardware.
Guest integration comes in two layers that are easy to run together, and separating them is what the question is for. Paravirtualized drivers move DATA: virtio disks and network cards, and their equivalents on other platforms. A guest AGENT takes ORDERS — it is a daemon inside the guest listening on a channel to the hypervisor, and it does the things no driver can: accepting a request to shut down cleanly rather than having the virtual power cord pulled, freezing and then thawing the filesystems so a snapshot is taken at a consistent moment, and reporting the guest's addresses back to the host. Each platform ships its own: qemu-guest-agent for QEMU and KVM, open-vm-tools for VMware, hyperv-daemons for Hyper-V. Without one the host can still stop the machine; it simply cannot ask.
What must be unique after cloning
Cloning a prepared system image is the normal way to create guests, and the things that must not be duplicated are the ones the exam asks about. SSH host keys in /etc/ssh must be regenerated, or every clone presents the same identity and a client cannot tell them apart. The D-Bus machine id in /etc/machine-id must be reset, since systemd and the journal key on it. Network configuration must not pin a MAC address or a static IP inherited from the template, and the hostname has to be set.
cloud-init is the standard mechanism for doing exactly that at first boot: it reads metadata supplied by the cloud platform — hostname, SSH keys, users, an arbitrary user-data script — and applies it before the machine is handed over. That is why an image can be generic and the instance made from it specific.
Worth carrying in
- virtio
- Paravirtualized disk and network drivers; the guest talks to the hypervisor directly.
- /etc/machine-id
- The D-Bus machine id. Must be regenerated on a clone.
- SSH host keys
- In
/etc/ssh. Duplicated across clones means duplicated identity. - cloud-init
- Applies platform metadata — hostname, keys, users, user-data — at first boot.
- container
- Shares the host kernel; isolated by namespaces and cgroups.
- qemu-guest-agent
- The guest agent for QEMU and KVM: graceful shutdown, filesystem freeze for snapshots.
open-vm-toolson VMware.
What the exam does with this
- The cloning question is nearly always about SSH host keys or the machine id. Both must be unique per instance.
- A container cannot run a different kernel from its host. A virtual machine can.
- A paravirtualized driver moves data; a guest agent takes orders. Graceful shutdown and a consistent snapshot are the agent —
qemu-guest-agenton KVM,open-vm-toolson VMware.
- Objective
- 102. Linux installation and package management
- Share of the exam
- 18.33% (the whole objective)
- Questions in this lesson
- 6
- Signed for by a person
- 0
Partly checked. None of the 6 questions here has been read against the cited source by a person. 6 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
Drill this lesson
A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.
Practise Running Linux as a virtualization guest
Questions in this lesson
- You cloned a running Linux virtual machine from a template image and booted the copy on the same network alongside the original. Both machines keep their own virtual disks. Which TWO host-specific identifiers should be regenerated on the clone so that the two running systems do not conflict with each other on the network? machine-checked
- Which statement correctly distinguishes a container from a full virtual machine on Linux? machine-checked
- On a Linux guest running under KVM, the root disk appears as /dev/vda rather than /dev/sda, and lsmod shows virtio_blk loaded. What does this indicate? machine-checked
- Which TWO statements correctly describe how an application container differs from a system container on Linux? machine-checked
- Type the name of the tool, with no options, that runs during the first boot of a cloud instance and applies the data supplied by the platform, such as the hostname, the authorized SSH public keys and the user data script. machine-checked
- Your virtualization platform must be able to shut a KVM guest down gracefully from the hypervisor and to freeze the guest's filesystems briefly so a snapshot is consistent. Which component, installed inside the guest, provides that integration? machine-checked
Practise Running Linux as a virtualization guest
The rest of objective 102
- Planning a disk layout
- Installing and configuring a boot manager
- Shared libraries and the dynamic linker
- Debian package management
- RPM and DNF package management, and virtual guests
- Running Linux as a virtualization guest — you are here