diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index cc789d21a..3be717eb0 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -353,7 +353,7 @@ module VagrantPlugins errors << I18n.t("vagrant.config.vm.box_not_found", :name => box) if \ box && !box_url && !machine.box errors << I18n.t("vagrant.config.vm.hostname_invalid_characters") if \ - @hostname && @hostname !~ /^[-.a-z0-9]+$/i + @hostname && @hostname !~ /^[a-z0-9][-.a-z0-9]+$/i has_nfs = false used_guest_paths = Set.new diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 1f82cfb14..762218255 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -691,7 +691,7 @@ en: box_not_found: "The box '%{name}' could not be found." hostname_invalid_characters: |- The hostname set for the VM should only contain letters, numbers, - and hyphens. + hyphens or dots. It cannot start with a hyphen or dot. network_invalid: |- The network type '%{type}' is not valid. Please use 'hostonly' or 'bridged'.