wplib / wplib-box

The Best Local Dev Server for WordPress Developers
https://wplib.github.io/box-docs/
MIT License
209 stars 24 forks source link

Vagrant Can Fail to Update Hosts on Windows 10 #42

Open mikeschinkel opened 8 years ago

mikeschinkel commented 8 years ago

Jayzanarak ProgrammerLoso contacted me via Facebook Messenger with Vagrant Box install problem where Hosts Updater could not update the hosts file on Windows 10. See screenshot.

win10-hosts-update-fail

I provided him these links and they gave him enough info to solve his problem, but he did not explain to me how he solved it (he had to leave for work that moment):

I know that @sarutole tested it on Windows 10 but I assume that he had already made a modification to his Windows box to enable editing of his hosts file long before testing our box.

In order to be true to our (my?) claims that WPLib Box is the EASIEST way to setup a professional WordPress local development environment we need to solve this problem or at least change the documentation so that anyone who follows our quickstart will not run into this problem.

mikeschinkel commented 8 years ago

Jayzanarak says this is how he resolved the issue:

hosts-permissions

I assume this is just something we will need to document? I assume there is no way to make it easier for the user to do this? (Or can we have a script that would pop this dialog up for them to make the changes, or something else?)

sarutole commented 8 years ago

We might want to switch from HostsUpdater to HostsManager, because the latter has a way to show a UAC prompt:

"If hostmanager detects that it cannot overwrite the file, it will attempt to do so with elevated privileges, causing the UAC prompt to appear."

see https://github.com/devopsgroup-io/vagrant-hostmanager#user-content-windows-support

clubdeuce commented 8 years ago

@mikeschinkel @sarutole What is the status of this? This issue is currently slated for 0.10.7. Should we punt to 0.10.8?

unilobo commented 7 years ago

On a windows 10 box I do not have the option to change the permission of the hosts file. I get the same problem with both HostsUpdater and HostsManager.

Solution is to edit the file manually.

mikeschinkel commented 7 years ago

@unilobo Thanks for the input.

cgsmith commented 6 years ago

The release 1.1.1 of vagrant-hostsupdater should escalate the UAC if necessary now. Let me know if it doesn't and I can test further.