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 throw an error on Fedora 20 #2745

Closed
mathroc opened this issue Jan 2, 2014 · 9 comments
Closed

setting hostname throw an error on Fedora 20 #2745

mathroc opened this issue Jan 2, 2014 · 9 comments

Comments

@mathroc
Copy link

mathroc commented Jan 2, 2014

if an hostname is set in Vagrantfile, there is an error at boot:

[default] Attempting graceful shutdown of VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (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...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

service network restart

Stdout from the command:

Restarting network (via systemctl):  [FAILED]


Stderr from the command:

Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.

journalctl -xn explains that dhclient is already running (NetworkManager started it)
but in fact, the hostname is set without needing to run this command, I commented it in /usr/lib64/ruby/gems/1.9.1/gems/vagrant-1.4.1/plugins/guests/redhat/cap/change_host_name.rb and the initialization process now proceed to configuring network interface and mounting nfs.
And once I vagrant ssh I can confirm that the hostname is correctly configured.

@shermdog
Copy link

+1

@davidpelaez
Copy link

I have the same issue and I'm not sure what alternatives there are besides not setting the hostname at all.

@ndbroadbent
Copy link

+1, this is also affecting me

@jamesdbloom
Copy link

+1

2 similar comments
@jansauer
Copy link

+1

@mal
Copy link

mal commented Jun 7, 2014

+1

@paoloantinori
Copy link

same here with 1.6.3, but with more debug info.

==> atomic1: Checking for guest additions in VM...
    atomic1: No guest additions were detected on the base box for this VM! Guest
    atomic1: additions are required for forwarded ports, shared folders, host only
    atomic1: networking, and more. If SSH fails on this machine, please install
    atomic1: the guest additions and repackage the box to continue.
    atomic1: 
    atomic1: This is not an error message; everything may continue to work properly,
    atomic1: in which case you may ignore this message.
==> atomic1: Setting hostname...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

sed -i 's/\(HOSTNAME=\).*/\1atomic1/' /etc/sysconfig/network

Stdout from the command:



Stderr from the command:

sed: can't read /etc/sysconfig/network: No such file or directory

corresponding to this Vagrantfile instruction:

integration.vm.hostname = vmname

In Fedora 20, the file that contains the hostname is in

/etc/hostname

and can be set with
hostnamectl set-hostname $VMNAME

@ahammond
Copy link

This appears to be the same issue found in #4352

@mitchellh
Copy link
Contributor

Fixed by #4352

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants