Setting the VM's hostname?

3,107 views
Skip to first unread message

mlaw...@wibidata.com

unread,
Sep 3, 2013, 7:44:26 PM9/3/13
to vagra...@googlegroups.com
Hey - I had found this link explaining how to do this:

http://docs-v1.vagrantup.com/v1/docs/config/vm/host_name.html

But it's outdated and that now throws an error:

vm:
* The following settings don't exist: host_name

The new docs don't have a Vagrantfile page up yet (gives a 404).

Anyone know how to the vm's host name in the new version?

Cassiano Leal

unread,
Sep 4, 2013, 7:21:44 AM9/4/13
to vagra...@googlegroups.com
IIRC it’s become hostname (without the underscore).

You’re right, though. It’s not documented, or at least I also failed to find it.
--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Damien Roche

unread,
Sep 4, 2013, 8:12:00 AM9/4/13
to vagra...@googlegroups.com
As previously said it's

config.vm.hostname = ...

You can also use both versions of config in a single Vagrantfile.

Vagrant::Config.run do | config |
     config.vm.host_name = ...
end

Vagrant.configure("2") do | config |
    config.vm.hostname = ...
end
--
Kind Regards
Damien

mlaw...@wibidata.com

unread,
Sep 4, 2013, 1:09:01 PM9/4/13
to vagra...@googlegroups.com
Thanks guys, losing the underscore did the trick!

zarr12...@gmail.com

unread,
Sep 9, 2013, 7:31:44 AM9/9/13
to vagra...@googlegroups.com
mlaw...@wibidata.com於 2013年9月5日星期四UTC+8上午1時09分01秒寫道:
Thanks guys, losing the underscore did the trick!


i'm got the same issue, would you tell me how to do fix it ,pls?
In my Vagrantfile:

Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.network :bridged, :bridge => "network device name", :adapter => 2, :mac => "080027XXXXXX"
config.vm.boot_mode = :gui
    config.vm.define :web do |web_config|
                web_config.vm.host_name = "luffy1.example.com"
web_config.provision :puppet, :options => ["--server puppet.ipeen.com.tw --test"]
web_config.provision :shell, :inline => "--server puppet.ipeen.com.tw --test"
end
end

and when i use web_config.provision always fail? the error message:

C:\Users\User\vbox\precise66>vagrant up web
There were warnings and/or errors while loading your Vagrantfile
for the machine 'web'.

Your Vagrantfile was written for an earlier version of Vagrant,
and while Vagrant does the best it can to remain backwards
compatible, there are some cases where things have changed
significantly enough to warrant a message. These messages are
shown below.

Warnings:
* Unknown configuration section 'provision'. If this section was part of
a Vagrant 1.0.x plugin, note that 1.0.x plugins are incompatible with 1.1+
Bringing machine 'web' up with 'virtualbox' provider...
[web] Clearing any previously set forwarded ports...
[web] Creating shared folders metadata...
[web] Clearing any previously set network interfaces...
[web] Preparing network interfaces based on configuration...
[web] Forwarding ports...
[web] -- 22 => 2222 (adapter 1)
[web] Booting VM...
[web] Waiting for machine to boot. This may take a few minutes...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.ssh.timeout" value) time period. This can
mean a number of things.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.ssh.timeout") value.
Reply all
Reply to author
Forward
0 new messages