Difference between revisions of "Managed Virtual Machine (MVM)"

From DAVE Developer's Wiki
Jump to: navigation, search
(Introduction)
(Installation and configuration)
Line 24: Line 24:
 
** for Windows: https://git-for-windows.github.io/
 
** for Windows: https://git-for-windows.github.io/
 
** for Linux: please refer to your distribution package manager
 
** for Linux: please refer to your distribution package manager
* configure ssh (for example by following [https://git-scm.com/book/it/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key this guide])
+
* configure ssh (for example as described [[Axel_Embedded_Linux_Kit_%28XELK%29#RSA_key_generation|here]] or by following [https://git-scm.com/book/it/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key this guide])
* send us the ssh public key as described [[Axel_Embedded_Linux_Kit_%28XELK%29#RSA_key_generation|here]]
+
* send us the ssh public key to your email support addresses (as described [[Axel_Embedded_Linux_Kit_%28XELK%29#RSA_key_generation|here]])
 
* [http://www.virtualbox.org download VirtualBox] and install it
 
* [http://www.virtualbox.org download VirtualBox] and install it
 
** tested with 5.0.14 (does NOT work with 5.0.0)
 
** tested with 5.0.14 (does NOT work with 5.0.0)
 +
** don't mind if you have a previous VirtualBox version (i.e. 4.x): installer will update to the new version keeping your old VM images and files
 
* [https://www.vagrantup.com/ download Vagrant]
 
* [https://www.vagrantup.com/ download Vagrant]
 
** install Vagrant
 
** install Vagrant
* clone the project/development kit repository (eg: git clone git@git.dave.eu:''project-name''/mvm.git)
+
* clone the project/development kit repository (eg: <b>git clone git@git.dave.eu:<i>project-name</i>/mvm.git</b>)
 
* enter repository cloned directory
 
* enter repository cloned directory
** create ''data'' directory into parent directory
+
** create ''data'' directory into parent directory (eg: <b>mkdir ../data</b> from repository directory)
 
** copy ''vagrant.yml.sample'' to ''vagrant.yml''
 
** copy ''vagrant.yml.sample'' to ''vagrant.yml''
** customize VM settings (vagrant.yml): number of CPUs and RAM size
+
** customize VM settings editing ''vagrant.yml'' using your preferred text editor
** uncomment and set ip_adress to VM's ip address (vagrant.yml)
+
*** change, depending on PC configuration, number of CPUs and/or RAM size
** overwrite provision/modules/user/file/id_rsa with your private key (~/.ssh/''username@myhost.com'')
+
*** uncomment and set ip_adress to VM's ip address
 +
** overwrite provision/modules/user/file/id_rsa with your private key (eg: <b>cp ~/.ssh/<i>username@myhost.com</i> provision/modules/user/file/id_rsa</b>): target name should be kept to '''id_rsa'''
 
* create the VM with the following command:
 
* create the VM with the following command:
  

Revision as of 11:20, 22 March 2016

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 avoids manual installing and configuring of the development environment
  • 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.

Installation and configuration[edit | edit source]

To generate the image:

  • download and install git
  • configure ssh (for example as described here or by following this guide)
  • send us the ssh public key to your email support addresses (as described here)
  • download VirtualBox and install it
    • tested with 5.0.14 (does NOT work with 5.0.0)
    • don't mind if you have a previous VirtualBox version (i.e. 4.x): installer will update to the new version keeping your old VM images and files
  • download Vagrant
    • install Vagrant
  • clone the project/development kit repository (eg: git clone git@git.dave.eu:project-name/mvm.git)
  • 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 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]

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


Update MVM[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