Managed Virtual Machine (MVM)

From DAVE Developer's Wiki
Revision as of 08:23, 4 April 2016 by U0002 (talk | contribs) (Advanced version)

Jump to: navigation, search
Info Box
VirtualMachine.png Applies to MVM

Introduction[edit | edit source]

Development environments of modern embedded systems are getting more complex as technology of systems-on-chips (SoC) evolves. A lot of things have to be set up on host side - cross-tool chains, libraries, debuggers etc. - before developer can put his/her hands on the target. This process is unavoidable but really boring and often even frustrating. Also, even if instructions provided by board vendor are clear and exhaustive, it is likely that the resulting host configuration is either incorrect or incomplete.

DAVE Embedded Systems has developed a new powerful tool to tackle this issue, called Managed Virtual Machine (MVM for short).

MVM is a virtual machine that allows developers

  • to start working on DAVE Embedded Systems's platforms very quickly, because it reduces manual installing and configuring of the development environment to a minimum
  • to keep development host configuration synced with the updates released by DAVE Embedded Systems.

This approach permits to achieve two important goals:

  • reducing the initial set up effort significantly
  • customer's host machine is constantly synchronized with the one used by DAVE Embedded Systems to build and validate the software releases for the targets, resulting in increased efficiency and effectiveness of software-related support activities.

The MVM is created and managed using Vagrant (https://www.vagrantup.com/), which is a powerful tool that creates, configures and manages virtual development environments. Vagrant uses Providers to integrate with the hypervisor that provides the virtual machines, that for the MVM is Oracle VirtualBox (https://www.virtualbox.org/). The entire virtual environment configuration is stored in simple plain text files, including the instructions for the provisioning tool (Puppet, https://puppetlabs.com/), so that installation, management and update of the MVM is straightforward.

MVM creation process


The MVM comes with all the development tools and source code, pre-configured, and requires only a minimal setup by the end user. Two versions are available:

  • basic: this version
    • is distributed as a OFV Package for Virtual Box
    • requires minimal configurations
    • requires several GB of data to be downloaded from DAVE Embedded Systems' servers
    • is intended for developers who don't need the full control of the virtual machine creation process
  • advanced
    • this version is distributed as git repository
    • requires the execution of the provisioning process to be created
    • requires few tens of kB of data to be downloaded from DAVE Embedded Systems' servers
    • is intended for developers who need the full control of the provisioning process.

Contents and provided services[edit | edit source]

This chapter briefly describes the contents and the services related to the software developing, provided by MVM. Depending on the target operating system (Yocto Linux distribution, Android etc.), contents organization may differ slightly from one MVM to another. Following sections describe these differences for all of the supported target operating systems. In general, MVMs are built upon Debian-based Linux distributions such as Ubuntu.

To log in on MVM, please use the following credentials:

  • username: dvdk
  • password: dvdk

dvdk can run commands with root privileges via sudo.

Yocto-based Linux distribution[edit | edit source]

The typical development/deployment process basically consists of two stages:

  • editing/building/debugging code: during this stage the target is connected via Ethernet LAN to host machine and is configured to
    • retrieve binary images (i.e. Linux kernel) via TFTP protocol
    • mount the development root file system via NFS protocol. This root file system is physically in the file system of the host machine as depicted here.
  • deployment: the goal of this stage is to configure the target for normal operation, that is out of the development environment. A target root file system - optimized in terms of memory footprint - is used. This root file system is stored on target's non-volatile memory.

To implement this workflow, MVM provides

  • TFTP server TBD
  • NFS server TBD
  • cross-tool chain
    • by default, cross-tool chain is installed in /home/dvdk/<targetname>/sdk/latest. <targetname> is the name of the actual hardware platform (i.e. lynx, axelulite etc.).
  • target-specific sources
    • U-Boot bootloader
    • Linux kernel
    • Yocto recipes
  • target's development root file system
  • Yocto build system including bitbake and SDK
  • Eclipse/ADT integrated development environment.

Installation and configuration[edit | edit source]

Basic version[edit | edit source]

TBD

Advanced version[edit | edit source]

200px-Emblem-important.svg.png
Each release of MVM has been tested with specific releases of Virtual Box and Vagrant, as detailed into Development Kit release note.
MVM may also work with different (especially newer) releases of those tools but this cannot be guarantee.
In case of dubt, ask the support team

To generate the image:

  • download and install git
  • configure ssh (for example as described here or by following this guide)
  • get access to DAVE Embedded Systems restricted git repositories as described here)
  • download VirtualBox and install it
    • don't mind if you have a previous VirtualBox version: the installer will update to the new version keeping your old VM images and files
  • download Vagrant and install it
  • clone the project/development kit repository (eg: git clone git@git.dave.eu:project-name/mvm.git)
    • please refer to the kit documentation for the specific project-name
  • enter repository cloned directory
    • create data directory into parent directory (eg: mkdir ../data from repository directory)
    • copy vagrant.yml.sample to vagrant.yml
    • customize VM settings by editing vagrant.yml using your preferred text editor
      • change, depending on PC configuration, number of CPUs and/or RAM size
      • uncomment and set ip_adress to VM's ip address
    • overwrite provision/modules/user/file/id_rsa with your private key (eg: cp ~/.ssh/username@myhost.com provision/modules/user/file/id_rsa): target name should be kept to id_rsa
  • create the VM with the following command:
vagrant --color up

After the first boot, MVM may need to restart to complete installation. To reboot the VM just run:

vagrant reload

MVM lifecycle management[edit | edit source]

Basic version[edit | edit source]

MVM live cycle is managed only via Virtual Box interface.

Advanced version[edit | edit source]

You may start/stop/destroy MVM from classic VirtualBox interface or using Vagrant.

In the latter case:

  • to stop MVM run
vagrant halt
  • to destroy MVM (WARNING: this remove all MVM VirtualBox files, including your customization!)
vagrant destroy
  • to start a previously stopped MVM:
vagrant up
  • to save MVM state to file (hibernate)
vagrant suspend


Updating MVM[edit | edit source]

Basic version[edit | edit source]

TBD

Advanced version[edit | edit source]

To update your MVM enter MVM git repository and just:

  • stop MVM
vagrant halt
  • update git repository
git pull
  • force Vagrant provision
vagrant up --provision --color