Top link
First-year student being examined on her ability to load cards in a card reader. The invigilator stands behind her.
First-year student being examined on her ability to load cards in a card reader. The invigilator stands behind her.

VirtualExam (vx)
Files and locations

/home/virtualexam

File name and location Description
/home/virtualexam/etc/vx.conf

See vx.conf.

/home/virtualexam/etc/startup

Run by chroot from vxgaolsetup-userhome (see below) after being copied into the gaol's /etc directory, this script is the first thing which executes in the gaol environment. It does some setup and then runs /etc/startup-session (also copied in) via the setsid command (which creates a new session ID which is assigned to the script's process and all its child processes - which will include the X11 window manager and all the student's processes).

/home/virtualexam/etc/startup-session

Using a unique session ID (see above), this script starts the class exam account's /etc/startup-class script. This latter script should firstly do home directory setup, and then start the initial X11 processes and window manager which the student will use. When they exit, this present script uses the unique session ID, which will have been inherited by all the student's processes, to kill of the student's processes as the first step in gaol termination.

/home/virtualexam/bin/vxstart

Script executed from the class exam account to begin the process of creating and running the exam environment.

It first uses the $DISPLAY and X11 cookie saved by ~/.ssh/rc (see below) to create a .Xauthority file, and then runs vxuserlogin in an xterm to get the user's zID and authenticate their zPass.

Finally, it runs priv startexam to begin building (and then run) the chroot gaol.

/home/virtualexam/bin/priv.startexam

When you run priv startexam this is what actually runs.

It is executed directly by /usr/local/priv/startexam, no questions asked.

It authenticates the user/student via vxuserlogin and then runs vxgaolsetup to create and start the gaol.

/home/virtualexam/bin/priv.stuffexam

When you run priv stuffexam this is what actually runs.

It is executed directly by /usr/local/priv/stuffexam, no questions asked.

It gets a user/student zID and vx configuration file name from the command line, does some validation and checks, and then runs vxgaolsetup to insert additional file system objects into the given user's running virtual exam environment gaol.

See also stuffexam.

/home/virtualexam/bin/vxuserlogin

This script is run by priv.startexam in an xterm. It prompts the user for their zID and zPass and, if they check out OK, the zID and the user's UID are written into zid and uid in the class exam account's var directory (see below).

/home/virtualexam/bin/vxgaolsetup

Run by priv.startexam, this is a TCL script which reads in the vx.conf files and builds the gaol.

When run by priv.stuffexam, it inserts file system objects (hard links, directories, etc.) into a running virtual exam environment gaol.

See also stuffexam.

/home/virtualexam/bin/vxgaolsetup-userhome

Run by vxgaolsetup, this script does the user setup in the gaol — creates the user's home directory in the gaol, copies in some user files, sets up /etc/passwd and /etc/group, etc. — and then uses the chroot command to start the user session in the gaol via the /etc/startup (gaol-relative) script (see above).

/home/virtualexam/bin/list_gaols See Tools.
/home/virtualexam/bin/list_gaol_mounts See Tools.
/home/virtualexam/bin/delete_gaol See Tools.
/home/virtualexam/bin/delete_all_gaols See Tools.

Class exam account

File name and location Description
~/.ssh/rc

Script, executed by sshd before the account's shell is started, which harvests the session's $DISPLAY and X11 cookie and stores them in ~/var/<sessionid>/x (see below).

~/var

Because both priv and the idea of chroot gaols involve the idea of isolating things, and because on the same backed exam server multiple students may be sitting the same exam, it can be difficult to move bits of information around — like student zID's, X11 cookies, etc. — without mixing them up and without other students being exposed to them. For this reason, the ~/var directory in the class exam account is used to store things in a structure which uniquely identifies each student's exam session.

See also Identifying exam sessions.

~/var/<sessionid>/x

Created by ~/.ssh/rc. Line 1 contains the X11 cookie for the session. Line 2 is $DISPLAY.

~/var/<sessionid>/.Xauthority

Created in vxstart by xauth using the X11 cookie and $DISPLAY for the session.

~/var/<sessionid>/zid

zID of the authenticated user/student. Created by vxuserlogin.

~/var/<sessionid>/uid

Real UID of the student/user. Created by vxuserlogin.

In the following, it should be noted that currentexam can be a soft link.

~/currentexam/etc/vx.conf

and

~/currentexam/etc/vx.conf.d

See vx.conf.

~/currentexam/etc/autologin

Used for testing. See Operation and vxuserlogin.

~/currentexam/etc/startup

Copied into the gaol as /etc/startup-class, this script is the last thing run by the exam environment (see earlier on this page). It should do any home directory setup (files, directories, etc.) and then start the X11 environment (window manager, initial windows, etc.) so the student can start the exam.

~/currentexam/class

This directory is mapped into the exam environment as /home/class. It should probably contain supplementary materials for the student to use during the exam - source files, documents, sample data, etc.

~/currentexam/work

vxgaolsetup-userhomecreates a subdirectory here with the same name as the user's/student's zID (e.g. "z1234567"). This subdirectory is then mapped into /home in the gaol (with the same name) and is set as $HOME.

This directory should have the appropriate permission bits set so that any files created by the users/students will be group-owned by the class exam account to allow the student's work to be marked.

Local filesystem

File name and location Description
/var/gaol

This is where each user/student gaols are constructed. The top of each user's gaol is a subdirectory with the user's zID as its name.