Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting Hostname failure in 1.3.4 #2309

Closed
regilero opened this issue Oct 3, 2013 · 22 comments
Closed

Setting Hostname failure in 1.3.4 #2309

regilero opened this issue Oct 3, 2013 · 22 comments
Labels

Comments

@regilero
Copy link

regilero commented Oct 3, 2013

Upgrading from 1.3.3 to 1.3.4 make my Vagrantfile fail for an Ubuntu 12.04 box.

[default] Setting hostname...
No error message

This may be related to #2254 where the hostname manipulation in /etc/hosts has been altered.
My hostname config is:

config.vm.host_name = "devhost.local"

After the failure vagrant ssh is still working, checking the /etc/hosts file I found:

127.0.1.1 devhost.local

instead of expected:

127.0.1.1 devhost.local devhost localhost

And when using sudo commands in this VM I have warning message about sudo: unable to resolve host devhost

@gmiroshnykov
Copy link

I was about to create the same bugreport, so here's some more details.

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise32"
  config.vm.box_url = "http://files.vagrantup.com/precise32.box"
  config.vm.hostname = "vagrant.dev"
end

Output:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise32'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2200 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] Setting hostname...
No error message

Full debug log:
https://gist.github.com/laggyluke/6807646

@dwijnand
Copy link

dwijnand commented Oct 4, 2013

Having this issue as well :(

@dsnyder0pc
Copy link

I'm having this issue also on Vagrant 1.3.4. Vagrant reports "No error message" after "Setting hostname..." and does not perform provisioning. It also seems to take Vagrant longer than v1.2.7 did to recognize that the guest has booted. I'm rolling back to the latest 1.2.x for now.

@johntron
Copy link
Contributor

johntron commented Oct 7, 2013

Same problem. 1.3.3 works, so I downgraded.

@oliveiraev
Copy link

Same here. Browsed thru all the related issues and this ticket seems to be the older.

Same scenario applies:

  • Guest: Ubuntu 13.04 64bit
  • Vagrant version: 1.3.4

Vagrant hangs at No error message whithout provisioning neither mapping guest's /vagrant to project root.

Work'd it around putting the desired hostname on guest's /etc/hosts file.

@delmendo
Copy link

delmendo commented Oct 9, 2013

+1 (so I can track this bug). I worked around with a shell provisioner

$script = <<SCRIPT
echo "Shell Provisioning Work Around"
hostname "my_hostname"
SCRIPT
config.vm.provision "shell", inline: $script

@elmer
Copy link

elmer commented Oct 9, 2013

this affects me as well

@oliveiraev
Copy link

@delmendo I had fixed it through ssh access vagrant ssh -c 'sudo hostname {desired_hostname}'

Anyway, both approaches fall into the needing of vagrant reload for the very first time that the boxe changes its name.

The provisioner script run after the internal hostname change.

I've figured out that - in my particular case - trying to rename the box to fluxo-evandro led to fluxo-evandro-evandro if it can help in any way.

@nmische
Copy link
Contributor

nmische commented Oct 9, 2013

I'm hitting this issue as well.

@fooblahblah
Copy link

+1 - delmendo's work-around is working for me.

@fs111
Copy link

fs111 commented Oct 9, 2013

We have a 4 node cluster setup (https://github.com/Cascading/vagrant-cascading-hadoop-cluster) and b/c of this problem, vagrant bails out after the first vm. 1.3.3 works though.

@leek
Copy link

leek commented Oct 10, 2013

👎

Experiencing this same issue...

@thariman
Copy link

Same issue here vagrant 1.3.4 on Mac OS X 10.8.5 running ubuntu raring server

DEBUG ssh: stderr: sudo: unable to resolve host fuel-dev
DEBUG ssh: stderr: stdin: is not a tty
DEBUG ssh: stderr: hostname: Name or service not known
DEBUG ssh: Exit status: 1

@WMeldon
Copy link

WMeldon commented Oct 11, 2013

Getting this with 1.3.4 on Mac and Windows using Raring 64 bit.

@loxley
Copy link

loxley commented Oct 14, 2013

Hitting the same on Archlinux, perhaps should rename issue to just "Setting Hostname failure in 1.3.4".

@regilero
Copy link
Author

@loxley : issue rename done

@mdkent
Copy link

mdkent commented Oct 14, 2013

+1 here on 1.3.4

[test-app-precise] Creating shared folders metadata...
[test-app-precise] Clearing any previously set network interfaces...
[test-app-precise] Preparing network interfaces based on configuration...
[test-app-precise] Forwarding ports...
[test-app-precise] -- 22 => 2222 (adapter 1)
[test-app-precise] Running 'pre-boot' VM customizations...
[test-app-precise] Booting VM...
[test-app-precise] Waiting for machine to boot. This may take a few minutes...
[test-app-precise] Machine booted and ready!
[test-app-precise] Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

hostname --fqdn > /etc/mailname

Stdout from the command:



Stderr from the command:

sudo: unable to resolve host test-app-precise
stdin: is not a tty
hostname: Name or service not known

@mitchellh
Copy link
Contributor

FIxed by #2334

@dylanlgs
Copy link

This issue has been reintroduced in 1.4.1. Ubuntu 13.04 64bit on the guest, OS X 10.8.5 on the host, with VirtualBox.

@regilero
Copy link
Author

@dylanlgs : this is a closed issue, maybe you should make a new one and add a reference to this one inside.

@mikhail-gaponov
Copy link

I have the same issue:

[master] Machine booted and ready!
[master] Setting hostname...
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 (none)
stdin: is not a tty
hostname: Name or service not known

@drpebcak
Copy link

drpebcak commented Feb 3, 2014

@mikhail-gaponov this is a closed issue, maybe you should make a new one and add a reference to this one inside. Make sure you include some more information, like what version of Vagrant and VirtualBox you are using, what your host and guest OS versions are, what your vagrantfile looks like, etc.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests