Course / 02 Computers / Lesson 07 of 08

Snapshots, and how to undo a bad experiment

Estimated time: 15 min reading · 25 min activity

A baseline is a known starting state. To undo a later change, you need a snapshot of the state before that change. A snapshot taken afterwards records the changed state instead.

Restore means returning included VM state to a snapshot. Rollback describes undoing later changes in this way. This activity creates one folder in a disposable guest, then restores the earlier state. Restoration can also discard other later guest changes, so use a guest with no important work.

Without a guest, use the text walkthrough and predict the same folder states. Keep a paper prediction separate from a restore you actually observe.

Before you begin

Estimated time
15 min reading, 25 min activity. Setup and optional practice may take longer.
Where you work
Choose the text activity below, or work on your own computer with permission to install software. The installation route uses a compatible x86-64 host, VirtualBox and Ubuntu 24.04 LTS Desktop amd64. The VirtualBox 7.1 guide explains the interface; check current host support before choosing an installer. Use a new practice guest with no important files. Downloads and troubleshooting may take longer than the activity estimate. ARM, mobile and managed devices can use the text activity.
Without a lab
Read the cards on this page and write your predictions on paper or in a text editor. Downloads contain the same text and are optional. Use the activity steps to explain your reasoning before comparing it with the expected result. Answer checking needs JavaScript and a secure browser context (HTTPS or a local preview). Saving progress also needs usable browser storage. The text activity practices setup choices and restoration predictions. Installing a guest and observing a real restore can wait until you have a suitable computer. A browser shell or Windows Subsystem for Linux (WSL) is not the virtual machine used in this snapshot activity. Optional challenge: 10–15 minutes.

After this lesson you can:

  • Record a baseline before a harmless guest change.
  • Choose the appropriate snapshot from a timeline.
  • Explain what a restore changes and what it excludes.

01Example

This fictional example uses folder trial. B0 records the normal guest disk before trial exists; B1 records it after creation. No host folders are shared. Compare both possible restores before starting the separate activity.

Time 1: take B0; trial absent
Time 2: create guest folder trial
Time 3: take B1; trial present

Predicted restore B0: trial absent
Predicted restore B1: trial present
Host files: outside both snapshots

02Record what the baseline contains

Use a normal virtual disk with host sharing off, as in the installation lesson. Shut down Ubuntu before taking this activity's snapshot. A powered-off snapshot has no running editor memory to record. In the VM manager, Saved means suspended; it is not Powered Off. Resume a saved guest and shut it down normally if needed.

Write what should exist at the baseline and what should not. The empty lab folder will already exist; the later subfolder will not. This lets you distinguish a successful restore from opening a different folder.

If this guest contains work you need, stop and preserve it independently or use the text route. A snapshot restore can replace later changes throughout the included guest disk. Watching one harmless folder does not limit the operation to that folder.

03Try one harmless rollback

Use the following only in the disposable Ubuntu guest. The expected contents are predictions; record your own observations if you perform the activity.

Snapshot activity record
Expected states below are predictions, not recorded observations.
Use only a disposable guest with no important work and a normal disk.

Create the empty guest folder Documents/yanosec-snapshot-lab.
Shut down normally; take the powered-off snapshot lab-empty.
Start the guest; create after-baseline inside the lab folder.
Shut down normally; restore lab-empty; start and inspect the same folder.
Record actual contents before the change, after it and after restore.
Expected after restore: lab folder present; after-baseline absent.
Restore can discard other later guest changes too. Stop if work matters.

Separate question timeline:
S0: snapshot taken; guest note.txt does not exist.
Create guest note.txt.
S1: snapshot taken; guest note.txt exists.
Assume the snapshots include the normal guest disk.
Which snapshot records the state without note.txt?
Answer format: S0 or S1.

