How to create ubuntu 16 vagrant VM box

Some VM box names for ubuntu 16 are not working, e.g.

1
2
config.vm.box = "ubuntu/xenial64"
config.vm.box = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-vagrant.box"

The main problem for above two name/url is that after creating VM box, the default user ‘ubuntu’ cannot login. The expected user ‘vagrant’ was not created.

The working version (in Vagrantfile):

1
2
3
4
5
6
7
8
9
10
11
12
13
Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 1
end
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "forwarded_port", guest: 80, host: 80
......
end
Share