Scientific Linux on Ubuntu with SCHROOT

From Etp
Jump to: navigation, search

NOTE: Schroot is being deprecated in favour of Singularity, please have a look at this wiki page

Using the chroot command one can create a Scientific Linux environment on the Ubuntu desktops machines.

Opening single shells (implicit creation of a session)

To use SLC6 on an Ubuntu 14.04 machines use the following commands:

  • Open a terminal window
  • For SLC6 type:
    schroot -c slc6 -p -- /bin/bash -l 

Using sessions

If you are a heavy user it is advised to use sessions or SchrootNG, since creating and destroying a Chroot has a lot of overhead and can lead to side-effects (see below "cd ."). These are the commands to handle sessions:

  • Begin a session:
    schroot -c slc6 -p -b -n slc6_$USER
  • Get a new slc6-bash (can be repeated as often as needed and should be faster than single shells):
    schroot -p -r --chroot slc6_$USER -- /bin/bash -l
  • End session:
    schroot -e --chroot slc6_$USER
  • List sessions:
    schroot -i --all-sessions
    (show all schroot sessions on the machine and produces a lot of information, maybe use grep to get the information you need)

Known problems

"cd ."

It is known that closing schroot sessions (in both variants) can cause shells which have their current directory on /project/etp* to become unreachable. To check if your shell is affected you can execute
readlink -f .
, which in case of a problem would then show "(unreachable)/myDir".

Note that for certain programs this might lead to obscure error messages as for e.g. voms-proxy "java.lang.ExceptionInInitializerError".

You can "fix" your terminal by changing to the current working directory again, i.e. executing
cd .