[Bug 1561250] Re: Xenial vagrant image is missing its hostname in /etc/hosts

GGeorg georg-ubuntu.com at glas.eu.org
Mon May 9 09:51:38 UTC 2016

Root Cause:

Setting the hostname to "ubuntu-${release}" in cloud-images causes the
hostname not to be resolvable using /etc/hosts. Running hostname -f will
fail due to unresolveable default hostname causing a failure when
setting up the proper hostname by vagrant.

Suggested Fix:

Set the hostname to "localhost"

How to reproduce (Option 1):

1.) Install Oracle Virtualbox
2.) Install Vagrant
3.) Create a empty directory and download attached VagrantFile 
4.) Run "vagrant up"


The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

hostname -f

Stdout from the command:

Stderr from the command:

sudo: unable to resolve host ubuntu-xenial
mesg: ttyname failed: Inappropriate ioctl for device
hostname: No address associated with hostname

** Attachment added: "Vagrantfile"

You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to livecd-rootfs in Ubuntu.

  Xenial vagrant image is missing its hostname in /etc/hosts

Status in cloud-images:
Status in livecd-rootfs package in Ubuntu:

Bug description:
  The vagrant build for xenial is missing an in /etc/hosts. This
  generates an error when running sudo.

  ubuntu at ubuntu-xenial:~$ cat /etc/hosts localhost

  # The following lines are desirable for IPv6 capable hosts
  ::1 ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  ff02::3 ip6-allhosts
  ubuntu at ubuntu-xenial:~$ sudo echo see the error ^^^^
  sudo: unable to resolve host ubuntu-xenial
  see the error ^^^^
  ubuntu at ubuntu-xenial:~$

To manage notifications about this bug go to:

More information about the foundations-bugs mailing list