If you have installed Vagrant CLI (https://kenanhancer.com/2019/09/22/creating-starting-stopping-packaging-and-publishing-a-vagrant-box/), just run the following command to create docker installed virtual box.
The following command will download Vagrant box from Vagrant Cloud.
vagrant init kenanhancer/DockerMachine
![](https://kenanhancer.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-06-at-22.08.12.png)
This command will up and run the virtual machine in your VirtualBox. So you need to install VirtualBox as well 🙂
vagrant up
![](https://kenanhancer.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-06-at-22.10.57.png)
If you want to check status of virtual machine, run the following command.
vagrant status
![](https://kenanhancer.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-06-at-22.11.51.png)
If you want to see ports of virtual machine, run the following command.
vagrant port
![](https://kenanhancer.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-06-at-22.12.44.png)
to connect created virtual machine, run the following command in the Vagrantfile directory.
vagrant ssh
![](https://kenanhancer.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-06-at-22.13.36.png)
if you want to see details of Vagrantfile, check it as below.
Creating a Vagrant Package file
vagrant package --output dockermachine.box --vagrantfile Vagrantfile
![](https://kenanhancer.com/wp-content/uploads/2018/10/Screen-Shot-2018-10-07-at-00.14.01.png)
Pushing Created Vagrant Package to Vagrant Cloud
After you create a Vagrant Package, run the following command in the package file location.
vagrant push