CyberLab User Manual

Chapter 1 - Performing pre-built experiments

Copyright(c), 2014-5 Fred Cohen - All Rights Reserved

You will learn:

Quick Quiz: Try each of the items below to see how quick quizzes work.


How to start up internal VMs

virt-manager is the program that brings up a graphical user interface (GUI) for running internal virtual machines (VMs). To run it, type 'virt-manager' into the command prompt as follows:


Running virt-manager

This should produce a window the looks like this on the screen:


VM manager GUI

To turn a particular VM on, select it from the list of VMs and press the green arrow. It should look something like this:


Just before pressing the green arrow

Just after clicking the green arrow

After the machine is started up and running

To view the console for that machine, double click on the menu selection. It should look something like this:


The sub-VM console booting up

At the end of the bootup process, the inner-VM should look something like this:


The sub-VM console booting up

Quick Quiz: Pick from the selections below:

How to set the GUI "escape" key

To start the graphical user interface, you need to "enter" the VM by clicking the mouse in the VM's window (the display portion containing the console). But before you do that, you need to make sure you can get out after you get in. This is done by selecting the preferences menu item from the virt-manager GUI's "Edit" tab. Select "VM Details" from there. It should look something like this:


The virt-manager perferences panel

Notice that the current setting (in this example) for "Grab keys" is set at "Control_L+z". This is the left "Control" (or Ctrl) key on the keyboad held down while prssing the "z" (lower case z). By default, the setting is for the "Home" key, but many keyboards don't have such a key. If you enter the console of a virtual machine by clicking on the console window while a GUI is running, you will not be able to get out unless you have a usable setting. By clicking on the "Change" selector next to the "Grab keys:", you can set the keys to be used.


The virt-manager "Configure grab-key" interface

In using this interface, you have to hold all of the keys down WHILE pressing the mouse to use those keys. If you don't, you may end up accepting no keypress as the exit sequence, or perhaps just the Ctrl or a similar key, and this may crash the interface and make it unusable until you reboot the virtual machine.

How to reboot the virtual machine

To reboot the VM (not the inner VMs which are rebooted using the virt-manager interface) from the secure shell window used to login to the VM, you need to (1) become "root" (the superuser) on the VM, (2) tell it to "reboot now". Becoming root is done by the "sudo" command (you have to enter the password you used for access). As you can see in the depiction, this will disconnect you from the VM while the VM reboots. You may have to try several times to get back in, as it takes a minute or three to reboot the VM before it can accept an external secure shell session. However, once you get back in, you will be where you started out in the first place - with a brand new VM containing nothing from your previous efforts.


A reboot sequence for your VM

Naturally, you will only want to reboot as a last resort because that will lose your work, so perhaps its best to try it out when you first use the CyberLab but to avoid it unless absolutely necessary from then on.

Quick Quiz: Pick from the selections below:

How to restart the VNC server without rebooting the VM

Before you reboot (after you do a reboot to learn how) you might want to try restarting the VNC graphical interface. To do so, first you need to "kill" the existing VNC session, then start a new one. Here's how:

At this point, you can reenter using your VNC connection program. Running programs like sub-VMs will still be running, but the virt-manager GUI will have to be restarted. Note that your VM session may be different than this one - use the proper one for your situation.


Reconnecting to the VNC once restarted

How to run X11 in a sub-VM

X11 is the graphical interface for sub-VMs (and for the VMs as well). It is started for you in the VM you use to access the CyberLab, but in the sub-VMs it is not, in part because you very often don't need it to do your work, and it takes time and memory to run it. To start the sub-VM GUI, from the "root>" prompt, you can type the lower case "x" followed by pressing the "Enter" key. If you use an upper case "X" instead of a lower case "x" the GUI will start up, but because there is no operating display manager, it will merely be an empty graphical screen with no way to control it.


After logging in as "root" in a sub-VM, use "x" to start the GUI

On

To get out of this mode, assuming you are stuck within the VM, you need to use the Grab-keys combination you previously set (or the "Home" by default) to get out of the inner-VM GUI. Then shut down and restart the inner-VM using the virt-manager "Power" control button (shown at right). By pressing the downward facing arrow and picking from the menu (Force Off), you will power down the inner VM currently selected in the virt-manager GUI. You can power it back up with the power on button at left, and of course, you will lose the retained state.


Off

Quick Quiz: Pick from the selections below:

How to run standard experiments

Most of the standard experiments are demonstrated in Webinars. The best way to do them is to watch the Webinar through once, then watch the specific parts where experiments are done more carefully.

However, it's probably best to (always) start the semester by doing the standard Lab 0. Lab 0 walks you through using the White Glove Linux platforms used in the sub-VMs and following that tutorial should get you used to all the things you will need for performing standard lab experiments. This is best accessed via http://courses.all.net/index.html where you can select from (usually best done in order):

Quick Quiz: Pick from the selections below:

How to shut down your experiments

The easiest way to shut down your experiments is to reboot the VM. This is described above. Of course you can simply leave them running and, at the end of your time slot, your VM will be shut down and restarted cleanly for the next user. If you just want to shut down the VMs you used in your experiments, you can do it by using the virt-manager interface:

Shut down the inner-VMs by using the virt-manager "Power" control button (shown at right). By pressing the downward facing arrow and picking from the menu (Force Off), you will power down the inner VM currently selected in the virt-manager GUI. If you like you can exit the virt-manager GUI as well.


Off

However, a reboot is cleaner and just about as fast...

How to logout from your ssh session

When you are done, you might want to logout of the server. This terminates your connection, but not the operaiton of the VM. You can come back later in your timeslot if you like. You will also have to do this if you change your IP address, by changing locaitons, WiFi routers, etc.

Note the way the connection ends. When you connect to the CyberLab, you are actually connecting to an Internet gateway (outer) machine (in this case cyberlabX.all.net), and from there to an internal "inner" machine (in this case with a non-routable IP address of 192.168.1.2), and from there to your virtual machine (in this case with another non-routable IP address of 192.168.2.51). All of this is transparent on login, but shown to you on logout. It may be of interest since it is a sort of "man-out-of-the-middle" attack...

Quick Quiz: Pick from the selections below:

Press here to go to the next section