Closed proteansec closed 5 years ago
I am a bit confused. Are you sure that in particular the first error is attributable to Landrush. config.landrush.host does not try to set the hostname of the guest. It just adds a static DNS entry for the specified hostname to its configuration.
TBH, I am not sure exactly what's going on. What is the Windows guest you are using? Are there any readily available for testing?
I'm using the following iso image: http://data.alsyundawy.com/Windows%208/en_windows_8_enterprise_x86_dvd_917587.iso . Basically you can just install the windows normally, create a vagrant box and then issue the relevant vagrant commands.
This is a landrush error, because of the following line - I thought the vagrant.test is the default, which is why I'm not sure why landrush is checking and failing upon that.
==> vagrant-win8x86-enterprise: [landrush] hostname win8x86-enterprise does not match the configured TLD: vagrant.test
A FQDN is expected in this case, since the domain part is also used to re-configure your DNS on the host. Only request to the VM domain will be directed to the Landrush DNS server.
So your first attempt is the correct one, however, it seems that for Windows guests the hostname cannot contain a fully qualified name. This is actually from the Vagrant codebase and I assume that Windows just does not allow setting a fully qualified name. See also:
In the case where you only specify the hostname, you get an error message from Landrush. It assumes the default domain 'vagrant.test', but this does not match what's specified in the hostname config option. This is mainly an issue for configuring DNS on the host. I guess we could use a warning message in this case.
This alone won't help much though, since we generally have no support for Windows guests - see issue #278.
I stumbled upon this problem some time ago. I solved it by writing a small plugin that provides a "windowsplus" guest and overrides the ChangeHostName capability.
The new capability allows specifying FQDNs. It then sets the hostname part as hostname and the domain part as primary dns suffix.
I don't know much ruby and therefore have no idea how stable the code is, but it works for me. If you want, I can put it on github.
@mklemm2 can you share the fix/plugin already?
@boonen Here it is: https://github.com/mklemm2/vagrant-GuestWindowsPlus
Closing this issue, since it is really a Vagrant core thing.
The relevant part of the Vagrantfile is shown below, where the problematic option is highlighted.
Then running vagrant up, there's an error when setting the hostname of the guest Windows machine, because I've specified the FQDN name.
Ok, I get the point, let's modify the config.landrush.host option to only include the hostname without the domain part. The relevant part of the Vagrantfile is again shown below.
After doing vagrant up I again receive an error, this time about the hostname not matching the configured TLD vagrant.test.
Therefore, the error says I have to configure the hostname back as it was before, but that also produced an error.