Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying create a nice playground for Docker in Vagrant based on Vagrant's precise64 box. (Code is available at GitHub: rfkrocktk/docker-vagrant-playground)

Here's my Puppet provisioning dependencies for the instance:

# Puppet for Docker Vagrant Box
node default {
    # apt
    class { 'apt': }

    apt::source { 'docker':
        location => "http://get.docker.io/ubuntu",
        key => "36A1D7869245C8950F966E92D8576A8BA88D21E9",
        release => "docker",
        repos => "main",
        include_src => false
    }

    package { 'raring-kernel':
        name => 'linux-image-generic-lts-raring',
        ensure => present
    }

    package { 'lxc-docker':
        require => [apt::source["docker"], Package["raring-kernel"]]
    }
}

(This follows Docker's guide on installing on Ubuntu 12.04 LTS.)

Unfortunately, I'm running into problems with this, as Docker more-or-less requires a later kernel (>=3.9), which is why the linux-image-generic-lts-raring package is declared as a dependency. It's also necessary to be running this kernel to be able to use LXC (and by injunction, Docker) properly.

After running vagrant up or vagrant provision, I restart the box to be able to boot into the new kernel.

Unfortunately, the VirtualBox Guest Additions don't seem to be registered with DKMS properly:

Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant

Is there a simple way to get a box based on precise64 with the Raring kernel running and installed properly? I'd like to be able to quickly get going with a virtualized environment ready for Docker experimentation.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Evidently, Phusion packages their own Ubuntu 12.04 Vagrant boxes which run the required 3.8 kernel to make it easier to use Docker. They also provide the memory and swap accounting kernel init parameters to make these features available to LXC.

To use these boxes, simply update the box name and URL in your Vagrantfile:

# ...
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.box = "phusion-open-ubuntu-12.04-amd64"
    config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/ubuntu-12.04.3-amd64-vbox.box"
    # ...
end

Note that it's still necessary to provision the Docker package and repository as above.

Note also that in order to resolve the Hiera warning, a solution can be found in this answer on another question.

Now it should be extremely easy to start playing around with Docker by using Vagrant:

$ git clone git@github.com:rfkrocktk/docker-vagrant-playground.git
$ cd docker-vagrant-playground
$ vagrant up
$ vagrant ssh

Hopefully this helps someone in the future.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.