15–19 Apr 2024
CERN
Europe/Zurich timezone

Geant4 Virtual Machine

Installing the Geant4 virtual machine

The Geant4 Virtual Machine provides a recent version of the Geant4 source code, examples and libraries; it includes a compiler and extra software such as a large set of visualisation libraries and analysis tools.  It provides a fully working Geant4 system.

It avoids the effort to find and install the key pieces needed to create an installation on your own system, which varies depending on the OS, its version and many other factors.

This is the only method that we will support for this course.

The following information is a summary of the key steps. Further guidance can be found at the CENBG home of the Geant4 Virtual Machine.

Step 1: Ensure that your machine can run the Geant4 Virtual Machine

Make sure that your computer meets the minimum requirements:

  • Windows or Linux users : desktop or laptop PC running Windows (preferably 10)
  • Linux: desktop or laptop PC with a recent Linux release (able to run VMware workstation for Linux)
  • Mac users : Mac with a recent version of macOS (capable of running the virtualization software below)
  • at least 30 GB of free disk space available
  • at least   4 GB of RAM available for the virtual machine on the PC or Mac - so likely a total of at least 6 or 8 GB installed.

Step 2: Obtain a Virtual Machine 'player'

There is a choice of Virtual machine host software. The following is what we recommend:

  • On Windows you can choose between VMware Player (free for non-commercial, personal and home use) or VMWare Workstation Pro.
  • On Linux the VM Workstation Player can be obtained for use and evaluation.
  • On macOS VMware Fusion has a download for evaluation, but is a commercial product (after the evaluation period of 30 days, a license must be purchased to keep using it).  You can also otherwise register for a free personal use license. Note that the versions we found to work are:
    • Fusion 13.5.1, the latest, supports macOS versions 12 Monterey and later (i.e. 14 Sonoma);
    • Fusion 12.2.5, supports macOS versions 11 Big Sur and later (i.e. 12 Monterey and 13 Ventura).
  • If you identify issues with the recommended software or versions, please inform us.

Step 3: Obtain the Geant4 virtual machine

Obtain the Virtual machine file which corresponds to your player, and uncompress it:

  • Download the  Geant4 Virtual Machine.  Note that the VM file is quite large (>18 GBytes), and may take a long time to download (will depend greatly on your network bandwidth). 
  • The file to download is located at: 
  • We recommend to start to download it few days before the course, to ensure that you can obtain it, and to familiarize yourself with it.
  • For more information about the Geant4 VM see https://geant4.cenbg.in2p3.fr.

Step 4: Uncompressing and starting the Virtual Machine

You need software which can un-compress '7z' files. There are many other choices, such as the popular (de-)compressor WinZip

For Windows such software is available at http://www.7-zip.org/

On macOS you can use the built-in Archive Utility.

On Linux there are several archivers available, as was documented in a article on Geek Stuff and on 7-zip.org 

Follow the instructions in the readme file for launching the VM.

  • Note that you may encounter issues on opening the VM file:
    • on PC, including Windows and some Linux systems, you will likely need to enable features needed for virtualisation in the BIOS. This is needed if you encounter a message such as "Intel Vtx is disabled...";
    • on macOS you may need to grant access to some resources to Fusion -- this may require a reboot.

Step 6: Locate the Geant4 installation and check it

  • The virtual machine will boot.
  • You should now obtain a (Linux) desktop, which is mostly empty.
    • Its menus can be found in the top left corner (icon and 'Activities').
    • It's keyboard is configured as French 'AZERTY'.  You can change this to US 'QWERTY' layout by changing the keyboard settings using "Settings" from the menu on the top right corner.
  • Open a Terminal window using the icon/"Activities":
    • Look for the rectangle with a silver border around a prompt (in this menu) and you use it to obtain a Terminal.
    • You should see a new window, ready to accept your commands
    • It is running the command shell 'tcsh'
  • Locate Geant4
    • The Geant4 installation is located under this path: 
      • echo $G4INSTALL
        • /usr/local/geant4.11.2.1
      • echo $G4EXAMPLES
        • /usr/local/geant4.11.2.1/share/Geant4/examples
      • ls $G4EXAMPLES
        • advanced/  basic/  CMakeLists.txt  extended/ .....
  • Build and run an example as an extra check
    • Please try to build the B1 example using the following commands:
cd
mkdir -p geant4/work/buildB1
cd       geant4/work/buildB1
cmake $G4EXAMPLES/basic/B1
make -j4
./exampleB1 exampleB1.in
./exampleB1   
  • DONE

We thank CENBG and CNRS for providing the Geant4 Virtual Machine, which is described in the article Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178, for updating it regularly and promptly with each production release and patch, and for their helpful collaboration.