Xenial vagrant image is missing its hostname in /etc/hosts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-images |
Fix Released
|
Undecided
|
Dan Watkins | ||
livecd-rootfs (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
High
|
Brian Murray |
Bug Description
The vagrant build for xenial is missing an in /etc/hosts. This generates an error when running sudo.
ubuntu@
127.0.0.1 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@
sudo: unable to resolve host ubuntu-xenial
see the error ^^^^
ubuntu@
Related branches
Ubuntu Foundations Team Bug Bot (crichton) wrote : | #1 |
tags: | added: bot-comment |
Launchpad Janitor (janitor) wrote : | #2 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in ubuntu: | |
status: | New → Confirmed |
Leo Tindle (leonexis) wrote : | #3 |
Adding the following line to /etc/hosts will work around this issue:
127.0.1.1 ubuntu-xenial
According to Ubuntu's profile on https:/
Mostafa Razavi (elektito) wrote : | #4 |
Unfortunately the above-mentioned fix is not possible when your Vagrantfile contains extra network configuration. In those cases, you get something like this before you get a chance to update the hosts file:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
sudo: unable to resolve host ubuntu-xenial
mesg: ttyname failed: Inappropriate ioctl for device
This renders the image useless to many who want to use it with a non-trivial Vagrantfile.
Bryan Wyatt (brwyatt) wrote : | #5 |
This also prevents changing the box's hostname, as the command `sudo hostname -f` not only gets the sudo warning on stdout as mentioned above, but the `hostname -f` also fails with a non-zero exit code since resolution fails.
Changed in cloud-images: | |
status: | New → Confirmed |
tags: | added: xenial |
Changed in ubuntu: | |
importance: | Undecided → High |
Adam Chou (adam-chou) wrote : | #6 |
Just to expand on this, this issue is also present in the latest Xenial AWS AMI, with ID ami-64140d0e. This makes running Xenial on AWS difficult, to say the least.
Nayeem Syed (developerinlondon) wrote : | #7 |
is there any fixes to this? If we can look at the code that creates the vagrant-image I am happy to try to find a fix for it?
Chris Pick (cpick) wrote : | #8 |
@Nayeem I *believe* the image building process is described here:
https:/
GGeorg (georg-ubuntu-com) wrote : | #9 |
- live-build.patch Edit (383 bytes, text/plain)
as far as i could see the problem is within the package live-build which is used to build the cloud-images
There is a hook for vagrant. i assume this is rather bogus, the hostname should not be something that changes per relesase, its better to have some solid default like "localhost" that is resolveable using /etc/hosts without any additional component. This will fix the issue for vagrant cloud images without breaking other images.
affects: | ubuntu → livecd-rootfs (Ubuntu) |
GGeorg (georg-ubuntu-com) wrote : | #10 |
- Vagrantfile Edit (279 bytes, text/plain)
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"
Error:
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
Ubuntu Foundations Team Bug Bot (crichton) wrote : | #11 |
The attachment "live-build.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]
tags: | added: patch |
LoOoD (gman) wrote : | #12 |
How were precise and trusty images built? They worked fine.
christophe (christophe-bornet) wrote : | #13 |
On trusty, the hostname was not in /etc/hosts and it was working fine. The real issue here is that sudo looks into DNS before hostname.
In /etc/nsswitch.conf, we had on trusty:
hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns
We now have:
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
christophe (christophe-bornet) wrote : | #14 |
Actually, we now have:
hosts: files mdns4_minimal [NOTFOUND=return] dns
since libnss-myhostname is not installed
Changed in cloud-images: | |
milestone: | none → y-2016-06-02 |
Changed in cloud-images: | |
assignee: | nobody → Dan Watkins (daniel-thewatkins) |
Bob Tanner (tanner) wrote : | #15 |
Still see the problems with 'ubuntu/xenial64' (v20160527.0.0)
Switching from the user vagrant and ssh key authentication to user ubuntu and password authentication lets things progress a little further but run into hostname problem.
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
sudo: unable to resolve host ubuntu-xenial
mesg: ttyname failed: Inappropriate ioctl for device
Which looks like this is tracked in:
Dan Watkins (oddbloke) wrote : | #16 |
So I have just looked in to this, and I can't reproduce it. I did the following:
$ vagrant --version
Vagrant 1.8.1
$ vagrant init ubuntu/xenial64
<snip>
$ vagrant up
<snip>
$ vagrant ssh -- sudo grep hosts /etc/nsswitch.conf
hosts: files dns
(I've also done some interactive sudo'ing in there, and I haven't seen any issues)
I've done this with both the default hostname, and setting a hostname in the Vagrantfile.
If someone can provide full reproduction steps, I'd be more than happy to reopen this and address it, but as of now I can't find a bug to fix. :)
Changed in cloud-images: | |
status: | Confirmed → Incomplete |
Changed in livecd-rootfs (Ubuntu): | |
status: | Confirmed → Incomplete |
Toni Viemerö (todeveni-deactivatedaccount) wrote : | #17 |
Host: OS X 10.11.5, VirtualBox 5.0.20
⇒ vagrant --version
Vagrant 1.8.1
⇒ vagrant init ubuntu/xenial64
<snip>
⇒ vagrant box list|grep xenial
ubuntu/xenial64 (virtualbox, 20160531.0.0)
⇒ vagrant up
<snip>
⇒ vagrant ssh -- sudo grep hosts /etc/nsswitch.conf
sudo: unable to resolve host ubuntu-xenial
hosts: files dns
Dan Watkins (oddbloke) wrote : | #18 |
Hmm, thanks for that, Toni.
I'm on Virtualbox 5.0.18, so I'm building 5.0.20 to test that version on my machine.
Chris Pick (cpick) wrote : | #19 |
To confirm Toni's comment, my testing yields the same result:
$ vboxmanage --version
5.0.20r106931
$ vagrant --version
Vagrant 1.8.1
$ vagrant box list | grep xenial
ubuntu/xenial64 (virtualbox, 20160531.0.0)
$ vagrant init ubuntu/xenial64
$ vagrant up
$ vagrant ssh -- sudo grep hosts /etc/nsswitch.conf
sudo: unable to resolve host ubuntu-xenial
hosts: files dns
Chris Pick (cpick) wrote : | #20 |
Dan if it helps reproduce:
I'm running a 64bit trusty host using the "virtualbox-5.0" package from the "deb http://
Bob Tanner (tanner) wrote : | #21 |
I'll be surprised if the problem is in the Virtualbox 5.0.20, what is the xenial image you are testing against Dan? Your vagrant box list | grep xenial?
I had the same problem with 5.0.18, but no longer have it installed.
Dan Watkins (oddbloke) wrote : | #22 |
$ vagrant box list | grep xenial
Odd_Bloke/xenial64 (virtualbox, 20160319.0.0)
ubuntu/xenial64 (virtualbox, 20160319.0.0)
ubuntu/xenial64 (virtualbox, 20160418.0.0)
ubuntu/xenial64 (virtualbox, 20160420.3.0)
ubuntu/xenial64 (virtualbox, 20160521.0.0)
ubuntu/xenial64 (virtualbox, 20160531.0.0)
xenial-release (virtualbox, 0)
xenial64 (virtualbox, 0)
So... I'm very confused as to why I'm not seeing this. :)
Dan Watkins (oddbloke) wrote : | #23 |
(I have tested 5.0.20; I still can't reproduce)
LoOoD (gman) wrote : | #24 |
$ : vboxmanage --version
5.0.20r106931
$ : vagrant --version
Vagrant 1.8.0
$ : vagrant box list |grep -i xenial
$ : vagrant init ubuntu/xenial64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ : vagrant plugin list
vagrant-share (1.1.5, system)
$ : vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/xenial64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/xenial64'
default: URL: https:/
==> default: Adding box 'ubuntu/xenial64' (v20160531.0.0) for provider: virtualbox
default: Downloading: https:/
==> default: Successfully added box 'ubuntu/xenial64' (v20160531.0.0) for 'virtualbox'!
==> default: Importing base box 'ubuntu/
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: Setting the name of the VM: ubuntu-
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: ubuntu
default: SSH auth method: password
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
$ : vagrant ssh -- sudo grep hosts /etc/nsswitch.conf
sudo: unable to resolve host ubuntu-xenial
hosts: files dns
$ : vagrant ssh -- sudo grep ubuntu /etc/hosts
sudo: unable to resolve host ubuntu-xenial
$ : vagrant ssh -- sudo grep 127 /etc/hosts
sudo: unable to resolve host ubuntu-xenial
127.0.0.1 localhost
LoOoD (gman) wrote : | #25 |
Dan, could you also run these commands?? And purge all your boxes before "vagrant up"?
vagrant ssh -- sudo grep ubuntu /etc/hosts
vagrant ssh -- sudo grep 127 /etc/hosts
Bob Tanner (tanner) wrote : | #26 |
host: OS X 10.11.5
$ vboxmanage --version
5.0.20r106931
$ vagrant --version
Vagrant 1.8.1
$ vagrant init ubuntu/xenial64
<snip>
$ vagrant box list|grep xenial
ubuntu/xenial64 (virtualbox, 20160531.0.0)
$ vagrant up
<snip>
$ vagrant ssh -- sudo grep hosts /etc/nsswitch.conf
sudo: unable to resolve host ubuntu-xenial
hosts: files dns
$ vagrant ssh -- sudo grep ubuntu /etc/hosts
sudo: unable to resolve host ubuntu-xenial
$ vagrant ssh -- sudo grep 127 /etc/hosts
sudo: unable to resolve host ubuntu-xenial
127.0.0.1 localhost
$ cat /etc/hosts
127.0.0.1 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
Garrick P. (gpeterson-j) wrote : | #27 |
Also seeing this:
$ vboxmanage --version
5.0.10r104061
$ vagrant --version
Vagrant 1.8.1
$ vagrant box list |grep -i xenial
ubuntu/xenial64 (virtualbox, 20160420.3.0)
ubuntu/xenial64 (virtualbox, 20160509.0.0)
ubuntu/xenial64 (virtualbox, 20160531.0.0)
$ vagrant init ubuntu/xenial64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/xenial64' is up to date...
==> default: Setting the name of the VM: ubuntu-
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: ubuntu
default: SSH auth method: password
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Authentication failure. Retrying...
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
$ vagrant ssh -- sudo grep hosts /etc/nsswitch.conf
sudo: unable to resolve host ubuntu-xenial
hosts: files dns
$ vagrant ssh -- sudo grep ubuntu /etc/hosts
sudo: unable to resolve host ubuntu-xenial
$ vagrant ssh -- sudo grep 127 /etc/hosts
sudo: unable to resolve host ubuntu-xenial
127.0.0.1 localhost
Chris Pick (cpick) wrote : | #28 |
Dan, is it possible that there's a resolver on your machine/network that is resolving that hostname for you?
Changed in cloud-images: | |
milestone: | y-2016-06-02 → none |
LoOoD (gman) wrote : | #29 |
Can we unmark this as "Incomplete"?
Dan Watkins (oddbloke) wrote : | #30 |
It turns out that it _isn't_ resolving, which my ISP then redirects to a portal to try and get advertising clicks. Thanks, BT.
Changed in cloud-images: | |
status: | Incomplete → Confirmed |
Changed in livecd-rootfs (Ubuntu): | |
status: | Incomplete → Confirmed |
Robert Hafner (tedivm) wrote : | #31 |
Can confirm I am also running into this. It's preventing vagrant configurations that involve private networking from loading as this error stops the provisioning process- basically making it impossible to use these images for testing certain (fairly common) scenarios using vagrant.
If there's a reason to keep the hostname out of /etc/hosts then disabling DNS in sudo and ssh should resolve some of the issues.
Keilo (keilo) wrote : | #32 |
I am able to reproduce this as well.
Example:
-------
$ vagrant --version
Vagrant 1.8.3
$ vboxmanage --version
5.0.20r106931
$ vagrant init ubuntu/xenial64
$ vagrant box list | grep xenial
ubuntu/xenial64 (virtualbox, 20160610.0.0)
$ vagrant up
$ vagrant ssh
ubuntu@
sudo: unable to resolve host ubuntu-xenial
127.0.0.1 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
-------
In the above command line log you can see "sudo: unable to resolve host ubuntu-xenial".
The error makes it difficult to automatically configure the vm because commands return non zero exit status due to this error.
Pri Vate (pri-v-ate) wrote : | #33 |
==> default: Box 'ubuntu/xenial64' (v20160615.1.0) is running the latest version.
vagrant --version
Vagrant 1.8.1
vboxmanage --version
5.0.20r106931
(Host OS)
uname -a
15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu 3248.50.
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
sudo: unable to resolve host ubuntu-xenial
mesg: ttyname failed: Inappropriate ioctl for device
Pri Vate (pri-v-ate) wrote : | #34 |
The problem went away after upgrading to the following versions.
vagrant --version
Vagrant 1.8.4
vboxmanage --version
5.0.22r108108
Keilo (keilo) wrote : | #35 |
I can confirm this issue is also present when running on macOS.
-------
$ uname -a
Darwin 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-
$ vagrant --version
Vagrant 1.8.4
$ vboxmanage --version
5.0.22r108108
$ vagrant box list | grep xenial
ubuntu/xenial64 (virtualbox, 20160615.1.0)
$ vagrant init ubuntu/xenial64
$ vagrant ssh
$ sudo cat /etc/hosts
sudo: unable to resolve host ubuntu-xenial
127.0.0.1 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
-------
Note the "sudo: unable to resolve host ubuntu-xenial" above.
Bob Tanner (tanner) wrote : | #36 |
Is there a HOWTO or link for how to build the xenial image?
Might be easier for us to help troubleshoot the problem if we could build the xenial image, fix what's wrong, and submit the patches back?
Robert Hafner (tedivm) wrote : | #37 |
There is a really amazingly simple work around to this problem that works without needing a custom box.
In your VagrantFile use the config.vm.hostname option to specify a hostname-
config.vm.hostname = "vagrant"
That will change the hostname before the networking and provisioning steps occur (I'm not sure how, but I did confirm this was true) and allow you to set the custom options you'd like.
Bob Tanner (tanner) wrote : Re: [Bug 1561250] Xenial vagrant image is missing its hostname in /etc/hosts | #38 |
> On Jun 19, 2016, at 7:51 PM, Robert Hafner <email address hidden> wrote:
>
> In your VagrantFile use the config.vm.hostname option to specify a
> hostname-
>
> config.vm.hostname = "vagrant"
Still get the error.
config.vm.define "testing_xenial64" do |testing_xenial64|
testing_
config.
config.
$ vagrant up --provision testing_xenial64
<snip>
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: Name or service not known
--
Bob Tanner <email address hidden> | Phone : 952-943-8700
http://
Key fingerprint = 9906 320A 8BB6 64AD 96A7 7785 CBFB 10BF 568B F98C
j bennett (jkbe) wrote : | #39 |
Based on #13 and related comments, I noticed that on my AWS account I wasn't getting a Public DNS assigned each time I launched ami-08490c68.
Found this link to resolve that by adding a Virtual Private Cloud (VPC) per this link:
http://
Adding the VPC seemed to have fixed the Public DNS issue and the "unable to resolve host" issue on my running instance and a new one as the Public DNS is showing up now.
Not a fix, but seems like it is a work around for my AWS based stuff and clarified a bit some of the other comments on this thread above for me.
Bob Tanner (tanner) wrote : | #40 |
Any status update?
'ubuntu/xenial64' (v20160627.0.0) for 'virtualbox' still has the problem.
Repeating my 06/19 post:
Is there a HOWTO or link for how to build the xenial image?
Might be easier for us to help troubleshoot the problem if we could build the xenial image, fix what's wrong, and submit the patches back?
Robert Hafner (tedivm) wrote : | #41 |
This bug- which literally just required a line in the hosts file- is still not resolved months later. Does the cloud team just not want people to upgrade to the latest LTS version? I can't imagine any other reason to ignore this issue, especially considering it's easy fix.
Dan Watkins (oddbloke) wrote : | #42 |
Hello all,
The Vagrant boxes are important to us, and we do want them to be a high-quality Ubuntu experience. That said, our limited resources have been focussed on improving that experience in the images which people use in production. We would like to have the time to work on everything that needs attention but, regrettably, that isn't the situation we're in.
Louis Zuckerman has very kindly taken the time to work out how the images are built, and contributed a patch which may address this; I've built a (yakkety) box from his changes at http://
Thanks,
Dan
LoOoD (gman) wrote : | #43 |
Dan, will you be building an updated xenial image from the contributed patch or will only releases greater then 16.04 only have the fix?
Robert Hafner (tedivm) wrote : | #44 |
Presumably they'll stick to the "S" in LTS and backport this change, but I can understand their desire to test it quickly before diving in.
I also understand limited resources. However, I think a reprioritization is in order here. This bug was not a difficult or time consuming one to solve. Further, in order for people to use Ubuntu in production environments they have to use them in test environments. Vagrant allows us to do this easily, and for people developing software or looking at upgrading infrastructure and looking to test compatibility it's really nice to have a quick to use (and free) server that we can test on. This bug has actually stopped my company from upgrading our main infrastructure to the latest LTS because of our use of vagrant for testing and development.
GGeorg (georg-ubuntu-com) wrote : | #45 |
- vagrantfile Edit (11.6 KiB, text/html)
Hi,
in case you are stuck, here is my workaround that should bring back most of the default features.
To be fair, this could also be fixed very easy by a way simpler approach using cloud-inits user-data feature within vagrant. All it would need is this line in the box user-data image in ubuntu-
manage_etc_hosts: localhost
In the ubuntu-
I cloud not find the code that creates ubuntu-
Dan Watkins (oddbloke) wrote : | #46 |
This change will be backported to xenial, but only once we've heard that we've actually fixed it.
Robert, GGeorg, LoOoD, does the box I provided fix the issue?
(Also, Robert, I really do understand the frustration but this wasn't actually as simple a fix as you seem to think; Vagrant boxes should have their hostname set dynamically at boot, which means you can't simply write out the hostname to /etc/hosts during the image build process. And when you add in to this the fact that a lot of behaviour that is clearly expected of Vagrant boxes isn't actually documented anywhere[0], any fix becomes time-consuming as you have to try and work out what the expected behaviour is by looking at other Vagrant boxes.)
[0] Search for "host" in https:/
GGeorg (georg-ubuntu-com) wrote : | #47 |
Hi Dan,
could you provide the patch so we could review it ? The box file you provided is in no way compareable to cloud-images.
The box file is about twice the size - so it was built in another way.
I think the only proper way to fix this (no change in filesystem or installed packets) is changing the config drive user-data .. which should be not hard to implement and is isolated to vagrant only cloud-image ..
Could you relay us the process Louis Zuckerman layed out - so we could provide a patch ? I was unable to find the script that creates the cloud-images on cloud-images.
regards
Georg
Dan Watkins (oddbloke) wrote : Re: [Bug 1561250] Re: Xenial vagrant image is missing its hostname in /etc/hosts | #48 |
Hi Georg,
On 06/07/16 09:55, GGeorg wrote:
> could you provide the patch so we could review it ? The box file you
> provided is in no way compareable to cloud-images.
The box file I provided is what we expect to become the cloud image; it
is directly comparable. :)
> The box file is about twice the size - so it was built in another way.
It wasn't built another way, but it was built to contain more useful
packages.
> I think the only proper way to fix this (no change in filesystem or
> installed packets) is changing the config drive user-data .. which
> should be not hard to implement and is isolated to vagrant only cloud-
> image ..
We're happy to make Vagrant-specific changes to the Vagrant image, so we
can change this in the filesystem.
> Could you relay us the process Louis Zuckerman layed out - so we could
> provide a patch ? I was unable to find the script that creates the
> cloud-images on cloud-images.
You can find the changes Louis has proposed at [0], which also includes
how he tested his changes. (The images on cloud-images.
produced using Launchpad's buildds; all of the software that is used is
open-source, but for security reasons access to the build farm is
restricted to Canonical employees; the image provided above was built
using the buildds.)
[0]
https:/
GGeorg (georg-ubuntu-com) wrote : | #49 |
@Dan: Thx for your feedback i checked the diff at: https:/
Absolutly see your point in the buildds infrastructure :)
Here is my feedback:
* libnss-myhostname will fix _this_ problem but might break things for other users, i would not recommend going this route as it changes an already released package list and image. Bad for LTS i would suggest to use the existing and already proven cloud-init way to handle /etc/hosts like mentioned above - this has been proven to work for aws and other cloud providers.
* If the future image has 557 MB vs 282 MB at the current - than please dont fix it :) seriously if a box update takes twice the time it took before the change, the change is broken. Changeing all this for a LTS breaks the idea of having lts.
cloud-images - in my point of view - should contain only the bare minimum, if the user wants additional software there are multiple ways to do so in vagrant or to provide meta-data with cloud-init. Lets yust see what hashicorp tells us todo:
https:/
There are a special category of boxes known as "base boxes." These boxes contain the bare minimum required for Vagrant to function, are generally not made by repackaging an existing Vagrant environment (hence the "base" in the "base box").
adding: virtualbox-
makes sense even so its not needed (user can install it with provisioner and add the mount point)
adding:
nfs-common
puppet
chef
byobu
juju
ruby
will break stuff and is not needed - because were to stop ? next person will request cfengine to be included ?! IMHO not a good idea - but yust my 2 cents ..
Dan Watkins (oddbloke) wrote : | #50 |
On 06/07/16 11:32, GGeorg wrote:
> * libnss-myhostname will fix _this_ problem but might break things for
> other users, i would not recommend going this route as it changes an
> already released package list and image. Bad for LTS i would suggest to
> use the existing and already proven cloud-init way to handle /etc/hosts
> like mentioned above - this has been proven to work for aws and other
> cloud providers.
Ah, this is a good point, I'll comment on the MP as such.
> * If the future image has 557 MB vs 282 MB at the current - than please
> dont fix it :) seriously if a box update takes twice the time it took
> before the change, the change is broken. Changeing all this for a LTS
> breaks the idea of having lts.
So I don't disagree in general with this sentiment about LTS releases.
That said, this could all be considered regression from pre-xenial
Vagrant boxes, so we are fixing bugs in the released version.
> adding: virtualbox-
> makes sense even so its not needed (user can install it with provisioner and add the mount point)
> adding:
> linux-headers-
> nfs-common
> python-apport
> puppet
> chef
> byobu
> juju
> ruby
>
> will break stuff and is not needed - because were to stop ? next person
> will request cfengine to be included ?! IMHO not a good idea - but yust
> my 2 cents ..
This list is what's in the trusty Vagrant box; have you ever noticed it
being a problem there? ;) That said, I was on the fence about this, so
we should probably consider the packages that should be added separately
to addressing the more fundamental issue.
GGeorg (georg-ubuntu-com) wrote : | #51 |
@dan: agree with trusty release .. but i think that discussion should be on another changerequest :)
Louis Zuckerman (semiosis) wrote : | #52 |
Here's the bug for discussing whether or not to include config management packages in the vagrant box:
https:/
Please add your thoughts there if you have an opinion.
Thanks!
Launchpad Janitor (janitor) wrote : | #53 |
This bug was fixed in the package livecd-rootfs - 2.421
---------------
livecd-rootfs (2.421) yakkety; urgency=medium
[ Louis Zuckerman ]
* Fixes for vagrant box builder in ubuntu-cpc LP: #1565985
- Install virtualbox-
- Don't disable default synced folder
- Don't set vm name
- Add cloud-init config to manage /etc/hosts LP: #1561250
-- Steve Langasek <email address hidden> Thu, 21 Jul 2016 09:14:50 -0700
Changed in livecd-rootfs (Ubuntu): | |
status: | Confirmed → Fix Released |
Keilo (keilo) wrote : | #54 |
Does not appear to be resolved in ubuntu/xenial64 20160721.0.0
Louis Zuckerman (semiosis) wrote : | #55 |
christophe (christophe-bornet) wrote : | #56 |
About libnss-myhostname. This was how it was done in the trusty box. Not saying it should be done that way in xenial though...
Devis (devis) wrote : | #57 |
FWIW this code in bootstrap.sh should help mitigating the issue:
if ! grep -q $(cat /etc/hostname) /etc/hosts; then
echo >> /etc/hosts
echo 127.0.0.1 $(cat /etc/hostname) >> /etc/hosts
fi
Changed in livecd-rootfs (Ubuntu Xenial): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Brian Murray (brian-murray) |
Chris J Arges (arges) wrote : Please test proposed package | #58 |
Hello LoOoD, or anyone else affected,
Accepted livecd-rootfs into xenial-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
Changed in livecd-rootfs (Ubuntu Xenial): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed |
Louis Zuckerman (semiosis) wrote : | #59 |
Fix confirmed.
Here's how I tested:
- Downloaded current xenial vagrant box and started a VM from it
- Enabled xenial-proposed repository
- Installed livecd-rootfs from -proposed, version 2.408.3
- ran the following commands...
sudo -i
mkdir /build
cd /build
cp -a /usr/share/
export SUITE=xenial
export ARCH=amd64
export PROJECT=ubuntu-cpc
export MIRROR=http://
lb config
cd config/hooks
rm 031-root-xz.binary 033-disk-
lb build
- Copied the created vagrant box from /build/
- Checked that new VM had randomized name and that default synced folder was mounted. Also checked that sudo did not complain about hostname resolution.
Looks good to me!
tags: |
added: verification-done removed: verification-needed |
Matt Willsher (mawi) wrote : Returned mail: User unknown | #60 |
The original message was received at 2016-08-31 19:11:25 +0000
fatal errors ----
<email address hidden>
UmVwb3J0aW5nLU1
ICAgICAgUmVjZWl
ICAgICAgICAgICA
ICAgICAgICAgICA
MEBidWdzLmxhdW5
aWxlZAogICAgICA
ICAgICAgICAgICA
ICAgICAgICAgICA
b3IgaWxsZWdhbCB
ICAgICAgICAgICA
MAo=
Launchpad Janitor (janitor) wrote : | #61 |
This bug was fixed in the package livecd-rootfs - 2.408.3
---------------
livecd-rootfs (2.408.3) xenial-proposed; urgency=medium
[ Louis Zuckerman ]
* Fixes for vagrant box builder in ubuntu-cpc LP: #1565985
- Install virtualbox-
- Don't disable default synced folder
- Don't set vm name
- Add cloud-init config to manage /etc/hosts LP: #1561250
-- Brian Murray <email address hidden> Tue, 30 Aug 2016 13:17:55 -0700
Changed in livecd-rootfs (Ubuntu Xenial): | |
status: | Fix Committed → Fix Released |
Martin Pitt (pitti) wrote : Update Released | #62 |
The verification of the Stable Release Update for livecd-rootfs has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
Louis Zuckerman (semiosis) wrote : | #63 |
The new daily xenial build for 20160907 includes the fix.
Changed in cloud-images: | |
status: | Confirmed → Fix Released |
Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https:/ /wiki.ubuntu. com/Bugs/ FindRightPackag e. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.
To change the source package that this bug is filed about visit https:/ /bugs.launchpad .net/ubuntu/ +bug/1561250/ +editstatus and add the package name in the text box next to the word Package.
[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]