Create a Vagrant ubuntu lts box via Packer
- Clone
- Build
- Vagrant usage
- Publish
- Consume
git clone https://github.com/viv-garot/packer-bionic64
cd packer-bionic64
packer build bionic64.json
vagrant box add --name bionic64 bionic64-vbox.box
vagrant init -m bionic64
vagrant up
vagrant ssh
or
ssh vagrant@127.0.0.1 -p 2222
(password = vagrant) (port 2222 is hardcoded in bionic64.json)
vagrant destroy
vagrant box remove bionic64
vagrant cloud auth login
Note : If you have Two-Factor authentication enabled the login will fail with the bellow error
- Two-factor authentication is enabled! Vagrant Cloud does not support creating (VagrantCloud::Error::ClientError::RequestError)
access tokens via the API when the user has two-factor authentication
enabled. Please create an access token using the Vagrant Cloud website and store
the result in the 'ATLAS_TOKEN' environment variable.
- Create a token on Vagrant Cloud if not performed already
- And export the result in the 'ATLAS_TOKEN' environment variable
export ATLAS_TOKEN=<generated-token>
- Then try again to login
vagrant cloud auth login
vagrant cloud box create <user>/<box> --no-private
e.g.
vagrant cloud box create vivien/bionic64 --no-private
vagrant cloud publish --box-version `date +%y.%m.%d` \
--force --no-private --release <user>/<box> \
`date +%y.%m.%d` virtualbox bionic64-vbox.box
e.g.
vagrant cloud publish --box-version `date +%y.%m.%d` \
--force --no-private --release vivien/bionic64 \
`date +%y.%m.%d` virtualbox bionic64-vbox.box
mkdir myboxes
cd myboxes
vagrant init -m <user>/<box>
e.g.
vagrant init -m vivien/bionic64
vagrant up