hostnameの指定
config.vm.hostname でHost名を変更できるんですが、"_" (アンダーバー)はダメな模様。
ハイフンは大丈夫でした。
hostnameにハイフンを入れた場合….
Vagantfileで、"test_vm" と設定してみます。
- exp. config.vm.hostname = "test_vm"
すると、こんなエラーメッセージが出ました。
% vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The hostname set for the VM should only contain letters, numbers,
hyphens or dots. It cannot start with a hyphen or dot.
良く読むと、ちゃんと理由が書かれていますね。(最初はこの英語のメッセージに気がつきませんでした…)
ちなみに、このあたりのIssueで扱っていました。
- Disallow dot and hyphen as first character of hostnames