Vagrant is a tool for building and managing virtual machines. Specifically, it is for creating easily reproducible development environments. Since I do a lot of development work on DietPi, I thought that this would be a perfect tool to use! For anyone else who wants to develop on DietPi, or just easily create a VM with it, I documented my workarounds. Note that the box I created only works on VirtualBox, since it is the only VM software I have, and this tutorial should work on Linux or macOS. This guide also assumes that you already have Vagrant installed.
First, you should create a directory to work in:
Code: Select all
After that, you should download the DietPi Vagrant box:
This box contains a pre-installed version of DietPi 7.2 (current version as of time of writing). This version contains nothing but what comes pre-installed with DietPi, namely Dropbear and DietPi-RAMLog.
Vagrant expects a
user to use for SSH, but since DietPi only has the
user, we'll have to tell Vagrant to use that. In the newly created
, insert, somewhere between
Vagrant.configure("2") do |config|
Then, it's just a matter of running:
You'll probably get a few errors like
Remote connection disconnect.
while the machine boots up and runs the timesync, those are okay to ignore.
You now have an easily replacable and managable DietPi virtual machine. To connect to it, just run:
: Updated image to fix time sync running