4 Vagrant.configure(2) do |config|
5 # define a name instead of just 'default'
6 config.vm.define "qmk_firmware"
8 # VMware/Virtualbox ( and also Hyperv/Parallels) 64 bit
9 config.vm.box = "generic/debian9"
11 config.vm.synced_folder '.', '/vagrant'
13 # This section allows you to customize the Virtualbox VM
14 # settings, ie showing the GUI or upping the memory
16 config.vm.provider "virtualbox" do |vb|
17 # Hide the VirtualBox GUI when booting the machine
19 # Uncomment the below lines if you want to program
20 # your Teensy via the VM rather than your host OS
21 #vb.customize ['modifyvm', :id, '--usb', 'on']
22 #vb.customize ['usbfilter', 'add', '0',
25 # '--vendorid', '0x16c0',
26 # '--productid','0x0478'
28 # Customize the amount of memory on the VM:
30 # Uncomment the below lines if you have time sync
31 # issues with make and incremental builds
32 #vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
35 # This section allows you to customize the VMware VM
36 # settings, ie showing the GUI or upping the memory
38 config.vm.provider "vmware_workstation" do |vmw|
39 # Hide the VMware GUI when booting the machine
42 # Customize the amount of memory on the VM:
46 config.vm.provider "vmware_fusion" do |vmf|
47 # Hide the vmfare GUI when booting the machine
50 # Customize the amount of memory on the VM:
54 # Docker provider pulls from hub.docker.com respecting docker.image if
55 # config.vm.box is nil. In this case, we adhoc build util/vagrant/Dockerfile.
56 # Note that this bind-mounts from the current dir to
57 # /vagrant in the guest, so unless your UID is 1000 to match vagrant in the
58 # image, you'll need to: chmod -R a+rw .
59 config.vm.provider "docker" do |docker, override|
61 docker.build_dir = "util/vagrant"
65 # Unless we are running the docker container directly
66 # 1. run container detached on vm
67 # 2. attach on 'vagrant ssh'
68 ["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type|
69 config.vm.provider type do |virt, override|
70 override.vm.provision "docker" do |d|
71 d.run "qmkfm/base_container",
72 cmd: "tail -f /dev/null",
73 args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'"
76 override.vm.provision "shell", inline: <<-SHELL
77 echo 'docker restart qmkfm-base_container && exec docker exec -it qmkfm-base_container /bin/bash -l' >> ~vagrant/.bashrc
82 config.vm.post_up_message = <<-EOT
84 Log into the environment using 'vagrant ssh'. QMK directory synchronized with
85 host is located at /vagrant
86 To compile the .hex files use make command inside this directory, e.g.
88 make <keyboard>:default
91 make planck/rev4:default:dfu