Building a Virtual Machine for Maemo development

Contents

[edit] Preferred operating system for Scratchbox/Maemo development

Debian GNU/Linux 6.0.x "Squeeze" is suggested as the optimal platform on which to develop with Scratchbox. If you do not run Linux as your primary operating system, or prefer an alternative distribution/release, it is recommended to create a virtual machine for this purpose.

[edit] Virtualisation software

There are a variety of freely-available virtualisation platforms, including VirtualBox, VMware Player, QEmu and others. VirtualBox seems to be easy to use and performs well. If your PC runs Linux, you may prefer to install virtualisation software through your package manager, for better integration with your OS.

[edit] Debian Squeeze basic installation

  • Download the latest Debian Squeeze i386 netinstall version from here
  • Create a new guest (virtual machine) using your virtualisation software and enable network connectivity for it
  • Mount the ISO file as a 'virtual' CD-ROM on the guest machine using your virtualisation software
  • Boot the guest from the virtual CD-ROM
  • Follow the Debian installer prompts to complete the installation of Debian into the guest.
  • N.B. Disk space: It is recommended that 10 GB of storage be allocated to the root filesystem, as Scratchbox will install there and will consume 6-8 GB of disk space alone.
  • When prompted, set the root password and create a non-root user, noting both passwords.

[edit] Preparing Squeeze for Development

  • Boot the installed Squeeze guest and log in with the root account and password (set during the installation process)
  • Install sudo
    # apt-get install sudo
  • Add your non-root user to the sudo group
    # adduser <username> sudo
  • Log out and log back in as your non-root user
  • Create the file /etc/apt/sources.list.d/scratchbox.list, add the Scratchbox repository as follows and save the file:
    deb http://scratchbox.org/debian/ hathor main
  • Update your package database
    $ sudo apt-get update
  • Install Scratchbox
    $ sudo apt-get install scratchbox-core scratchbox-devkit-apt-https scratchbox-devkit-autotools-legacy scratchbox-devkit-debian-squeeze scratchbox-devkit-doctools scratchbox-devkit-git scratchbox-devkit-perl scratchbox-devkit-python-legacy scratchbox-devkit-qemu scratchbox-devkit-svn scratchbox-libs scratchbox-toolchain-cs2007q3-glibc2.5-arm7 scratchbox-toolchain-cs2007q3-glibc2.5-i486 scratchbox-toolchain-host-gcc xserver-xephyr
  • Create a Scratchbox user
    $ /scratchbox/sbin/sbox_adduser <username>
  • Log out-in or execute to refresh group permissions
    $ newgrp sbox && newgrp

[edit] Installing the Maemo SDK

  • Download the Maemo SDK installer:
    $ wget http://repository.maemo.org/stable/5.0/maemo-sdk-install_5.0.sh
  • Replace all occurrences of 'etch' with 'squeeze':
    $ sed -i -e 's/etch/squeeze/g' maemo-sdk-install_5.0.sh
  • Launch the installer:
    $ sh ./maemo-sdk-install_5.0.sh

[edit] Log in to Scratchbox

  1. Log in to Scratchbox
    $ /scratchbox/login
  2. Proceed further to accept the EULA in order to obtain the Nokia proprietary binary packages. These Nokia binaries are essential for the complete functionality of the Maemo SDK:
  3. Execute the commands below on the FREMANTLE_ARMEL and FREMANTLE_X86 targets.
  [sbox-FREMANTLE_X86: ~] > sb-conf select FREMANTLE_ARMEL
  [sbox-FREMANTLE_ARMEL: ~] > echo "deb http://repository.maemo.org/ fremantle/4bc37c7c77ebe90177c050b805a8dc79 nokia-binaries" >> /etc/apt/sources.list
  [sbox-FREMANTLE_ARMEL: ~] > apt-get update
  [sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install nokia-binaries nokia-apps
  [sbox-FREMANTLE_ARMEL: ~] > sb-conf select FREMANTLE_X86
  [sbox-FREMANTLE_X86: ~] > echo "deb http://repository.maemo.org/ fremantle/4bc37c7c77ebe90177c050b805a8dc79 nokia-binaries" >> /etc/apt/sources.list
  [sbox-FREMANTLE_X86: ~] > apt-get update
  [sbox-FREMANTLE_X86: ~] > fakeroot apt-get install nokia-binaries nokia-apps

The above step installs all needed Nokia proprietary binary packages along with the open source binaries that have dependencies to Nokia proprietary binary packages. With this, your Maemo 5 SDK environment is set up completely and ready for development.

If you got any DNS errors with apt-get install resolving 'repository.maemo.org', you may need to update the resolver config inside scratchbox with:
$ sudo /scratchbox/sbin/sbox_sync


Consider adding some more repositories to /etc/apt/sources.list :

#Extras
deb http://repository.maemo.org/extras/ fremantle free non-free
deb-src http://repository.maemo.org/extras/ fremantle free

#Extras Testing
deb http://repository.maemo.org/extras-testing/ fremantle free non-free
deb-src http://repository.maemo.org/extras-testing/ fremantle free

#Extras Devel
deb http://repository.maemo.org/extras-devel/ fremantle free non-free
deb-src http://repository.maemo.org/extras-devel/ fremantle free