Create Debian VM with Docker Host using Vagrant–automatically include Guest Additions


A short and simple article. I needed a Debian VM that I could use as Docker host – to run on my Windows 10 laptop. I resorted to Vagrant. With a few very simple steps, I got what I wanted:

0. install Vagrant (if not already done)

0. install Vagrant plugin for automatically adding Virtual Box Guest Additions to every VM stamped out by Vagrant (so folder mapping from host laptop to VM is supported)


1. create a fresh directory with a simple Vagrant file that refers for Debian image

2. run vagrant up

3. sit back and relax (few minutes)

4. use vagrant ssh to connect into the running VM and start doing stuff.

The vagrant file:

Vagrant.configure("2") do |config|
config.vm.provision "docker"

config.vm.define "debiandockerhostvm"
# = "debian/jessie64" "private_network", ip: ""

config.vm.synced_folder "./", "/vagrant", id: "vagrant-root",
       owner: "vagrant",
       group: "www-data",
       mount_options: ["dmode=775,fmode=664"],
       type: ""
config.vm.provider :virtualbox do |vb| = "debiananddockerhostvm"
   vb.memory = 4096
   vb.cpus = 2
   vb.customize ["modifyvm", :id, "--natdnshostresolver1","on"]
   vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]

Running Vagrant to create and subsequently run the VM:



Use vagrant ssh to enter the Virtual Machine and start mucking around:



Vagrant Plugin for automatically installing Guest Addition to each VM that is produced:

Vagrant Box Jessie:

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.