4–8 Apr 2011
Uni Mainz, Institut fuer Physik
Europe/Berlin timezone

Laptops and virtual machines

Hands-on tutorials will be an important part of the school. Participants are expected to bring their own laptops with an X environment. Please let the organisers know (anacen@desy.de) if you urgently need a computer provided by Mainz University.

The software needed for the tutorials will be in the form of a Virtual Machine. A virtual machine is a simulated computer with a chosen operating system. For the practical sessions we will provide a virtual machine with the needed software pre-installed. To run a virtual machine you first need a program capable of doing this for you. For the school we have chosen the program VirtualBox.


Installing VirtualBox


* VirtualBox is available for various platforms here, including the most commonly used versions of Linux, Mac OS X and Windows. A detailed list of supported host operating systems can be found here.

* Download the appropriate package for your architecture and operating system. If you are running Windows or Mac OS X, install it as any other "point and click" software. Details on the installation for Linux are available here.

* Please install VirtualBox version 4.0 or later, or upgrade your existing installation.

 

Running the virtual machine in VirtualBox
 
Once you have the program VirtualBox running you can run the school's
virtual machine inside of VirtualBox. To do this, follow the
instructions below:
 
* Import the school's virtual machine
  - Make sure you have about 3 GB of free disk space
  - Download the statistics-school.ovf and statistics-school-disk1.vmdk files
    from  ftp://ftp.desy.de/pub/school/ into the same directory
  - You may verify the disk image's integrity by comparing its MD5 sum 
    to the one stored in statistics-school-disk1.md5 on the same ftp directory
  - Start VirtualBox
  - Click on `File', then on `Import Appliance'
  - Click on the `Choose' button and select the .ovf 
    file you just downloaded.
  - Click on `Next', then on `Finish'
  - Select the (statistics-school) virtual machine from the left panel of VirtualBox's main menu
  - Click on Network in the right panel.
  - In the `Adapter 1' tab, click on `Advanced'
  - Next to the mac address field click the green arrows symbol.
  - Observe that the mac address has changed value.
 
* Start the school's virtual machine and log in
  - Select the (statistics-school) virtual machine from the left panel of VirtualBox's main menu
  - Click the start button (green arrow)
  - Wait for the machine to complete start up
  - At the login manager ("Welcome to statistics-school"), first enter "stats-school" 
    as user name, then enter the password "hamburg0411"
  - When the virtual machine is starting, read the information about capturing of the mouse and the keyboard
 
At this point your machine is ready for the tutorials. You can improve
the integration of guest and host system by following the steps below,
but this is not required.
 
Improvements to the virtual machine (not mandatory)
 
Keyboard Mapping
 
* Use the command "setxkbmap de" in the VM terminal
   to change from the standard American keyboard layout to a German one
   (us gives American, es Spanish , pl Polish, se Swedish etc. )
 
 
Machine improvements: fullscreen, copy-paste, mouse integration
 
* Start the new virtual machine (VM) and log in
 
* Open a terminal window in the VM (eg. right-click on the background ->
  Applications -> Shells -> Bash)
  Do
  $ sudo apt-get update
  (here you have to reenter the password)
  $ sudo apt-get install linux-headers-2.6.28-19-generic build-essential
  (answer Y if asked to continue)
 
* In the VirtualBox window frame for your VM, select "Install Guest Additions" under the
  "Devices" menu. This will attach an image to the virtual CD-Rom drive.
  (To have the "Devices" menu visible, make sure the virtual machine window in VirtualBox is active.)
 
* In the VM's terminal window do
  $ mount /media/cdrom
  (Here you will have a warning message about read only, that's OK)
  $ sudo /media/cdrom/VBoxLinuxAdditions.run
 
* restart the guest machine now
 
* Some people seem to still have problems with screen sizes after the guest additions.
   You can start emacs with a fixed size using
   $ emacs -geometry 80x24
 
Access to the host filesystem
 
* create a new empty directory on the host, which will be shared with the guest system
 
* In the VirtualBox window frame for your VM, select "Shared Folders" under the "Devices" menu
    (to have the Devices menu visible, make sure the virtual machine window in VirtualBox is active)
  - click the add-button
  - enter the path of the empty directory you have created on the host machine in the "Folder Path",
  - Type "hosthome" in the "Folder Name", do not leave the default!
  - select "Make Permanent" and
  - click OK.
 
* In the VM's terminal window do
  $ sudo mount -t vboxsf -o uid=1000,gid=1000 hosthome /mnt
  Now you can access your files on your host machine inside the VM under
  the /mnt directory
 
* Every time you start the VM again, you need to re-run
  $ sudo mount -t vboxsf -o uid=1000,gid=1000 hosthome /mnt