vagrant-windows 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,6 +1,16 @@
1
- Building a Base Box
2
- ===================
3
1
 
2
+ Installing
3
+ ==========
4
+
5
+ ```
6
+ gem install vagrant-windows
7
+ ```
8
+
9
+ Building a Base Box
10
+ ===================
11
+
12
+ All Windows Machines
13
+ --------------------
4
14
  -Enable WinRM
5
15
 
6
16
  ```
@@ -13,8 +23,13 @@
13
23
  - Create a vagrant user
14
24
  - For things to work out of the box, username and password should both be vagrant
15
25
 
16
- - Turn off UAC
17
- - Disable Shutdown Tracker
26
+ - Turn off UAC (Msconfig)
27
+ - Disable complex passwords
28
+
29
+ Servers
30
+ --------
31
+ - Disable Shutdown Tracker (http://www.jppinto.com/2010/01/how-to-disable-the-shutdown-event-tracker-in-server-20032008/)
32
+ - Disable "Server Manager" Starting at login (http://www.elmajdal.net/win2k8/How_to_Turn_Off_The_Automatic_Display_of_Server_Manager_At_logon.aspx)
18
33
 
19
34
  The Vagrant File
20
35
  ================
@@ -45,6 +60,7 @@ Vagrant::Config.run do |config|
45
60
  end
46
61
 
47
62
  end
63
+ ````
48
64
 
49
65
  What Works?
50
66
  ===========
@@ -57,6 +73,10 @@ What has not been tested
57
73
  - Shell and Puppet Provisioners
58
74
  - Shell should work, though I have not vetted it yet.
59
75
 
76
+ What does not work
77
+ ==================
78
+ - Complex networking setups
79
+
60
80
  What Can I do to help?
61
81
  ======================
62
82
  1. Contribute Code (See Below)
@@ -73,6 +93,6 @@ Contributing
73
93
 
74
94
  References and Shout Outs
75
95
  =========================
76
- Chris McClimans - Vagrant Branch (https://github.com/hh/vagrant/blob/feature/winrm/)
77
- Dan Wanek - WinRM GEM (https://github.com/zenchild/WinRM)
78
- +1 For being super responsive to pull requests.
96
+ - Chris McClimans - Vagrant Branch (https://github.com/hh/vagrant/blob/feature/winrm/)
97
+ -Dan Wanek - WinRM GEM (https://github.com/zenchild/WinRM)
98
+ - +1 For being super responsive to pull requests.
@@ -15,6 +15,11 @@ module Vagrant
15
15
  vm.channel.execute("wmic computersystem where name=\"%COMPUTERNAME%\" call rename name=\"#{name}\"")
16
16
  end
17
17
 
18
+ # TODO: I am sure that ciphering windows versions will be important at some point
19
+ def distro_dispatch
20
+ :windows
21
+ end
22
+
18
23
  def halt
19
24
  @vm.channel.execute("shutdown /s /t 1 /c \"Vagrant Halt\" /f /d p:4:1")
20
25
 
@@ -25,7 +30,7 @@ module Vagrant
25
30
  while @vm.state != :poweroff
26
31
  count += 1
27
32
 
28
- return if count >= @vm.config.linux.halt_timeout
33
+ return if count >= @vm.config.windows.halt_timeout
29
34
  sleep @vm.config.windows.halt_check_interval
30
35
  end
31
36
  end
@@ -37,6 +42,68 @@ module Vagrant
37
42
  @vm.channel.execute(mount_script,{:shell => :powershell})
38
43
  end
39
44
 
45
+ def mount_nfs(ip, folders)
46
+ raise NotImplementedError, "Mounting NFS Shares on windows is not implemented"
47
+ # TODO: Maybe check for nfs support on the guest, since its often
48
+ # not installed by default
49
+ #folders.each do |name, opts|
50
+ # # Expand the guestpath, so we can handle things like "~/vagrant"
51
+ # real_guestpath = expanded_guest_path(opts[:guestpath])
52
+
53
+ # Do the actual creating and mounting
54
+ # @vm.channel.sudo("mkdir -p #{real_guestpath}")
55
+ # @vm.channel.sudo("mount -o vers=#{opts[:nfs_version]} #{ip}:'#{opts[:hostpath]}' #{real_guestpath}",
56
+ # :error_class => LinuxError,
57
+ # :error_key => :mount_nfs_fail)
58
+ #end
59
+ end
60
+
61
+ def configure_networks(networks)
62
+ raise NotImplementedError, "Advanced Networking is not supported"
63
+ # First, remove any previous network modifications
64
+ # from the interface file.
65
+ #vm.channel.sudo("sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/network/interfaces > /tmp/vagrant-network-interfaces")
66
+ #vm.channel.sudo("su -c 'cat /tmp/vagrant-network-interfaces > /etc/network/interfaces'")
67
+ #vm.channel.sudo("rm /tmp/vagrant-network-interfaces")
68
+
69
+ # Accumulate the configurations to add to the interfaces file as
70
+ # well as what interfaces we're actually configuring since we use that
71
+ # later.
72
+ #interfaces = Set.new
73
+ #entries = []
74
+ #networks.each do |network|
75
+ # interfaces.add(network[:interface])
76
+ # entry = TemplateRenderer.render("guests/debian/network_#{network[:type]}",
77
+ # :options => network)
78
+
79
+ # entries << entry
80
+ #end
81
+
82
+ # Perform the careful dance necessary to reconfigure
83
+ # the network interfaces
84
+ #temp = Tempfile.new("vagrant")
85
+ #temp.binmode
86
+ #temp.write(entries.join("\n"))
87
+ #temp.close
88
+
89
+ #vm.channel.upload(temp.path, "/tmp/vagrant-network-entry")
90
+
91
+ # Bring down all the interfaces we're reconfiguring. By bringing down
92
+ # each specifically, we avoid reconfiguring eth0 (the NAT interface) so
93
+ # SSH never dies.
94
+ #interfaces.each do |interface|
95
+ # vm.channel.sudo("/sbin/ifdown eth#{interface} 2> /dev/null")
96
+ #end
97
+
98
+ #vm.channel.sudo("cat /tmp/vagrant-network-entry >> /etc/network/interfaces")
99
+ #vm.channel.sudo("rm /tmp/vagrant-network-entry")
100
+
101
+ # Bring back up each network interface, reconfigured
102
+ #interfaces.each do |interface|
103
+ # vm.channel.sudo("/sbin/ifup eth#{interface}")
104
+ #end
105
+ end
106
+
40
107
  def windows_path(path)
41
108
  p = ''
42
109
  if path =~ /^\//
@@ -47,6 +114,8 @@ module Vagrant
47
114
  p.gsub /\\\\{0,}/, "\\"
48
115
  end
49
116
 
117
+
118
+
50
119
  end
51
120
  end
52
121
  end
@@ -31,8 +31,8 @@ $BaseDirectory = [System.IO.Path]::GetDirectoryName($MountPoint)
31
31
 
32
32
  if (-not (Test-Path $BaseDirectory))
33
33
  {
34
- Write-Host "Creating parent directory for mount point"
35
- mkdir $BaseDirectory
34
+ Write-Host "Creating parent directory for mount point $BaseDirectory"
35
+ New-Item $BaseDirectory -Type Directory -Force | Out-Null
36
36
  }
37
37
 
38
38
  cmd /c mklink /D "$MountPoint" "\\vboxsrv\$ShareName"
@@ -1,3 +1,3 @@
1
1
  module VagrantWindows
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-04 00:00:00.000000000 Z
12
+ date: 2012-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: winrm