Generic iCub machine installation instructions

From Wiki for iCub and Friends
Revision as of 09:51, 15 June 2015 by (talk | contribs) (iCub software repository and common packages)
Jump to: navigation, search

This page contains instructions on how to prepare a machine to work in the iCub Subnet environment. This is a basic setup, useful as a starting point to prepare any kind of machine of the iCub ecosystem.

Operative System

You can choose both a Debian or Ubuntu Linux, the curently suggested OS is Debian 7 (wheezy)

Creation of the icub user

You need to create the icub user. For nfs (see later) to work this user has to have the uid 1000 and guid 1000. In LINUX starting procedure, it is asked to create the first user. By default uid is set at 1000. to make sure it is done do :

id -u icub
id -g icub

Add the icub user to the sudoers group, by editing in /etc/group the following line


Required Packages

Please install the following packages (names are correct for Debian 7, please check the corresponding package in your distribution):

 nfs-common python-tk libopencv-dev ntp vim ssh cmake-curses-gui iperf

Software repository

NOTE : this step is required only for a Debian machine.
Enable the non-free and contrib sources, by editing the file /etc/apt/sources.list Exaple:

deb wheezy main non-free contrib
deb-src wheezy main non-free contrib
deb wheezy/updates main non-free contrib
deb-src wheezy/updates main non-free contrib
# wheezy-updates, previously known as 'volatile'
deb wheezy-updates main non-free contrib
deb-src wheezy-updates main non-free contrib

iCub software repository and common packages

NOTE : skip this step in case of icub server
Configure the iCub software repository, by creating the file /etc/apt/sources.list.d/icub.list as following example

  • for a Debian 7 (Wheezy) machine :
 deb wheezy contrib/science
  • for a Ubuntu 14.04 LTS (Trusty) machine :
 deb trusty contrib/science

After adding a new source, remember to update the packages list:

apt-get update

Install the following packages from icub repository


Optional : install QT libraries

NOTE: this step is not required if you installed the icub-common package with version > 1.1.15

Please install the following packages (please check the corresponding package in your distribution):

  • for a Debian 7 (Wheezy) machine (in this release packages are from backports repository):
qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qml-module-qtquick2 qml-module-qtquick-window2 qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls libqt5svg5
  • for a Ubuntu 14.04 LTS (Trusty) machine :
 qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtdeclarative5-qtmultimedia-plugin qtdeclarative5-controls-plugin qtdeclarative5-dialogs-plugin libqt5svg5

Network configuration

You have two options:

  • Static IP address (this option is mandatory if there is no DHCP in you subnet - like in the case of iCub Laptop - or if your machine is the DHCP server - this is the case of icub server)
  • Dynamic DHCP IP address

Dynamic IP configuration

To configure a dynamic IP adress, edit /etc/network/interfaces, as follows (where eth0 is the interface to configure)

 # The primary network interface
 auto eth0
 allow-hotplug eth0
 iface eth0 inet dhcp

Static IP configuration

To configure a static IP adress, edit /etc/network/interfaces, as follows (where eth0 is the interface to configure)

 # The primary network interface
 auto eth0
 allow-hotplug eth0
 iface eth0 inet static
   address 10.0.0.MACHINE_IP
   netmask NETMASK
   gateway GATEWAY_IP
   dns-nameservers DNS_IP
   dns-domain icub.local
   dns-search icub.local

