Scratchbox + Maemo SDK 4.1.1 on Fedora 9

My everyday working machine is based on Fedora 9 x86_64. Since Scratchbox is officially supported only by i386 archs I have been looking for an optimal solution to get it working inside of my box.

The most clean solution is to fake an i386 architecture by using setarch command, this way the checking prerequisites are satisfied and you able to install scratchbox by following the usual procedure, with some workarounds.

Scratchbox know limitations:

Qemu “mmap_min_addr” value grather than 4096

Edit /etc/sysctl.conf and add:
vm.mmap_min_addr = 4096

Scratchbox doesn’t work when VDSO support is enabled in the host’s kernel.

To disable VDSO support in x86_64 kernels you need to add the vdso32=0 options
in your kenel boot line

Edit /boot/grub/menu.lst and add vdso32=0 my kernel boot looks like:

kernel /vmlinuz- ro root=/dev/VolGroup00/LogVol00 rhgb quiet vdso32=0

Reboot your machine so VDSO can be disabled.

Installing Scratchbox:

Get the installer script:

Give executable permitions to the script:
chmod +x

Disable Selinux:
echo 0 > /selinux/enforce

Other wise the installer script will complain

Fake a i386 arch:

sudo setarch i386

Run installer script:

sudo ./ -s <install-path> -u <your-username>

This will take a while, when it finish you will see a massage like this:

Installation was successful!

Installing Maemo SDK:

Download SDK installer script


Give executable permitions to the script:
chmod +x

Fake i386 arch:

setarch i386

Satrt sbox service:

sudo <sb-install-path>/sbin/sbox_ctl start

Run the sdk install script
sh ./ -y -s -d <sb-install-path>

Testing scratchbox and the sdk:

Install Xephyr server to forward sb xorg-X11

sudo yum install xorg-x11-server-Xephyr

Start Xephyr server:

Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite

Start sbox and login

sudo /opt/scratchbox/sbin/sbox_ctl start


Create a file named hello-maemo.c and add the following lines:


#include <hildon/hildon-program.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkbutton.h>

int main(int argc, char *argv[])
/* Create needed variables */
HildonProgram *program;
HildonWindow *window;
GtkWidget *button;

/* Initialize the GTK. */
gtk_init(&argc, &argv);

/* Create the hildon program and setup the title */
program = HILDON_PROGRAM(hildon_program_get_instance());
g_set_application_name(“Hello maemo!”);

/* Create HildonWindow and set it to HildonProgram */
window = HILDON_WINDOW(hildon_window_new());
hildon_program_add_window(program, window);

/* Create button and add it to main view */
button = gtk_button_new_with_label(“Hello!”);
gtk_container_add(GTK_CONTAINER(window), button);

/* Connect signal to X in the upper corner */
g_signal_connect(G_OBJECT(window), “delete_event”,
G_CALLBACK(gtk_main_quit), NULL);

/* Begin the main application */

/* Exit */
return 0;


Compile the hello-maemo example:

gcc -o hello-maemo hello-maemo.c `pkg-config –cflags gtk+-2.0 hildon-1` -ansi -Wall `pkg-config –libs gtk+-2.0 hildon-1`

Set the DISPLAY variable to poit to the Xephyr server

export DISPLAY=:2

Start the maemo scratchbox enviroment test script: start

Run the hello_maemo application: ./hello_maemo




3 thoughts on “Scratchbox + Maemo SDK 4.1.1 on Fedora 9

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s