Browse Source

vagrant: minimize Vagrantfile and make it loadable

By parameterizing certain paths with `RIOTBASE`, it is possible to load
this Vagrantfile from other Vagrantfiles. This feature will be used by the
Tutorials repository, so that this Vagrantfile has no knowledge about
the tutorials, hence the deletion of the `tutorials` definition at this
Cenk Gündoğan 6 years ago
  1. 43
  2. 5

Vagrantfile vendored

@ -3,49 +3,16 @@
require 'fileutils'
Vagrant.configure(2) do |config|
# For a complete reference, please see the online documentation at
RIOTBASE ||= "./"
config.vm.define "RIOT", primary: true
Vagrant.configure(2) do |config|
# For a complete reference, please see the online documentation at
# Every Vagrant development environment requires a box. You can search for
# boxes at = "boxcutter/ubuntu1604"
config.vm.synced_folder RIOTBASE, "/home/vagrant/RIOT"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false "forwarded_port", guest: 4242, host: 4242
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.synced_folder ".", "/home/vagrant/RIOT"
config.vm.define "tutorials", autostart: false do |tutorials|
tutorials.vm.synced_folder "../.", "/home/vagrant/Tutorials"
config.vm.provider "virtualbox" do |vb| = "RIOT VM - Tutorials"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
# # Set name of the VM = "RIOT VM"
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# # enable usb passthrough
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbxhci", "on"]
vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'FTDI USB-TTL',
@ -70,5 +37,5 @@ Vagrant.configure(2) do |config|
config.vm.provision "file", source: File.join(Dir.home, ".gitconfig"), destination: ".gitconfig"
config.vm.provision "shell", path: "dist/tools/vagrant/"
config.vm.provision "shell", path: File.join(RIOTBASE,'/dist/tools/vagrant/')

dist/tools/vagrant/ vendored

@ -56,3 +56,8 @@ your host system and use the VM for compiling, flashing devices and running the
The needed `vendor id` and `product id` can be obtained by running `vboxmanage list usbhost`.
* For Linux Host Systems: Additionally, in order to allow USB access from within the guest system, the host system user
must be a member of the `vboxusers` group (see [here](
2. You can forward ports on the virtual machine with the following command:
``` "forwarded_port", guest: <port_1>, host: <port_2>