Managed Virtual Machine (MVM)

From DAVE Developer's Wiki
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
    • 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
    • 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.

MVM can be viewed as an evolution of the DVDK virtual machine.

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 from one MVM to another. Following sections describe these differences for all 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.

The following sections detail the organization of the most common types of MVMs available. These types are determined by the target operating system.

Yocto-based Linux distribution[edit | edit source]

Please refer to this page.

Android-based Linux distribution[edit | edit source]

This section will be completed in a future version of this article.

Installation and configuration[edit | edit source]

Basic version[edit | edit source]

If you use a basic version of MVM, please go to this page which details how to import the OVF archive.

Advanced version[edit | edit source]

If you use advanced version of MVM, please read the following instructions.


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 guaranteed.
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/files/id_rsa with your private key (eg: cp ~/.ssh/username@myhost.com provision/modules/user/files/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]

200px-Emblem-important.svg.png

MVM is, at the end, a virtual machine managed with Virtual Box. Thus, before running any update, we suggest to take a VM snapshot to revert any change in case something goes wrong during the update phase

  • turn on the MVM and open a terminal (e.g by hitting CTRL-ALT-T).
  • change into the <targetname> directory (cd /home/dvdk/<targetname>)
  • if not previously done:
    • configure ssh (for example as described here or by following this guide)
    • get access to DAVE Embedded Systems restricted git repositories as described here
    • overwrite mvm/provision/modules/user/files/id_rsa with your private key (eg: cp ~/.ssh/username@myhost.com mvm/provision/modules/user/files/id_rsa): target name should be kept to id_rsa
  • run the ./mvm-sync command

This will run Puppet provision which will align the development environment with the latest release.

mvm-sync, by default, enable verbose debugging output, to see provisioning progress (which may take a while, depending on our PC power and connection speed): error will be colored in red, so take special care to catch them.

For example the next screenshot display an authorization error while connecting to DAVE git server:


Mvm-sync git error unauthorized.png


200px-Emblem-important.svg.png

Please note that usually mvm-sync needs to be run twice: the first time to update the MVM repository, the second time to run the updated provision

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

FAQs[edit | edit source]

Please go to this page.

Known issues[edit | edit source]

Please go to this page.