Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support? What would it take? #11

Closed
einsty opened this issue Jun 11, 2013 · 5 comments
Closed

Windows Support? What would it take? #11

einsty opened this issue Jun 11, 2013 · 5 comments

Comments

@einsty
Copy link

einsty commented Jun 11, 2013

Thanks so much for this little plugin. SO far it is working like a champ for those in our team who are on *nix operating systems but the Windows folks are left hanging in the wind.

I might be inclinded to help out on this task but not totally familiar w/ ruby, would this be as easy as extracting the path that is used in the .rb file several times into a variable that is determined in some fashion? Or is there more to it?

@agiledivider
Copy link
Owner

Should be working with version 0.0.8. please test and report any bugs. ;)

@frastel
Copy link

frastel commented Dec 4, 2013

Tested it today with Vagrant 1.3.5 and a new box on a Windows 7 machine. Administration permissions are requested for creating the private network but not for editing the hosts file and thus I get an exception due to file permissions:

[default] adding to (C:/Windows/system32/drivers/etc/hosts) : 192.168.33.10  testbox.dev  # VAGRANT: ac5758dff63ed84c1f702423e57bb034 (default) / d03c2d45-93da-4b25-9a65-939b6601ac52
ERROR warden: Error occurred: Permission denied - C:/Windows/system32/drivers/et
c/hosts

Using vagrant-hostsupdater-0.0.11.

@tz-earl
Copy link

tz-earl commented Jan 26, 2014

I'm attempting to use vagrant 1.4.3 and ended up doing a manual workaround for permissions on the Windows 7 hosts file after getting the following error with "vagrant up".

“HostsUpdater.rb:82:in `initialize': Permission denied - C:/Windows/system32/drivers/etc/hosts (Errno::EACCES)”.

After giving “Full control” permissions to all users, the command ran to completion.

However, leaving the permissions like this might be a security hole for malware, so you might want to change them back to “Read; Read & Execute” only for all users.

This is not ideal, but it does get around the problem of the script crapping out.

@marcovtwout
Copy link

Isn't there a nice way to automatically prompt the user for administrator permissions when attempting to write to the hosts file?

@rocpatel
Copy link

It looks like there are 2 issues here. The first is that File.writable? is not accurately reflecting that the user does not have permission to the file. This looks like a bug with ruby https://bugs.ruby-lang.org/issues/4712. Also, was wondering if we could just use the runas command for windows. I can submit a PR that gets around the File.writable? bug by using sudo when the platform is windows, and change the sudo method to use runas for windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants