elevate privileges in Windows host if necessary #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change makes the plugin try to overwrite the hosts file with elevated privileges in a Windows host if it gets an 'access denied' when trying to copy it normally. This allows you to use the plugin in Windows without any permission workarounds.
This has proved useful to me, and I'm wondering if it would be useful to you or anyone else.
Before these changes, I had these options:
This is not ideal for security reasons as any app running under my user can now edit the hosts file without my knowledge.
This is inconvenient because VirtualBox can't run with 'regular' privileges and elevated privileges at the same time. If VirtualBox is already running with regular privileges, you can't launch it elevated - and vice-versa. So to manage any VM I have to remember to call 'cmd' with 'Run as admin...'
Are there other workarounds I don't know about?