To clarify:
- VirtualBox runs virtual machines (VMs)
- Docker runs containers
- Vagrant is a declarative interface for VirtualBox VMs (and other providers)
If you have installed vagrant inside a VirtualBox VM, you would also need to install VirtualBox into that VM to be able to use Vagrant with it. This is probably not what you want to do.
Docker should probably be installed and run from your Ubuntu host, as this will give you greater performance than host->VM->docker.
On Ubuntu 12:04 the kernel must be upgraded and docker installation is more difficult. The docker
package shipped with 12:04 is not the docker you expect it to be if it outputs this:
root@29a3f3134898:/# docker --version
docker - version 1.4
Copyright 2003, Ben Jansens <[email protected]>
It would be easier to run a more recent Ubuntu version (where installation is as simple as sudo apt-get update && sudo apt-get install docker.io
- source), but if you need 12:04 then these instructions are from here copied here for posterity:
# install the backported kernel
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-trusty linux-headers-generic-lts-trusty
# install the backported kernel and xorg if using Unity/Xorg
$ sudo apt-get install --install-recommends linux-generic-lts-trusty xserver-xorg-lts-trusty libgl1-mesa-glx-lts-trusty
# reboot
$ sudo reboot
...
[ -e /usr/lib/apt/methods/https ] || {
apt-get update
apt-get install apt-transport-https
}
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.com/ubuntu docker main\
> /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker