Skip to content
David Keppler edited this page Feb 7, 2014 · 14 revisions

Getting the Code

Checking out the code works similarly to downloading the Google AOSP code.

mkdir svmp ; cd svmp
repo init -u https://github.com/SVMP/android.git
repo sync -j4

To check out a specific tagged version use the ‘-m’ option of repo init to pick the corresponding manifest file:

repo init -u https://github.com/SVMP/android.git -m svmp-1.2.xml
repo sync -j4

Building and Running

Android Client

Follow the instructions in the client README

Install the resulting APK to an Android 4.0 or newer device and add a new connection for your an SVMP server.

Server

Test

The single-user server is meant primarily for development and testing of the SVMP client and VM instance without requiring a full cloud infrastructure.

To build and run the test server, see the README

Production

To setup the production version of the Proxy server, see README

VM Image

For the VM image itself, the build process is largely the same as with AOSP, and much of the AOSP documentation on the subject still applies:

  • Prerequisites for the build environment are described here.
  • Details of the build commands here.

Note: The SVMP v1.0 code is based off of Android 4.0.4. Building this version of Android is only supported on Ubuntu 10.04 64-bit. To build it on 12.04 or newer, the most reliable method is to create a 10.04 chroot or VM. One way to do this is described here. For the brave, it is also possible to patch the code to build natively on 12.04 as per this set of instructions, though we do not consider this method supported.

SVMP v1.1 is based off of Android 4.2.2 which should be compilable as-is under newer versions of Ubuntu, however we have not extensively tested this.

Summary:

1. cd ${SVMP_AOSP_ROOT}
2. ./build-svmp.sh
3. Enter the requested IP and Port for a STUN server. A list of public servers can be found here or install your own using something like rfc5766-turn-server
4. Answer N when asked about the virtio build unless you plan to run the VM using virtio para-virtualized disks.

Running SVMP

Starting a VM Instance

Virtual Box

  1. Build the project as above
  2. From ${SVMP_AOSP_ROOT}/out/target/product/svmp/ copy the files:
  3. android_system_disk.vdi
  4. android_data_disk.vdi
  5. Create a VM in VBox using the android_system_disk.vdi as the first hard drive using an IDE controller (not SATA or SCSI)
  6. Attach android_data_disk.vdi as a 2nd IDE drive
  7. Add a network interface such that the VM can communicate with the SVMP proxy server
  8. Start it up

Note for laptop users: VirtualBox will pass ACPI data from the host into the VM by default. If you start the VM while running on battery, VBox will incorrectly pass a “sleep” command to the VM causing it to immediately shutdown right after it’s finished booting. To correct, either plug in to the wall or configure VBox to not do ACPI pass-through.

Note 2: You can add a serial port device to the VM to get access to dmesg and init console log. If you attach an interactive pty to that serial port, you can also get a local shell.

VMware

Same as for Virtual Box, but use android_system_disk.vmdk and android_data_disk.vmdk instead.

KVM

To use virtio para-virtualized disks, make sure to answer Yes in that part of the build-svmp script.

Configure a VM using android_system_disk.img and android_data_disk.img, or first convert them to another format like QCOW using qemu-img.

OpenStack (with KVM compute nodes)

Convert android_system_disk.img to QCOW2 format using qemu-img. Upload the resulting image to glance.

Create a cinder volume of the size you want for users’ persistent data, apps, and settings. Mount to an existing Linux VM. Partition the blank volume into two primary partitions. The first will be the main data storage partition (Android’s /data mountpoint). Size appropriately. The second will be the cache partition (Android’s /cache), and need be no larger than 1GB.

After formatting, create loopback devices for the two partitions using ‘kpartx -a’. Then format each partition as ext4.

Unmount the loopbacks with ‘kpartx -d’ and remove the cinder volume from the Linux VM.

As an example, prebuilt images of a variety of sizes can be found in ‘device/mitre/svmp/data-disk-blanks’.

This volume will now be the basis for all new user data volumes. To create a new clone of the volume, snapshot it and spawn a new volume from the snapshot.

Create SVMP instances by launching the glance image and attaching a user data volume.

License

Copyright © 2012-2013, The MITRE Corporation, All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.