and replace MACHINE_IP NETMASK DNS_IP GATEWAY_IP with the appropriate values for you network.
As example, in case of a machine in an environment with the icub server the above configuration will be (where MACHINE_IP is now

 # The primary network interface
 auto eth0
 allow-hotplug eth0
 iface eth0 inet static
   dns-domain icub.local
   dns-search icub.local

In case of Static IP, please check that the file /etc/hosts looks as follows       localhost       MACHINE_HOSTNAME.icub.local       MACHINE_HOSTNAME

and replace MACHINE_HOSTNAME with the hostname of you machine, that should match the file /etc/hostname

mount remote NFS shares

NOTE : skip this step in case of icub server or icub latop
To mount the remote NFS shares, edit /etc/fstab, by adding the folowing lines

 NFS_SERVER_IP:/exports/code /usr/local/src/robot nfs _netdev,auto,hard,intr  0 0
 NFS_SERVER_IP:/exports/local_yarp    /home/icub/.local/share/yarp nfs _netdev,auto,hard,intr 0 0

and replace NFS_SERVER_IP with the appropriate value for you network. As example, in case of a machine in an environment with the icub server the above configuration will be /usr/local/src/robot nfs _netdev,auto,hard,intr  0 0    /home/icub/.local/share/yarp nfs _netdev,auto,hard,intr 0 0

Then create the two above mountpoints as follows

 mkdir -p /home/icub/.local/share/yarp
 mkdir -p /usr/local/src/robot

NTP configuration

Edit the file /etc/ntp.conf by adding the following lines


and replace NTP_SERVER_IP with the appropriate value for you network. As example, in case of a machine in an environment with the icub server the above configuration will be


icub user enviroment variables

NOTE : skip this step in case of icub server
add the file /home/icub/.bashrc_iCub

as follows
# .bashrc_iCub
# setup the iCub enviroment
if [ "$PS1" ]; then 
  echo "Setting up yarp and iCub env vars"
# YARP and iCub enviroment variables
export ROBOT_CODE=/usr/local/src/robot/
export ICUBcontrib_DIR=$ROBOT_CODE/iCubContrib
export YARP_DIR=$YARP_ROOT/build
export ICUB_ROOT=${ROBOT_CODE}/icub-main
export ICUB_DIR=${ICUB_ROOT}/build
export icub_firmware_shared_DIR=${ROBOT_CODE}/icub-firmware-shared/build
export YARP_DATA_DIRS=${YARP_DIR}/share/yarp:${ICUB_DIR}/share/iCub:${ICUBcontrib_DIR}/share/ICUBcontrib
export FIRMWARE_BIN=${ROBOT_CODE}/icub-firmware/build
# Set the name of your robot here.
# Please change also the root user password
 if [ "$YARP_ROBOT_NAME" = "" ] && [ -f "${ROBOT_CODE}/yarp_robot_name.txt" ]
   export YARP_ROBOT_NAME=$( head --lines=1 ${ROBOT_CODE}/yarp_robot_name.txt )
# Set-up optimizations
export CMAKE_BUILD_TYPE=Release
export PATH=$PATH:$ICUB_DIR/bin:$YARP_DIR/bin
# DebugStream customization
# To enable tab completion on yarp port names
if [ -f $YARP_ROOT/scripts/yarp_completion ]; then
  source $YARP_ROOT/scripts/yarp_completion

Then add the following lines

#Load the iCub custom bashrc
if [ -f "$ICUBRC_FILE" ]; then
  source $ICUBRC_FILE

at the beginning of file /home/icub/.bashrc just BEFORE the following lines:

# If not running interactively, don't do anything
case $- in
   *i*) ;;
     *) return;;

You can simply download an archive with the .bashrc and .bashrc_iCub files here: File:Icub env files.tar
In case of any problem with enviroment, see also the page Debugging_problems_with_yarprun

Optional - Configure remote desktop

If you want to setup a VNC remote desktop, execute from a graphical session the following command


If you get this error The authentication mechanism requested can not be provided by the computer please launch the following command, from a shell terminal

 gsettings set org.gnome.Vino enabled true

Optional - disable the screen power off

Using the gnome3 control panel, it is not possible to avoid the system has to be idle for the monitor to be turned off, the maximum time is "1 hour", "never" is not possible. From the command line execute the following commands

gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 0
gsettings set org.gnome.desktop.session idle-delay 0

Optional - install nVidia video drivers

  • Install the following packages
 nvidia-glx nvidia-settings nvidia-xconfig
  • Run nvidia-xconfig
  • Reboot

Optional - Fix the the .local domains resolution problems

NOTE: only on clients, NOT on icub server.
Edit /etc/nsswitch replacing the following line

 hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4


 hosts:          files dns

Optional - install opencv version 2.4.8

Download the sources of Opencv-2.4.8 Unzip and build with


if you dont't want to install it, you can setup the environment variable OpenCV_DIR, es:

 export OpenCV_DIR=$code/opencv/opencv-2.4.8/build

Optional - how to fix ssh lag on connect

In case of lag in SSH connections, disable DNS lookup on ssh server, edit the file /etc/ssh/sshd_config adding the following line

UseDNS no

Optional - how to fix the "nobody:nobody" NFS mount issue

If the NFS mounts shows NOBODY as UID and GUID, this mean that the client and the server are not in the same domain, check the file


Usually it is derived from the domain name mentioned in


so both, server and client must match.

Special computers

In case of special machines (such as the cuda workstation or icub laptop) you must follow further steps in order to complete the installation: