Monash University · FACULTY OF COMPUTER SCIENCE

FIT2109 Chap.6 Virtual Machines, Containers and Packages

- one subject, every graph, every model, every mark
8 Chapters4-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 6 of 12 · FIT2109

Virtual Machines, Containers and Packages

Virtual Machines, Containers and Packages compares isolation boundaries and the ingredients of a reproducible runtime. A virtual machine includes a guest operating system above a hypervisor. A container packages an application and user-space dependencies while sharing the host kernel.

The appropriate choice depends on the required isolation and environment, not on a universal ranking.

Assignment 2 makes the runtime boundary concrete. Python packages needed by the application belong in runtime requirements, test-only tools remain separate, and external executables required by the program must be installed at the system layer.

A Dockerfile RUN instruction executes during the image build, while the default command is used when a container starts.

In this chapter

What this chapter covers

  • 01

    Virtual machines with a guest operating system

  • 02

    Containers sharing the host kernel

  • 03

    Image layers produced during the build

  • 04

    Build context and the files available to COPY

  • 05

    Runtime Python dependencies versus test tooling

  • 06

    System executables required by application behaviour

  • 07

    Layer ordering for correct and reusable builds

  • 08

    Command-matrix verification inside the built image

Worked example · free

Repair a runtime environment with a missing system tool

Q [7 marks]. A Python repository-inspection application imports correctly in its container but fails when it invokes Git. The image is based on a slim Python runtime and installs requirements.txt. Diagnose and verify the repair. The weighting for this exercise is not an official University mark allocation; AskSia provides it for environment-layer practice.
  • +1Preserve the exact failing command and repository input.
  • +1Use the executable-not-found diagnostic to distinguish a system tool from a Python import.
  • +1Confirm whether Git is present and reachable inside the image.
  • +1Install the required system package during image construction rather than adding an unrelated Python dependency.
  • +1Rebuild without relying on a cache that could hide the missing step.
  • +1Rerun the original command against the same repository.
  • +1Run every supported command and the complete test suite to establish the runtime contract.
The application has reached a system-level runtime dependency that the slim base image does not provide. Confirm the missing executable, install Git during the image build, rebuild and rerun the same failure. Then execute the complete supported command matrix in the image. A successful image build alone does not verify application behaviour.
Sia tip — Route the repair to the layer named by the evidence. Missing executable, missing Python import and missing mounted path are different environment faults.
Glossary

Key terms

Virtual machine
An isolated machine environment with a guest operating system above a hypervisor, including its own kernel and user space.
Container
An isolated process environment that packages an application and user-space dependencies while sharing the host kernel.
Container image
A built filesystem and configuration used to start containers. Its layers result from image-construction instructions.
Build context
The directory tree made available to an image build for instructions such as COPY. Ignore rules control what enters it.
Runtime dependency
A package or system tool required when the delivered application executes, rather than only during development or testing.
Layer cache
Reusable results from earlier image-build instructions. It speeds iteration but can hide an incomplete recipe during careless verification.
Clean build
An image construction performed without relying on inappropriate previous state, used to prove that the recipe itself creates the environment.
FAQ

Virtual Machines, Containers and Packages FAQ

What is the key difference between a virtual machine and a container?

A virtual machine includes a guest operating system above a hypervisor, while a container shares the host kernel and packages the application with its user-space dependencies. That boundary affects portability, isolation and overhead.

When does a Dockerfile RUN instruction execute?

It executes while the image is being built. Its filesystem result becomes part of an image layer and may be reused from cache. It is not rerun automatically every time a container starts.

Why should test tools be separate from runtime requirements?

The delivered application should install only what it needs to run. Test tools support development and verification but can enlarge or confuse the runtime dependency contract when the application never imports them.

How do I prove a container is complete?

Run every supported application command inside the built image against a known real repository, compare expected outputs and verify system executables, paths and runtime packages. Build success alone is not enough.

Study strategy

Assessment move

Draw the container and virtual-machine stacks until you can name the shared and isolated layers. Take a short Dockerfile and label every instruction as build-time or start-time, then state where it reads from and what persists. Build a tiny Python command that also invokes a system executable, and test it locally and inside a slim image.

Deliberately omit the system executable, observe the diagnostic and repair the correct layer. Create a clean virtual environment and identify direct runtime packages separately from test tooling. Rebuild the image after changing source and observe which layers can be reused, then perform a clean build to prove the recipe is complete. Finish with a command matrix listing every supported operation and its container result.

The core habit is to hold the input constant while locating the missing environment layer. Add a second failure by mounting the repository at an unexpected path. Compare its diagnostic with the missing-executable case and route the repair to filesystem context rather than package installation. Record the image identifier and exact run command for each check.

This protects the evidence chain from an old local tag or a remembered mount that is absent from the documented route.

Working through Virtual Machines, Containers and Packages in FIT2109? Sia is AskSia’s AI Computer Science tutor — ask any FIT2109 Virtual Machines, Containers and Packages question and get a clear, step-by-step explanation grounded in how FIT2109 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 167 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your FIT2109 tutor, unlimited, worked the way the exam marks it
The full 4-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works