Download the snapshot activity and question timeline

  1. Start Ubuntu. Open Files, then Home > Documents. Use New Folder from the menu or Ctrl+Shift+N to create yanosec-snapshot-lab. If that name already exists, do not overwrite or remove it; use the text route or a new disposable guest. Open the new folder and record that it is empty.
  2. Shut down Ubuntu normally and confirm Powered Off in the manager. Select this VM, open Snapshots and choose Take. Name the snapshot lab-empty and describe the empty lab folder. Confirm the snapshot appears before making the next change.
  3. Start the guest. Open the same Documents/yanosec-snapshot-lab folder and create a subfolder named after-baseline. Record its presence. This is the only new folder change; no terminal command is needed.
  4. Shut down again and confirm Powered Off. Select lab-empty in Snapshots and choose Restore. Read the dialog before confirming. If current work might matter, cancel and preserve it first. If offered a snapshot of the current state, record whether you keep it; that saved later state is different from lab-empty.
  5. Start the guest and inspect the same lab folder. Expected: yanosec-snapshot-lab remains and after-baseline is absent. If your result differs, record the selected snapshot and exact folder before trying another action. Do not repeatedly restore to force a result.
  6. Shut down normally and keep the baseline for later practice. Do not manually remove virtual disk or snapshot files. Delete snapshot is a different operation from Restore; the activity needs no broad cleanup.

04Complete the no-install restore walkthrough

Read the walkthrough below. Draw three columns: before the change, after the change and after restoring lab-empty. Record whether the lab folder and after-baseline exist in each column. Add a row for a host file saved after the snapshot and explain whether the restore includes it.

Compare your prediction: the lab folder exists in all three states; after-baseline exists only after the change; the host file stays outside this guest restore. Explain which recorded state produces that result. Label installation and live restore deferred.

Restoring B0 predicts trial absent; B1 predicts it present. Host files remain outside both snapshots.Model. A teaching model drawn by hand. It shows the idea, not real tool output.

Read the full explanation below.

B0 at Time 1: trial absentB1 at Time 3: trial present

B0 records trial absent; that is the modeled restore result.

Host outside snapshots

Host filesOriginal: outside both snapshots; unchangedNow: outside both snapshots; unchangedunchanged

Guest normal disk

Guest folder trialOriginal: absentNow: absentabsent

B0 and B1 record different guest states; neither includes host files.

These are restore predictions, not an observed live restore.

B0 records trial absent; that is the modeled restore result.

Follow the explanation

  1. B0 records trial absent; that is the modeled restore result.
  2. B1 records trial present; selecting a different baseline changes the guest result.
  3. Host files stay outside either selected guest baseline.
Read every state and value

1. B0 records trial absent; that is the modeled restore result.

Example
b0
Items
Value: absent; Status: absent · Value: outside both snapshots; unchanged; Status: unchanged
Active Item
trial
Event Label
B0 records trial absent; that is the modeled restore result.
Visible Limit
B0 and B1 record different guest states; neither includes host files. · These are restore predictions, not an observed live restore.

2. B1 records trial present; selecting a different baseline changes the guest result.

Example
b1
Items
Value: present; Status: present · Value: outside both snapshots; unchanged; Status: unchanged
Active Item
trial
Event Label
B1 records trial present; selecting a different baseline changes the guest result.
Visible Limit
B0 and B1 record different guest states; neither includes host files. · These are restore predictions, not an observed live restore.

3. Host files stay outside either selected guest baseline.

Example
b1
Items
Value: present; Status: present · Value: outside both snapshots; unchanged; Status: unchanged
Active Item
host-files
Event Label
Host files stay outside either selected guest baseline.
Visible Limit
B0 and B1 record different guest states; neither includes host files. · These are restore predictions, not an observed live restore.
Restoring B0 predicts trial absent; B1 predicts it present. Host files remain outside both snapshots.
Powered-off restore: text walkthrough
Interface reference: Oracle VirtualBox 7.1 guide.
This is a conceptual sequence, not a record of clicks or screenshots.

Starting state: a disposable guest, one normal disk, no host sharing.
Guest Documents/yanosec-snapshot-lab exists and is empty.
1. Shut down Ubuntu normally. Manager state: Powered Off.
2. Select that VM. Open Snapshots; take snapshot lab-empty.
3. Start the guest. Create after-baseline inside the lab folder.
4. Shut down again. Select lab-empty in Snapshots and choose Restore.
5. Start the guest. Inspect the same Documents/yanosec-snapshot-lab.
Predicted contents: the original empty lab folder remains;
the later after-baseline subfolder is absent.

Paper activity: draw before-change, after-change and after-restore columns.
Fill in folder contents and explain each transition.
Add a host Downloads row, which is outside this operation.
Label live installation and restoration deferred.

Restore replaces the included state. Delete snapshot is a different action.
Never manually delete the files on which a VM or snapshot depends.

Download the text restore walkthrough

05Optional challenge

Suppose the host drive holding the guest and all snapshots fails. Explain why lab-empty alone cannot establish recovery. Describe where an independent backup would need to survive. Do not simulate failure or delete a VM.

06Fresh cases for the checks

Use these fictional cases for the checks below. They have different inputs from the worked examples. Read them here or make notes; no installation or external service is needed.

Snapshot card A: five recorded points in a fictional timelineOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.

All five snapshots include the same normal guest disk.
Each snapshot was taken after a normal shutdown; no running memory is included.
08:00 — Take H1. Guest Documents/review does not exist.
08:10 — Create Documents/review and its note.txt containing outline. Take H2.
08:20 — Change note.txt to checked and create review/draft. Take H3.
08:30 — Remove only review/draft. Take H4.
08:40 — Change note.txt to final. Take H5.
The folder and note remain unless an event explicitly changes them.
These are supplied snapshot records, not actions you need to perform.

Snapshot card B: an independent guest and shared-folder caseOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.

Powered-off snapshot P7 includes the normal guest disk.
At P7: guest Documents/answer.txt contains amber; guest Documents/scratch is absent.
At P7: host Shared/route.txt contains north.
Later: change the guest answer.txt to violet and create guest Documents/scratch.
Later: change host Shared/route.txt to south.
The guest can view Shared/route.txt through a shared folder.
That file stays on the host and is explicitly excluded from P7.
Now consider restoring P7 without any other file changes.
No restore or resulting folder inspection has been recorded.

Snapshot card C: an incomplete baseline noteOwned fixture. An original file made for this course. Follow the activity's instructions in your own lab.

Permission: this disposable guest is owned and allowed for the folder activity.
Storage: one normal guest disk; no host sharing; no important work is present.
Guest path: Documents/seed. The folder exists, but its contents were not recorded.
Manager observation: Powered Off after normal shutdown.
Planned snapshot label: before-test. The snapshot has not yet been taken.
Later planned change: create Documents/seed/tag.
The learner wants the baseline note to identify what a later restore should return.
Use this supplied record only; do not create or restore a real guest.

07Write a usable baseline note

Optional self-check: draft a short baseline note for card C. Include the exact guest path, contents you would need to inspect, the snapshot boundary, the normal shutdown and snapshot steps, and what you would inspect at the same path after restoring. Leave unobserved facts labelled unknown or predicted.

Check your note: establish whether the original folder and tag exist before the change; record the chosen snapshot with those contents; separate later guest changes from excluded host files; and distinguish an expected result from a recorded inspection. A restore can discard other later changes on the included disk. If work matters, preserve it independently or use the text route.

08Common mistakes

If after-baseline remains, first inspect the snapshot description and exact guest path. The baseline may have been taken after the change, another snapshot may have been restored, or a different location may be open. Record evidence before changing anything else.

If the manager shows Saved, resume the guest, save any needed work and shut down normally. Then follow the Powered Off steps.

If a shared host file did not change, compare its location with the snapshot boundary. The activity includes a normal guest disk, not shared host storage. Do not delete host files to imitate rollback.

If free host storage is low, stop and use the text walkthrough. Snapshots require real storage, and manually deleting their dependent files can break the VM.

If the menu differs, consult the Snapshots section for your installed version. Do not guess between Restore and Delete snapshot. You can continue with the paper timeline while resolving the interface difference.

References