How to install Cern Virtual Machine (CernVM) on your laptop

From LHCb Wiki
Jump to: navigation, search


Install a Virtual Machine on your laptop: CernVM

See talk by Pere Mato, slide 14: 17 March 2009

CernVM beginner's guide: CernVM beginner's guide


1) Download vmware player here

Unzip and put CernVM in fixed place. For example C:\Program Files\CernVM
Start vmplayer from desktop
Open CernVM from C:\Program Files\CernVM
Open in browser:
                 (your number might be different!)
Create account. For example: use lxplus username and password
Virtual organization: lhcb
Change memory allocation in vmware player
  -> troubleshoot
     -> change memory allocation
         -> 1024 MB

2) Create shared data folder on your laptop

Make folder C:\Data
Change properties of C:\Data
   -> sharing
     -> network sharing without wizard
       V share
          name: Data
       V allow 
Edit the 2kB VMware configuration file (in C:\Program Files\CernVM\ ) and add:

sharedFolder.maxNum = "1"

sharedFolder0.present = "TRUE"
sharedFolder0.enabled = "TRUE" 
sharedFolder0.readAccess = "TRUE"
sharedFolder0.writeAccess = "TRUE"
sharedFolder0.hostPath = "C:\Data"
sharedFolder0.guestName = "data"
sharedFolder0.expiration = "session"

usb.autoConnect.device1 = ""

NB: after editing the configuration file, restart VMware Player
In VMware:
  -> Share folders
     -> o always enabled
Add the following line to /etc/fstab:
sudo emacs -nw /etc/fstab
     .host:/ /mnt/hgfs vmhgfs defaults 0 0

sudo ln -s /usr/sbin/mount.vmhgfs /sbin

I edited and put input data location: /mnt/hgfs/data/Bs2DsK_1.dst )
Data can be found here:
(or ask Niels or Vanya for a copy...)

Starting CernVM

Start VMware Player (don't select 'Open', but 'Recent')

Login to your CernVM with your SSH.


I have succesfully tried using VirtualBox, from Sun Microsystems. It is free, it works. Follow more or less the instructions in the ATLAS CernVM wiki

Download and untar CernVM 1.20

Get the one for VirtualBox from here. Unzip and untar it. And figure out where in your file system it is. This will be the boot image "disk" for the operating system so VirtualBox will need it for booting. This must be done *before* the VirtualBox step.

Get and set up VirtualBox Install it following instructions run it and follow I went for ~1542MB memory as my laptop has 4GB.

Name:                 CernVM
OS Type:              Linux 2.6
Base Memory:          1532 MB
Video Memory:         6 MB

Hard Disks
IDE Primary Master: cernvm-1.2.0-x86.vmdk (Normal, 5.24 GB)

I had some problems getting it to find the disk image. I did lots of clicking around and it worked in the end. I cannot replicate the "locate the vmdk file" snapshots in the ATLAS VirtualBox wiki exactly. Maybe I'll try again to see.

For network setup, I used NAT following these instructions

Then I followed the rest of the steps here


Configuration of CernVM

This configuration of CernVM is platform independent. A few things need to be set up before we can start playing

Login scripts

If you want the LHCb environment to be correctly set by default each time you login, the following is necessary:

/opt/lhcb/ (csh) has to be sourced at the end of the .bash_profile (.login)for bash (tcsh).

/opt/lhcb/ (.csh) SHOULD be sourced at the end of the .bashrc (.tcshrc). However, this doesn't work at the moment and Hubert claims it doesn't really make a difference for now.

The most important one for us, /opt/lhcb/ (csh), should be sourced, I do this in my .bashrc (.tcshrc).

Installing missing software

I found that I was missing SVN, CVS and, less importantly for the workshop, AFS. To install these, it is necessary to get the packages:

sudo conary update cvs
sudo conary update subversion
sudo conary update openafs=1.4.8-1-1
sudo conary update openafs-client=1.4.8-1-1
sudo conary update openafs-kernel=1.4.8-1-1

AFS has to be started:

sudo /etc/init.d/afs start

I also found that there was no gmake command. In CERN Linux this is just a symbolic link to /usr/bin/make but cmt calls gmake, so we need to have it. I just hacked it by making a link:

sudo ln -s /usr/bin/make /usr/bin/gmake

If you are using C-shell, remember to do type


to update the paths, otherwise you won't see cvs, klog, etc. until the next time you log it.

Personal tools