Physics Vagrant Box

This page is to document how to use our Vagrant box already shipped with CMSSW.

Get the box

Currently is available at http://newman.ultralight.org/vagrant/centos-cvmfs.box

There is also a nicer alternative, that is to install Vagrant 1.5 + and just do the vagrant cloud mantra :

  • vagrant init samircury/centos-cvmfs
  • Edit the "Vagrant" file to the box name you want (not default)
  • vagrant up (this will download and start your VM). You will still need the memory configuration below.

Setup the box

Obs: ALL the tutorial is considering the box name "physics" and not "centos-cvmfs".

Make sure to separate a directory for this and run something similar to :

[samir@localhost physics]$ vagrant box add physics /home/samir/vagrant/centos/guinea-pig2/package.box
Downloading box from URL: file:/home/samir/vagrant/centos/guinea-pig2/package.box
Extracting box...te: 1870M/s, Estimated time remaining: --:--:--)
Successfully added box 'physics' with provider 'virtualbox'!

[samir@localhost physics]$ vagrant init

We also need to do a bit of configuration. After vagrant init edit the "Vagrant" file (yes, it will be lying there in your chosen directory).

There are 2 points to configure in the Vagrant file :

  • The box name, let's call it "physics" :

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "physics"

  • The available memory - this can change according to your use (CMSSW) :

  config.vm.provider :virtualbox do |vb|
  #   # Don't boot with headless mode
  #   vb.gui = true
  #
  #   # Use VBoxManage to customize the VM. For example to change memory:
     vb.customize ["modifyvm", :id, "--memory", "2048"]
  end

This piece of code will be commented, you have to uncomment it yourself, or copy and paste this piece of code in your Vagrant file, might also work.

Starting and using

Now we're almost ready to go. Start the box :

[samir@localhost physics]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'physics'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] Mounting shared folders...
[default] -- /vagrant

Sample output included just in case.

Now this part is not vagrant-standard. As the vagrant way to forward X (graphic environment) didn't work, I preferred to use the primitive and foolproof way. Once your box is up, we can use plain SSH :

[samir@localhost physics]$ ssh student@localhost -X -A -p 2222

And the password is "student".

Yes, I just did it, put in a public webpage a password. Why? Because this is not supposed to be secure. The Vagrant model itself has default root passwords (vagrant) and known key-pairs that allows anyone to have access to the box. Security is really not the point.

If you want to use this for deployments or anything more definitive then a temporary session, change the passwords.

Now to the physics.

Using CMSSW and ROOT as "student"

Everything was taken care of before, so all you need to do is happily use CVMFS :

[student@vagrant-centos64 ~]$ source /cvmfs/cms.cern.ch/cmsset_default.sh

You have 2 options. Create a CMSSW area with your preferred release/arch (not the scope of this document), or use the default already shipped :

[student@vagrant-centos64 ~]$ cd CMSSW_5_3_8/src/
[student@vagrant-centos64 src]$ cmsenv

If nothing crashes at this point you have root and all CMS standard tools.

To test the X forward, call "root" and see the logo appearing on your screen. If you see messages like "display not set" something went wrong.

-- Main.samir - 2014-04-22

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2014-04-22 - samir
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback