ICub server laptop installation instructions

From Wiki for iCub and Friends
Revision as of 10:08, 15 June 2015 by (talk | contribs) (Clock synchronization)
Jump to: navigation, search

These instructions only apply to YARP > 2.3.23 and iCub > 1.1.13 software versions

See ICub laptop installation instructions for old releases for older instructions

This page contains guidelines for installation of the iCub server laptop so that it matches the requirements of the Linux on the pc104 (open call configuration).

We assume you have installed a working Debian or Ubuntu on the laptop. You can freely decide to install 32 bit or 64 bit, the code compiles on both architectures. Be aware that if you plan to share the repository with other machines, all machines need to have the same architecture (32 versus 64 bits, same versions of the libraries). A possibility would be to share the same code directory and different builds.

Prerequisite : basic system setup for a iCub machine

Please follow the instructions on page Generic iCub machine installation instructions, in order to prepare a generic machine for the iCub network.

NOTE : set user as “icub” and hostname as “icubsrv” (not mandatory, but suggested)

Then, follow the below steps to customize it as the iCub Laptop

The host file

Add following lines in the file /etc/hosts        pc104

NFS Server

The laptop hosts two directories and export them using nfs. Both of the are mounted by the other machines on the network, by the PC104 and by the laptop iteself :

  • /exports/code - this contains the robot software sources such as YARP, iCub Software.
  • /local/yarp - this contains the YARP configuration files, shared by all the machine in the network

For this to work you need:

  • install nfs server on the laptop:
 sudo apt-get install nfs-kernel-server nfs-common portmap
  • creates the directories that will be exported:
 sudo mkdir -p /exports/code
 sudo mkdir -p /exports/local_yarp

Set appropriate permissions to the icub user:

 sudo chown icub:icub -R /exports/code
 sudo chown icub:icub -R /exports/local_yarp
  • Now configure the nfs-kernel-server:

Add these lines to /etc/exports:


You might need to restart the nfs server.

 sudo /etc/init.d/nfs-kernel-server restart 

Or just reboot the machine.

Software repositories

Create a symbolic link to the code export path as follows (as root)

sudo ln -s /exports/code /usr/local/src/robot

Then clone the icub software repositories into /exports/code, as follows

cd /exports/code
git clone
git clone
git clone
git clone
git clone

YARP local path

Create a symbolic link to the local yarp export path as follows (as root)

mkdir -p /home/icub/.local/share
ln -s /exports/local_yarp /home/icub/.local/share/yarp

Install the ssh keys for password-less login on PC104

Log in as icub and create an ssh key.

ssh-keygen -t rsa

Leave all choises to default just by pressing return button
Upload this key file to pc104

 ssh-copy-id -i /home/icub/.ssh/ icub@pc104

Other configurations

IP forwarding and NAT

Enable NAT and port forwarding so that the pc104 (and other machines on the network) have internet access (using wlan0 as external network interface) Enable IP forwarding : edit the file /etc/sysctl.conf by modifying the below line as follows

net.ipv4.ip_forward = 1

Setup Network Address Translation : add the following file /etc/network/if-up.d/natting as follows

#!/bin/sh -e
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

Fix IP and DNS

Use the following configuration for the network

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

Clock synchronization

Download the ntp package

 sudo apt-get install ntp

Your Laptop has to be the clock of the connection with the pc104 in case of no internet access so replace those lines from the file /etc/ntp.conf


or comment them by adding a # in front each lines and add those lines instead

 # the folllowing lines make the server a master server
 server # local clock
 fudge  stratum 10
 broadcastdelay  0.008

The internal clock of the pc104 resets every time the pc104 is restarted. It is important you configure your local network so that the pc104 has the correct time. In general it is a good idea if all the machines on the iCub network have synchronized clock. This page explains how to do this: Clock synchronization.

(note that in the past the pc104 ip address was This it has been recently changed)

Installation of the pc104

You have to use one of the Linux images we provide. This page contains some information about the Linux on the pc104, and important instructions for installing the startup scripts: The_Linux_on_the_pc104.

Code compilation

Now you can install YARP and the iCub software both on the laptop and on the pc104:

Software build and installation from sources