The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Platform SDK on VirtualBox

From Mer Wiki
(Difference between revisions)
Jump to: navigation, search
Line 86: Line 86:
  
 
Ensure your ~/.ssh/authorized_keys files has your own public key in it and you can access mersdk user with no passwd:
 
Ensure your ~/.ssh/authorized_keys files has your own public key in it and you can access mersdk user with no passwd:
 +
scp  -P 2222 ~/.ssh/id_rsa.pub root@localhost:/home/mersdk/.ssh/authorized_keys  # << if your key is ~/.ssh/id_rsa.pub
 
  ssh -p 2222 mersdk@localhost
 
  ssh -p 2222 mersdk@localhost
 
This is important for QtCreator to work seamlessly.
 
This is important for QtCreator to work seamlessly.

Revision as of 10:21, 24 October 2012

Contents

Introduction

The Mer VM SDK is intended for use with QtCreator, on non-linux machines and on machines where a chroot-based SDK is not desired.

It uses Oracle VirtualBox as the virtualisation engine. The website at https://www.virtualbox.org/ has a a lot of useful information.

Other virtualisation solutions should work without any issues. The main requirement is the ability to support shared folders.

Prepare Image

Download the SDK vmdk from http://img.merproject.org/images/sdk/mer-sdk-nemo-i486-vm-sda.vdi.bz2

Then unzip the image (it's a very large file)

bunzip2 mer-sdk*vdi.bz2

Create the VM

Run the VirtualBox manager and create a new machine called MerSDK with Linux/2.6 (32bit)

 VboxSDK-new.png

For larger builds allocate a substantial amount of memory (eg 2048Mb)

Select "Use existing hard disk" and pick the vdi you just downloaded/created

Now select create to make the VM.

Don't boot/start the VM until you have setup the shared folders or they will not be accessible.

Setting up and Networking

Select the MerSDK VM and then pick Settings

In System/Motherboard enable IO APIC In System/Processor enable PAE/NX and allocate as many CPUs as your host has.

This is not an emulator so there is no point setting any special Display settings.

In Networking set Adapter 1 to "NAT" ( see https://www.virtualbox.org/manual/ch06.html#network_nat ) since your VM will need to access the internet to perform updates.

Since it will need to act as a server for your local host we must setup port-forwarding too.

Select 'Advanced' and then 'Port Forwarding'. In the rules box add:

Name: guestssh
Protocol: TCP
Host Port: 2222
Guest Port: 22

and

Name: guestwww
Protocol: TCP
Host Port: 8080
Guest Port: 9292

VboxSDK-nat.png

Storage and Sharing your home, source and caches

Make sure /srv/mer/targets exists and is owned by you.

sudo mkdir -p /srv/mer/targets
sudo chown $USER /srv/mer/targets

Under Settings -> Shared Folders (example screenshot below) add two Machine Folders with the

Folder path: <your home directory eg /home/lbt>
Folder name: home

and

Folder path: /srv/mer/targets
Folder name: targets

Do not tick the 'automount' box as that simulates a removable media device which will not work.

 VboxSDK-sf.png

The shared folder called 'home' will be mounted as the sdk user's 'mersdk' $HOME directory as the SDK boots. The 'targets' shared folder will be mounted as /srv/mer/targets and will store target device headers and qml files used by Qt Creator.

You may want to share additional source and cache directories from your host.

Symbolic Links on shared folders

To enable Virtualbox to support symlinks run this command before launching the VM:

 VBoxManage setextradata MerSDK VBoxInternal2/SharedFoldersEnableSymlinksCreate/home 1 
 VBoxManage setextradata MerSDK VBoxInternal2/SharedFoldersEnableSymlinksCreate/targets 1

Running the SDK VM

You may now start the SDK VM. It will start an ssh service which can be accessed as:

ssh -p 2222 root@localhost

The root password is "rootme".

Ensure your ~/.ssh/authorized_keys files has your own public key in it and you can access mersdk user with no passwd:

scp  -P 2222 ~/.ssh/id_rsa.pub root@localhost:/home/mersdk/.ssh/authorized_keys   # << if your key is ~/.ssh/id_rsa.pub
ssh -p 2222 mersdk@localhost

This is important for QtCreator to work seamlessly.

Personal tools