Upgrading and creating new virtualbox vagrant boxes from the standard precise32 box

Problem

You would like to use a current version of a Virtualbox vagrant box, based on the official precise32 box, like saucy32.

Solution

  • Build your first vagrant box using the precise32 box
  • Install any packages that you need
  • Upgrade your distribution by doing the following:
    1. Make sure that the package update-manager-core is installed and install it if it isn’t:
      sudo apt-get install update-manager-core
    2. Change the prompt from lts to normal in the file /etc/update-manager/release-upgrades:
      sudo vi /etc/update-manager/release-upgrades
      Prompt=normal
    3. And upgrade to the next version by doing:
    4. sudo do-release-upgrade -d
  • Repeat the procedure for the version you want
  • Change the hostname to the current version:
    sudo vi /etc/hostname
    sudo vi /etc/hosts
    quantal32
  • Logout from the box and package it:
    vagrant package --output /home/path_to_new/packagename.box
  • Add the box to the list of boxes:
    vagrant box add quantal32 /home/path_to_new/packagename.box
  • You can use your new box now in a new vagrant box:

    vagrant init --packagename.box