Download the iso image
Get the ISO image of the 32bit Ubuntu desktop version from the official download location at
Ubuntu.com.
Create a new Virtual machine with Virtualbox
Create a new virtual machine with 1 CPU, 1 GB memory and 30 GB dynamic disk. The acceleration options for the graphics should be switched off. The settings are chosen in such a way that the image can run on nearly any computer. The settings could be changed later on by the users to their needs.
Install Ubuntu on the virtual machine
Connect the ISO image from the download above with the CD device of the virtual machine. If done start the virtual machine which will load the image and stop in some menu to choose the preferred language. Choose
English which is the most common language for all Physicists. In the next menu choose
Install Ubuntu. Concerning questions about the installation procedure please read the
Ubuntu documentation. At the end of the installation procedure the virtual machine has to be restarted and the computer will boot in the newly installed system.
Update the existing software
Use the
Ubuntu Update Manager to bring the Ubuntu installation up-to-date. Since the ISO image is created at a given date meanwhile there can be several security fixes, updates etc. which should be installed on the system.
The
Ubuntu Update Manager should start automatically after the reboot procedure after installation. If not you can use the
Dash Home utility to start the service. Click on the icon for
Dash Home and start typing
Update Manager in the input box which showed up.
Install Ubuntu Guest Additions on the virtual machine
Follow the instructions given
here if you are not sure what to do.
After installation reboot the virtual machine that the new functionality can take effect.
Install additional software
Open a terminal window and become root and use apt-get to install additional software. This is much faster then using the
Ubuntu Software Center.
sudo su
Software needed to be able to download and compile external packages and FairRoot
apt-get install g++ gfortran subversion cmake patch libx11-dev libxpm-dev libxmu-dev libxft-dev \
libxext-dev libglu1-mesa-dev
Editors
apt-get install joe emacs xemacs21 fte eclipse-cdt
Additional usefull stuff
apt-get install clang cppcheck apt-show-versions apt-file htop ncdu ddd valgrind valkyrie kcachegrind zerofree icecc icecc-monitor
Remastersys which is needed to create a ISO image
Download and apply the new key needed
wget -O - http://www.remastersys.com/ubuntu/remastersys.gpg.key | sudo apt-key add -
Add the following line that corresponds to your version of Ubuntu to your /etc/apt/sources.list
#Remastersys Precise
deb http://www.remastersys.com/ubuntu precise main
Now just apt-get update or reload in Synaptic to have the new Remastersys signed repository ready to use!
apt-get update
apt-get install remastersys-gui
AMD CodeAnalyst for profiling
Get the code, unpack the code and follow the instructions given in the INSTALL file. For Ubuntu you need to install the following packages
apt-get install qt4-dev-tools binutils-dev g++ libpopt-dev \
libtool autoconf automake make libelfg0-dev \
zlib1g-dev xterm xauth evince
After the installation of this package on has to run the main installation script which will setup and compile the complete program.
./CAInstaller.sh
Ubuntu Tweaks
Ubuntu Tweak is an application to make the configuration of Ubuntu more easy.
It provides many useful desktop and system options that the default desktop environment doesn't provide.
For example it provides an easy interface to delete old and no more used kernel versions and apt caches.
Download the Debian package from
here. Install it either by double clicking on the *.deb file in the file browser or on the command line by
sudo dpkg -i ubuntu-tweak*.deb
Sshuttle
SShuttle is a transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and
MacOS. Supports DNS tunneling.
Install it using apt
apt-get install sshuttle
Remove unnecessary data
Clean up your package installations (partial packages, the apt cache and unused dependencies). This will release
some hundreds MB depending of the installed packages. There are more steps which can be done (see
here).
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
For this task you can use also
Ubuntu Tweaks which allow to clean also much more unneeded data in an easy graphical way. It can be either started using the Dash or by the command line
ubuntu-tweak
Shrink the disk image used by the virtual machine
Since the disk image is a big file it is growing all the time. Even if one delete files in the virtual machine the size of the disk image can't be reduced automatically. VirtualBox comes with command line tools which will do shrink the size of the disk image. Unfortunately a simple on the host filesystem
VBoxManage modifyhd --compact <full path to disk image>
will not do the job. The problem is that the blocks freed in the virtual machine are still occupied in the disk image. Fortunately there is a tool which will do this job. To use it you have to shutdown the running virtual machine. When now booting press the
shift key on the keyboard to get the boot loader menu. There chose the recovery mode. At the next menu chose
root Drop to the root shell prompt which will bring up a root shell. Check with
df
which is the device file for the root filesystem and remount this filesystem readonly by doing
mount -n -o remount,ro -t ext4 /dev/sda1 /
Now you can run the zerofree tool (find description
here which will release all free blocks.
zerofree /dev/sda1
where /dev/sda1 is the device file of the root file system which can be different. After the tool finished the run shutdown the virtual machine
shutdown -h now
and run on the host filesystem again the command to shrink the disk image
VBoxManage modifyhd --compact <full path to disk image>
Another solution to create a smaller disk image is to clone the old one.
VboxManage clonehd name-of-original-vm.vdi name-of-clone-vm.vdi
Create a snapshop
Now after you installed all the additional you end up with a basic system which can be used to install any experiment specific software (CbmRoot, PandaRoot ...). So this is a good point to safe a snapshot of the virtual machine. From this snapshot you can create independent version which will fulfill different tasks. For doing a snapshot one has two different possibilities. Either one clones the machine which will create a one to one copy with a different name and also a new copied disk image. The second possibility is to save the state as a snapshot which will create a new overlaid disk image which will contain all the changes made after creating the snapshot. This allow to test new stuff with the safety to go easily back to the original system. Which solution fits better has to be decided on the special case.
To safe the state as snapshot or clone click on the icon
Snapshot in the main window of VirtualBox. Here you can chose now between
Snapshop (camera symbol) or
Clone (Sheep symbol).
Install the software
Install the external packages
Download the external packages from the SVN repository and install them at /opt/fairsoft as user root.
mkdir -p /opt/fairsoft/source
cd /opt/fairsoft/source
svn co https://subversion.gsi.de/fairroot/fairsoft/release/jan12
cd /opt/fairsoft/source/jan12
Edit the configure.ah script and set the install directory for the automatic setup to the correct location /opt/fairsoft/jan12.
Edit the file scripts/check_system.sh and add the following searchpath
/usr/lib/i386-linux-gnu to any list of directories where to look for libraries. This is specially needed for Ubuntu.
Run the configure.sh script in automatic mode to install the external packages.
./configure.sh automatic
Install PandaRoot
Download PandaRoot from the SVN repository and install them in the user home directory.
cd $HOME
svn co https://subversion.gsi.de/fairroot/pandaroot/trunk pandaroot
cd $HOME/pandaroot
Create a build directory which is used for the build process to keep the source directory clean. Set the correct PATH to the external packages, run cmake and make. The project can be build in parallel so you can use as much cores as are available on the build machine.
mkdir build
cd build
export SIMPATH=/opt/fairsoft/jan12
cmake ..
make -j<number of processes>
Install CbmRoot
Download CbmRoot from the SVN repository and install them in the user home directory.
cd $HOME
svn co https://subversion.gsi.de/fairroot/cbmroot/trunk cbmroot
cd $HOME/cbmroot
Download the needed fieldmaps from the repository to a new location in the user home directory and create symbolic links from cbmroot/input.
cd $HOME
svn co https://subversion.gsi.de/fairroot/cbmroot/fieldmaps cbm_filedmaps
cd $HOME/cbmroot/input
ln -s $HOME/cbm_fieldmaps/field_v10e.root
ln -s $HOME/cbm_fieldmaps/field_v09e.root
ln -s $HOME/cbm_fieldmaps/field_v09m.root
Create a build directory in cbmroot which is used for the build process to keep the source directory clean. Set the correct PATH to the external packages, run cmake and make. The project can be build in parallel so you can use as much cores as are available on the build machine.
cd $HOME/cbmroot/
mkdir build
cd build
export SIMPATH=/opt/fairsoft/jan12
cmake ..
make -j<number of processes>
Create a Live CD
For the creation of the Live CD the tool
Remastersys is used, which comes as command line tool or with a Gui. The Gui can be started either from a terminal by typing
remastersys-gui or by using Dash. A principal limitation is that the produced image can't be larger than 4GB. If the source directory of the external packages is not cleaned afterwards the installation all the remnants of the installation procedures are still there and the file size is to large. So to create a Live CD one has to delete the complete source directory or on has to clean up by hand.
--
FlorianUhlig - 12 Jun 2012