Skip to content

Commit

Permalink
Add windows xp hint
Browse files Browse the repository at this point in the history
Adjust readme
  • Loading branch information
GM-Alex committed Jun 20, 2014
1 parent f18a282 commit 3510e5e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ Windows users: NFS folders do not work on Windows hosts. Vagrant will ignore you

## Settings

You can set the uid and the gid. Example:
### Logging

You activate the logging of the nfs daemon which will show the daemon window in the foreground. To activate the logging set the `config.winnfsd.logging` to `on`.

### Set uid and gid

You can set the uid via the `config.winnfsd.uid` param and the gid via the `config.winnfsd.gid` param. Example:

```
Vagrant.configure('2') do |config|
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-winnfsd/config/winnfsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize
def validate(machine)
errors = []

errors << 'winnfsd.logging cannot only be \'on\' or \'off\'.' if (machine.config.winnfsd.uid != 'on' || machine.config.winnfsd.uid != 'off')
errors << 'winnfsd.logging cannot only be \'on\' or \'off\'.' unless (machine.config.winnfsd.logging == 'on' || machine.config.winnfsd.logging == 'off')
errors << 'winnfsd.uid cannot be nil.' if machine.config.winnfsd.uid.nil?
errors << 'winnfsd.gid cannot be nil.' if machine.config.winnfsd.gid.nil?

Expand Down
3 changes: 3 additions & 0 deletions lib/vagrant-winnfsd/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def self.init_plugin
rule = "advfirewall firewall add rule name=\"%s\" dir=\"%s\" action=allow protocol=any program=\"%s\" profile=any"
in_rule = sprintf(rule, rule_name, 'in', program)
out_rule = sprintf(rule, rule_name, 'out', program)
xp_rule = "netsh firewall add allowedprogram \"#{program}\" #{rule_name} ENABLE"

firewall_script = VagrantWinNFSd.get_path_for_file('setupfirewall.vbs')
firewall_rule = "cscript //nologo #{firewall_script} \"#{cleanup_rule}\" \"#{in_rule}\" \"#{out_rule}\""
Expand All @@ -70,6 +71,8 @@ def self.init_plugin
puts I18n.t('vagrant_winnfsd.firewall.error')
puts "netsh #{in_rule}\n"
puts "netsh #{out_rule}\n"
puts I18n.t('vagrant_winnfsd.firewall.xp_error')
puts xp_rule
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ en:
firewall:
error: |-
It seems that you don't have the privileges to change the firewall rules. NFS will not work without that firewall
changes. Execute the following commands as administrator:
changes. Execute the following commands via cmd as administrator:
xp_error: |-
If you are an Windows XP user run the following command instead:

0 comments on commit 3510e5e

Please sign in to comment.