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 breaks box configuration. #2318

Closed
Aethylred opened this issue Oct 4, 2013 · 2 comments
Closed

Setting hostname breaks box configuration. #2318

Aethylred opened this issue Oct 4, 2013 · 2 comments

Comments

@Aethylred
Copy link

I am running Vagrant 1.3.4 on Windows7 64-but with VirtualBox but I seem to be having an issue whenever I set config.vm.hostname. I'm using some of the puppet-bootstrap scripts, but as they run when setting the hostname is disabled, I do not think they contribute to this issue.

The box I am using was installed with:

vagrant box add ubuntu-64-x64-vbox4210-nocm http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box

Here is the Vagrantfile

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

# For the most part, this is a stock config from `vagrant init`

Vagrant.configure("2") do |config|
  # All Vagrant configuration is done here. The most common configuration
  # options are documented and commented below. For a complete reference,
  # please see the online documentation at vagrantup.com.

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "ubuntu-64-x64-vbox4210-nocm"

  # Share an additional folders to the guest VM.
  config.vm.synced_folder 'etc-puppet', '/etc/puppet'

  # Set up hostname
  config.vm.hostname = "puppet.local"

  # Change boot timeout
  config.vm.boot_timeout = 120

  # Forwarded port mapping 
  # config.vm.network :forwarded_port, guest: 80, host: 8080

  # Create a private network
  # config.vm.network :private_network, ip: "192.168.33.10"

  # Create a public network
  # config.vm.network :public_network

  # Provision scripts to install software
  # Bootstrap puppet installation
  config.vm.provision :shell, :path => 'bootstrap/ubuntu.sh'

end

And here is the output from the console

C:\Development\vagrant-test> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'ubuntu-64-x64-vbox4210-nocm'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[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...
No error message

Note that neither the synced folders are not mounted, and that the provision script is not executed. If I comment out config.vm.hostname the Vagrantfile behaves as expected (some errors reported, but not related to this issue).

C:\Development\vagrant-test> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'ubuntu-64-x64-vbox4210-nocm'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[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...
No error message
C:\Development\dynaguppy-harness [master +1 ~2 -0 !]> vagrant destroy
Are you sure you want to destroy the 'default' VM? [y/N] y
[default] Forcing shutdown of VM...
[default] Destroying VM and associated drives...
[default] Running cleanup tasks for 'shell' provisioner...
C:\Development\dynaguppy-harness [master +1 ~2 -0 !]> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'ubuntu-64-x64-vbox4210-nocm'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[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] Mounting shared folders...
[default] -- /vagrant
[default] -- /etc/puppet
[default] Running provisioner: shell...
[default] Running: C:/Users/nobody/AppData/Local/Temp/vagrant-shell20131004-9984-1kn6q91
stdin: is not a tty
Initial apt-get update...
Installing wget...
Configuring PuppetLabs repo...
Installing Puppet...
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Puppet installed!
Installing RubyGems...
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Successfully installed rubygems-update-2.1.5
1 gem installed
/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
@dwijnand
Copy link

dwijnand commented Oct 4, 2013

Duplicate of #2309 I believe

@mitchellh
Copy link
Contributor

Yeah, dup, Ill address in earlier issue. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 14, 2020
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

3 participants