The exam mode
Translated from the French version, which is authoritative.
In exam mode, Marionnet records what the student did on their virtual machines and archives it in the project file, which thereby becomes their exam copy; it also forbids the operations that would lose this copy before it is archived. The mode is designed for projects whose machines run Debian 13 (trixie): with the older images, and with routers, part of the copy is missing (see § 5).
1. How an exam goes
You give the students the exam statement, for instance as a PDF, and, if you wish, a starting
project, that is a .mar file which already holds part of the network.
Each student must start Marionnet with the --exam option:
marionnet --exam
The window is then titled Marionnet (EXAM); apart from that, the student works as usual. There
are two cases:
- without a starting project, the student creates a new project from the Project › New menu,
and Marionnet immediately asks for the name of the
.marfile; - with a starting project, the student opens it from the Project › Open menu. Note that this file must be writable, since it is the one that will receive the copy: each student must therefore have their own copy of the file you provide (in their home directory, for instance), not a file shared read-only, which the Open dialog would refuse anyway.
In both cases, the machines must run Debian 13, which is chosen in the Distribution field of a
machine’s Add dialog (a debian-trixie image), and checked in the Modify dialog of an
existing machine: remember to say so in the statement if the students create their machines
themselves.
At the end of the exam, the student quits Marionnet from the Project › Quit menu or with the
window’s close button. In exam mode, Marionnet then shuts every machine down gracefully, waits
until they are actually down, and saves the project without asking anything, which may take a
few seconds. The student finally hands you their .mar file, which holds the complete copy;
Marionnet offers no way of collecting the files, so you will use the one of your lab room (a shared
drop folder, a USB stick or your learning platform, for instance).
2. What --exam forbids
The copy is archived into the project when each machine is shut down gracefully; a power cut, on the other hand, loses it. In exam mode, the operations that would put the copy at risk are therefore forbidden:
| Operation | With --exam |
|---|---|
| Power-off on a component, the Power-off all button | forbidden: the button is greyed out, and its tooltip gives the reason |
| Quit, the window’s close button, Close, New, Open | no question asked: Marionnet shuts the machines down gracefully, waits until they are down, then saves the project; the student thus cannot lose their copy by answering “no” out of habit |
| Remove a component which has already been started | forbidden, since it would take the component’s disks and documents with it; a component which has never been started can still be removed, so that the student can fix a construction mistake |
The Options menu shows this last restriction as a checked, greyed-out item, Exam mode: forbid removing components which have run; a student who finds the Remove submenu empty thus understands that the tool is refusing the operation, rather than suspecting a malfunction. If you prepare a starting project yourself in exam mode, you can lift this restriction:
marionnet --exam --exam-allow-delete
Suggestion: launcher icons in the lab room
Rather than having these commands typed, you can ask the administrator of the lab room to add, on
each workstation, an icon which starts Marionnet in exam mode, and possibly a second one, on your
own workstation, for the exam mode with removal allowed. Marionnet itself ships the exam icon, in
the share/marionnet/images/launcher-icons/ subdirectory of its installation (for instance
/usr/local/share/marionnet/images/launcher-icons/marionnet-exam-launcher.png). On GNU/Linux, all
it takes is a small text file, placed in /usr/share/applications/ (for every user of the
workstation) or in ~/.local/share/applications/ (for a single user), for instance
marionnet-exam.desktop:
[Desktop Entry]
Type=Application
Name=Marionnet (exam)
Exec=marionnet --exam
Icon=/usr/local/share/marionnet/images/launcher-icons/marionnet-exam-launcher.png
Terminal=false
Categories=Education;
The second icon differs from the first only by its name and its command:
Exec=marionnet --exam --exam-allow-delete.
3. Marking the copies
Open a student’s .mar file in Marionnet, without the --exam option. In the Documents
tab, each machine and each router has left up to four documents: Report on …, History of …,
Console of … and Terminal of …. A document opens with a double click, and reports are
displayed, formatted, in your browser.
What the four documents contain
| Document | Written by | Content |
|---|---|---|
| Report | the virtual machine, when it shuts down | the final state of the machine: interfaces, link layer, routing tables (IPv4 and IPv6), ARP neighbours, packet forwarding, name resolution, persistent configuration, firewall (iptables, ip6tables, nftables), listening sockets, failed services, processes and mounts |
| History | the virtual machine, as the session goes | every command typed, each one preceded by its date |
| Console | Marionnet, on the host | the console of the virtual machine, in other words the messages of its kernel and of its init, from the first line on |
| Terminal | Marionnet, on the host | the recording of the terminal, that is the commands and their output, as the student saw them |
Each section of the report reproduces the output of the command which produced it. If a command
is missing on the machine (iptables on a minimal image, for instance), the report says so,
instead of leaving the section empty.
Annotating a report
A right click on a document, then Show and edit the source of this document, opens its source
in an editor, and the OK button saves the change into the project. This is reserved for
marking: during the exam, that is with a Marionnet started with --exam, the source opens
read-only (Show the source of this document), so that the student cannot touch up their copy
from the interface.
Which documents to rely on when marking
The report and the history are written by the virtual machine itself, in a directory the student is allowed to write to: a well-informed student could therefore modify them, and the mark must not rest on them alone.
The console and the terminal, on the other hand, are written by Marionnet on the host, out of the virtual machine’s reach. Since the terminal holds the commands together with their output, it is the document on which marking can safely rely.
4. Two options related to --exam
The two recordings made by Marionnet, of the console and of the terminal, can also be turned on separately, without the exam mode, for instance for a demonstration or to track down a bug:
marionnet --console-log # records the console of each machine
marionnet --terminal-log # records the terminal of each machine
The --exam option turns on both recordings, and adds to them the archiving of the documents into
the project as well as the restrictions of § 2.
5. Limits
- Older images produce no report. They predate systemd (they boot according to the SysV model) and have no real shutdown sequence, so the script which writes the report never runs. Their history, console and terminal, on the other hand, are recorded.
- Routers produce no report either. The only router image shipped today dates from 2014 and is also a SysV one: a router archives its history, its console and its terminal, but no report. To judge its configuration, rely on these three documents, or on the report of the neighbouring machines (their routes, their ARP neighbours).
- A machine shut down within the very first seconds of its boot has no report. Such a machine has, in fact, served no purpose, and its history is empty.
Technical details: how reports are displayed
Reports are written in Markdown and displayed in the browser Marionnet is configured to use
(MARIONNET_HTML_READER, xdg-open by default). The conversion to HTML is done by Marionnet
itself, not by a converter installed on the host: the page displayed is therefore the same
everywhere, on the student’s machine, on yours, and on the machine of whoever opens the archive
later.
Moreover, this page is not written to any file: Marionnet serves it on 127.0.0.1, at an
unguessable address, for the time (a minute or two) the browser needs to fetch it. This is what
makes it work with a browser installed as a snap or a flatpak, which, being confined, would not
see a file left in /tmp. In return, a tab reloaded long afterwards shows an error: just open the
document again.
Since the report is written on a machine the student controls, any HTML it may contain is not passed to the browser: it is removed, and the page marks in red the place where it was. In other words, nothing written in a report can run in the page you are reading; the removed text remains visible in the source, though.
If you prefer another converter (pandoc, for instance, for a richer rendering), give its command
in the MARIONNET_MARKDOWN_TO_HTML variable, in marionnet.conf or in the environment; it receives
the Markdown on its standard input. You then give up the two guarantees above, and Marionnet falls
back on its own conversion if the command is missing, fails, or produces nothing.
