veewee 0.3.0.beta2 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/doc/requirements.md +7 -1
  2. data/lib/python/parallels_send_string.py +76 -0
  3. data/lib/veewee/provider/core/helper/scancode.rb +31 -48
  4. data/lib/veewee/provider/parallels/box/helper/console_type.rb +54 -76
  5. data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +2 -2
  6. data/lib/veewee/provider/virtualbox/box/helper/create.rb +1 -1
  7. data/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb +1 -2
  8. data/lib/veewee/provider/virtualbox/box/helper/version.rb +8 -0
  9. data/lib/veewee/version.rb +1 -1
  10. data/templates/Debian-6.0.5-i386-netboot/virtualbox.sh +1 -1
  11. data/templates/Debian-6.0.6-amd64-netboot/base.sh +27 -0
  12. data/templates/Debian-6.0.6-amd64-netboot/chef.sh +2 -0
  13. data/templates/Debian-6.0.6-amd64-netboot/cleanup-virtualbox.sh +4 -0
  14. data/templates/Debian-6.0.6-amd64-netboot/cleanup.sh +17 -0
  15. data/templates/Debian-6.0.6-amd64-netboot/definition.rb +49 -0
  16. data/templates/Debian-6.0.6-amd64-netboot/preseed.cfg +315 -0
  17. data/templates/Debian-6.0.6-amd64-netboot/puppet.sh +2 -0
  18. data/templates/Debian-6.0.6-amd64-netboot/ruby.sh +10 -0
  19. data/templates/Debian-6.0.6-amd64-netboot/vagrant.sh +25 -0
  20. data/templates/Debian-6.0.6-amd64-netboot/virtualbox.sh +13 -0
  21. data/templates/Debian-6.0.6-amd64-netboot/zerodisk.sh +3 -0
  22. data/templates/Debian-6.0.6-i386-netboot/base.sh +27 -0
  23. data/templates/Debian-6.0.6-i386-netboot/chef.sh +2 -0
  24. data/templates/Debian-6.0.6-i386-netboot/cleanup-virtualbox.sh +4 -0
  25. data/templates/Debian-6.0.6-i386-netboot/cleanup.sh +17 -0
  26. data/templates/Debian-6.0.6-i386-netboot/definition.rb +51 -0
  27. data/templates/Debian-6.0.6-i386-netboot/preseed.cfg +315 -0
  28. data/templates/Debian-6.0.6-i386-netboot/puppet.sh +2 -0
  29. data/templates/Debian-6.0.6-i386-netboot/ruby.sh +10 -0
  30. data/templates/Debian-6.0.6-i386-netboot/vagrant.sh +25 -0
  31. data/templates/Debian-6.0.6-i386-netboot/virtualbox.sh +13 -0
  32. data/templates/Debian-6.0.6-i386-netboot/zerodisk.sh +3 -0
  33. data/templates/Debian-7.0-b2-i386-netboot/base.sh +27 -0
  34. data/templates/Debian-7.0-b2-i386-netboot/chef.sh +2 -0
  35. data/templates/Debian-7.0-b2-i386-netboot/cleanup-virtualbox.sh +4 -0
  36. data/templates/Debian-7.0-b2-i386-netboot/cleanup.sh +17 -0
  37. data/templates/Debian-7.0-b2-i386-netboot/definition.rb +51 -0
  38. data/templates/Debian-7.0-b2-i386-netboot/preseed.cfg +315 -0
  39. data/templates/Debian-7.0-b2-i386-netboot/puppet.sh +2 -0
  40. data/templates/Debian-7.0-b2-i386-netboot/ruby.sh +10 -0
  41. data/templates/Debian-7.0-b2-i386-netboot/vagrant.sh +25 -0
  42. data/templates/Debian-7.0-b2-i386-netboot/virtualbox.sh +13 -0
  43. data/templates/Debian-7.0-b2-i386-netboot/zerodisk.sh +3 -0
  44. data/templates/Fedora-17-i386/ks.cfg +4 -0
  45. data/templates/Fedora-17-x86_64/ks.cfg +4 -0
  46. data/templates/freebsd-9.0-RELEASE-amd64/definition.rb +19 -0
  47. data/templates/freebsd-9.0-RELEASE-amd64/postinstall.sh +93 -0
  48. data/templates/ubuntu-12.04.1-server-amd64/definition.rb +1 -1
  49. data/templates/ubuntu-12.10-server-amd64-packages/definition.rb +35 -0
  50. data/templates/ubuntu-12.10-server-amd64-packages/postinstall.sh +75 -0
  51. data/templates/ubuntu-12.10-server-amd64-packages/preseed.cfg +87 -0
  52. data/templates/ubuntu-12.10-server-amd64/definition.rb +35 -0
  53. data/templates/ubuntu-12.10-server-amd64/postinstall.sh +97 -0
  54. data/templates/ubuntu-12.10-server-amd64/preseed.cfg +87 -0
  55. data/templates/ubuntu-12.10-server-i386-packages/definition.rb +35 -0
  56. data/templates/ubuntu-12.10-server-i386-packages/postinstall.sh +75 -0
  57. data/templates/ubuntu-12.10-server-i386-packages/preseed.cfg +87 -0
  58. data/templates/ubuntu-12.10-server-i386/definition.rb +35 -0
  59. data/templates/ubuntu-12.10-server-i386/postinstall.sh +98 -0
  60. data/templates/ubuntu-12.10-server-i386/preseed.cfg +87 -0
  61. data/test/veewee/provider/virtualbox/box/helper/guest_additions_test.rb +95 -0
  62. data/test/veewee/provider/virtualbox/box/helper/version.rb +67 -0
  63. data/validation/features/steps/veewee_steps.rb +1 -1
  64. metadata +54 -4
@@ -1 +1,7 @@
1
- Coming Soon
1
+ More Coming Soon
2
+
3
+ Development Libraries:
4
+
5
+ libxslt1-dev
6
+ libxml2-dev
7
+ zlib1g-dev
@@ -0,0 +1,76 @@
1
+ import sys
2
+ import prlsdkapi
3
+ import string
4
+
5
+ if len(sys.argv) != 3:
6
+ print "Usage: parallels_send_string '<VM_NAME>' '<string>'"
7
+ exit()
8
+
9
+ # Parse arguments
10
+ vm_name=sys.argv[1]
11
+ # String to use
12
+ keynames = sys.argv[2].split(' ');
13
+
14
+ prlsdk = prlsdkapi.prlsdk
15
+ consts = prlsdkapi.prlsdk.consts
16
+
17
+ # Initialize the Parallels API Library
18
+ prlsdk.InitializeSDK(consts.PAM_DESKTOP_MAC)
19
+
20
+ # Obtain a server object identifying the Parallels Service.
21
+ server = prlsdkapi.Server()
22
+
23
+ # Log in. (local as we do Parallels Desktop
24
+ login_job=server.login_local()
25
+ login_job.wait()
26
+
27
+ # Get a list of virtual machines.
28
+ # Find the specified virtual machine and
29
+ # obtain an object identifying it.
30
+ vm_list = server.get_vm_list()
31
+ result= vm_list.wait()
32
+
33
+ print prlsdkapi.prlsdk.consts.ScanCodesList
34
+
35
+ # Look for the VM with the name speficied on the CLI
36
+ found = False
37
+ for i in range(result.get_params_count()):
38
+ VM = result.get_param_by_index(i)
39
+ print VM.get_name()
40
+ if VM.get_name() == vm_name:
41
+ found = True
42
+ break
43
+
44
+ press = consts.PKE_PRESS
45
+ release = consts.PKE_RELEASE
46
+
47
+ # Access the Remote Desktop Access session
48
+ vm_io = prlsdkapi.VmIO()
49
+ try:
50
+ vm_io.connect_to_vm(VM).wait()
51
+ except prlsdkapi.PrlSDKError, e:
52
+ print "Error: %s" % e
53
+ exit()
54
+
55
+ for keyname in keynames:
56
+ if(keyname != ''):
57
+ # Keys can also contain special keys like shift, that has to be pressed before and release after
58
+ # eg. SHIFT-C (Press shift, then press C)
59
+ keys = keyname.split('#');
60
+
61
+ for keypress in keys:
62
+ scan_code = consts.ScanCodesList[keypress]
63
+ vm_io.send_key_event(VM,scan_code,press,50)
64
+
65
+ # And now the reversed order
66
+ # eg. Now release C then SHIFT
67
+ for keypress in reversed(keys):
68
+ scan_code = consts.ScanCodesList[keypress]
69
+ vm_io.send_key_event(VM,scan_code,release,50)
70
+
71
+ # End the Remote Deskop Access session
72
+ vm_io.disconnect_from_vm(VM)
73
+
74
+ # Logoff and deinitialize the library
75
+ server.logoff()
76
+ prlsdkapi.deinit_sdk
@@ -8,44 +8,35 @@ module Veewee
8
8
 
9
9
  #http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html
10
10
 
11
- k=Hash.new
12
- k['1'] = '02 82' ; k['2'] = '03 83' ; k['3'] = '04 84'; k['4']= '05 85' ;
13
- k['5']='06 86'; k['6'] = '07 87' ; k['7'] = '08 88'; k['8'] = '09 89'; k['9']= '0a 8a';
14
- k['0']='0b 8b'; k['-'] = '0c 8c'; k['='] = '0d 8d' ;
15
- k['Tab'] = '0f 8f';
16
- k['q'] = '10 90' ; k['w'] = '11 91' ; k['e'] = '12 92';
17
- k['r'] = '13 93' ; k['t'] = '14 94' ; k['y'] = '15 95';
18
- k['u']= '16 96' ; k['i']='17 97'; k['o'] = '18 98' ; k['p'] = '19 99' ;
19
-
20
- k['Q'] = '2a 10 aa' ; k['W'] = '2a 11 aa' ; k['E'] = '2a 12 aa'; k['R'] = '2a 13 aa' ; k['T'] = '2a 14 aa' ; k['Y'] = '2a 15 aa'; k['U']= '2a 16 aa' ; k['I']='2a 17 aa'; k['O'] = '2a 18 aa' ; k['P'] = '2a 19 aa' ;
21
-
22
- k['a'] = '1e 9e'; k['s'] = '1f 9f' ; k['d'] = '20 a0' ; k['f'] = '21 a1'; k['g'] = '22 a2' ; k['h'] = '23 a3' ; k['j'] = '24 a4';
23
- k['k']= '25 a5' ; k['l']='26 a6';
24
- k['A'] = '2a 1e aa 9e'; k['S'] = '2a 1f aa 9f' ; k['D'] = '2a 20 aa a0' ; k['F'] = '2a 21 aa a1';
25
- k['G'] = '2a 22 aa a2' ; k['H'] = '2a 23 aa a3' ; k['J'] = '2a 24 aa a4'; k['K']= '2a 25 aa a5' ; k['L']='2a 26 aa a6';
26
-
27
- k[';'] = '27 a7' ;k['"']='2a 28 aa a8';k['\'']='28 a8';
28
-
29
- k['\\'] = '2b ab'; k['|'] = '2a 2b aa 8b';
30
-
31
- k['[']='1a 9a'; k[']']='1b 9b';
32
- k['<']='2a 33 aa b3'; k['>']='2a 34 aa b4';
33
- k['$']='2a 05 aa 85';
34
- k['+']='2a 0d aa 8d';
35
-
36
- k['?']='2a 35 aa b5';
37
- k['z'] = '2c ac'; k['x'] = '2d ad' ; k['c'] = '2e ae' ; k['v'] = '2f af'; k['b'] = '30 b0' ; k['n'] = '31 b1' ;
38
- k['m'] = '32 b2';
39
- k['Z'] = '2a 2c aa ac'; k['X'] = '2a 2d aa ad' ; k['C'] = '2a 2e aa ae' ; k['V'] = '2a 2f aa af';
40
- k['B'] = '2a 30 aa b0' ; k['N'] = '2a 31 aa b1' ; k['M'] = '2a 32 aa b2';
41
-
42
- k[',']= '33 b3' ; k['.']='34 b4'; k['/'] = '35 b5' ;k[':'] = '2a 27 aa a7';
43
- k['%'] = '2a 06 aa 86'; k['_'] = '2a 0c aa 8c';
44
- k['&'] = '2a 08 aa 88';
45
- k['('] = '2a 0a aa 8a';
46
- k[')'] = '2a 0b aa 8b';
47
-
11
+ # keycode hash, seeded with 'Tab' - which is special as it's longer than 1 char
12
+ k = { 'Tab' => '0f 8f' }
13
+
14
+ # add keycodes
15
+
16
+ # "pure" keys (no modifier keys)
17
+ lower_keys = {
18
+ '1234567890-=' => 0x02,
19
+ 'qwertyuiop[]' => 0x10,
20
+ 'asdfghjkl;\'`' => 0x1e,
21
+ '\\zxcvbnm,./' => 0x2b
22
+ }.each do |keys, offset|
23
+ keys.split('').each_with_index do |key, idx|
24
+ k[key] = sprintf('%02x %02x', idx + offset, idx + offset + 0x80)
25
+ end
26
+ end
48
27
 
28
+ # upcase keys (with shift)
29
+ {
30
+ '!@#$%^&*()_+' => 0x02,
31
+ 'QWERTYUIOP{}' => 0x10,
32
+ 'ASDFGHJKL:"~' => 0x1e,
33
+ '|ZXCVBNM<>?' => 0x2b
34
+ }.each do |keys, offset|
35
+ keys.split('').each_with_index do |key, idx|
36
+ k[key] = sprintf('2a %02x aa %02x', idx + offset, idx + offset + 0x80)
37
+ end
38
+ end
39
+
49
40
  special=Hash.new;
50
41
  special['<Enter>'] = '1c 9c';
51
42
  special['<Backspace>'] = '0e 8e';
@@ -53,7 +44,7 @@ module Veewee
53
44
  special['<Return>'] = '1c 9c'
54
45
  special['<Esc>'] = '01 81';
55
46
  special['<Tab>'] = '0f 8f';
56
- special['<KillX>'] = '1d 38 0e';
47
+ special['<KillX>'] = '1d 38 0e b8';
57
48
  special['<Wait>'] = 'wait';
58
49
 
59
50
  special['<Up>'] = '48 c8';
@@ -67,16 +58,8 @@ module Veewee
67
58
  special['<Right>'] = '4d cd';
68
59
  special['<Home>'] = '47 c7';
69
60
 
70
- special['<F1>'] = '3b';
71
- special['<F2>'] = '3c';
72
- special['<F3>'] = '3d';
73
- special['<F4>'] = '3e';
74
- special['<F5>'] = '3f';
75
- special['<F6>'] = '40';
76
- special['<F7>'] = '41';
77
- special['<F8>'] = '42';
78
- special['<F9>'] = '43';
79
- special['<F10>'] = '44';
61
+ # F1 .. F10
62
+ (1..10).each { |num| special["<F#{num}>"] = sprintf('%02x', num + 0x3a) }
80
63
 
81
64
  keycodes=''
82
65
  thestring.gsub!(/ /,"<Spacebar>")
@@ -19,18 +19,11 @@ module Veewee
19
19
 
20
20
  ui.info "Typing:[#{counter}]: "+s
21
21
 
22
- keycodes=self.string_to_parallels_keycode(s)
22
+ # No need to send the state, we always PRESS then RELEASE.
23
+ # So we send the whole string at once and press/release every string item
24
+ keystring=self.string_to_parallels_keycode_string(s)
23
25
 
24
- # A keycode is a hash {'code' => 'U' , 'state' => 'pressed'}
25
- keycodes.each do |keycode|
26
- unless keycode['code']=="wait"
27
- send_keycode(keycode)
28
- sleep 0.01
29
- else
30
- sleep 1
31
- end
32
- end
33
- #sleep after each sequence (needs to be param)
26
+ send_string(keystring);
34
27
  }
35
28
 
36
29
  ui.info "Done typing."
@@ -39,95 +32,76 @@ module Veewee
39
32
 
40
33
  end
41
34
 
42
- def send_keycode(keycode)
43
- python_script=File.join(File.dirname(__FILE__),'..','..','..','..','..','python','parallels_send_key.py')
44
- command="python #{python_script} '#{self.name}' '#{keycode['code']}' '#{keycode['state']}'"
35
+ def send_string(keystring)
36
+ python_script=File.join(File.dirname(__FILE__),'..','..','..','..','..','python','parallels_send_string.py')
37
+ command="python #{python_script} '#{self.name}' '#{keystring}'"
45
38
  shell_results=shell_exec("#{command}")
46
39
  end
47
40
 
48
- # Returns hash
49
- def k2h(key,state)
50
- return { 'code' => key, 'state' => state}
51
- end
52
-
53
- # Returns hash
54
- def press2h(key)
55
- k2h(key,'press')
56
- end
57
-
58
- # Returns hash
59
- def release2h(key)
60
- k2h(key,'release')
61
- end
62
-
63
41
  # Returns array
64
- def press_release(key)
65
- seq=Array.new
66
- seq << press2h(key)
67
- seq << release2h(key)
68
- return seq
42
+ def press_key(key)
43
+ return key
69
44
  end
70
45
 
71
46
  # Returns array
72
47
  def shift(sequence)
73
48
  seq=Array.new
74
- seq << press2h('SHIFT_LEFT')
49
+ seq << press_key('SHIFT_LEFT')
75
50
  sequence.each do |s|
76
51
  seq << s
77
52
  end
78
- seq << release2h('SHIFT_LEFT')
79
53
  return seq
80
54
  end
81
55
 
82
- def string_to_parallels_keycode(thestring)
56
+ def string_to_parallels_keycode_string(thestring)
83
57
 
84
58
 
85
59
  # Setup one key presses
86
60
  k=Hash.new
87
61
  for key in 'A'..'Z'
88
- k[key] = shift(press_release(key))
62
+ k[key] = shift(press_key(key))
89
63
  end
90
64
 
91
65
  for key in 'a'..'z'
92
- k[key] = press_release(key.upcase)
66
+ k[key] = press_key(key.upcase)
93
67
  end
94
68
 
95
69
  for key in '0'..'9'
96
- k[key] = press_release(key.upcase)
70
+ k[key] = press_key(key.upcase)
97
71
  end
98
72
 
99
- k['>'] = shift(press_release('GREATER'))
100
- k['.'] = press_release('GREATER')
101
- k['<'] = shift(press_release('LESS'))
102
- k[':'] = shift(press_release('COLON'))
103
- k[';'] = press_release('COLON')
104
- k['/'] = press_release('SLASH')
105
- k[' '] = press_release('SPACE')
106
- k['-'] = press_release('MINUS')
107
- k['\''] = press_release('QUOTE')
108
- k['{'] = press_release('CBRACE_LEFT')
109
- k['}'] = press_release('CBRACE_RIGHT')
110
- k['`'] = press_release('TILDA')
111
- k['~'] = shift(press_release('TILDA'))
112
-
113
- k['_'] = shift(press_release('MINUS'))
114
- k['?'] = shift(press_release('SLASH'))
115
- k['"'] = shift(press_release('QUOTE'))
116
- k[')'] = shift(press_release('0'))
117
- k['!'] = shift(press_release('1'))
118
- k['@'] = shift(press_release('2'))
119
- k['#'] = shift(press_release('3'))
120
- k['$'] = shift(press_release('4'))
121
- k['%'] = shift(press_release('5'))
122
- k['^'] = shift(press_release('6'))
123
- k['&'] = shift(press_release('7'))
124
- k['*'] = shift(press_release('8'))
125
- k['('] = shift(press_release('9'))
126
- k['|'] = shift(press_release('BACKSLASH'))
127
- k[','] = press_release('LESS')
128
- k['\\'] = press_release('BACKSLASH')
129
- k['+'] = shift(press_release('PLUS'))
130
- k['='] = press_release('PLUS')
73
+ k['>'] = shift(press_key('GREATER'))
74
+ k['.'] = press_key('GREATER')
75
+ k['<'] = shift(press_key('LESS'))
76
+ k[':'] = shift(press_key('COLON'))
77
+ k[';'] = press_key('COLON')
78
+ k['/'] = press_key('SLASH')
79
+ k[' '] = press_key('SPACE')
80
+ k['-'] = press_key('MINUS')
81
+ k['\''] = press_key('QUOTE')
82
+ k['{'] = press_key('CBRACE_LEFT')
83
+ k['}'] = press_key('CBRACE_RIGHT')
84
+ k['`'] = press_key('TILDA')
85
+ k['~'] = shift(press_key('TILDA'))
86
+
87
+ k['_'] = shift(press_key('MINUS'))
88
+ k['?'] = shift(press_key('SLASH'))
89
+ k['"'] = shift(press_key('QUOTE'))
90
+ k[')'] = shift(press_key('0'))
91
+ k['!'] = shift(press_key('1'))
92
+ k['@'] = shift(press_key('2'))
93
+ k['#'] = shift(press_key('3'))
94
+ k['$'] = shift(press_key('4'))
95
+ k['%'] = shift(press_key('5'))
96
+ k['^'] = shift(press_key('6'))
97
+ k['&'] = shift(press_key('7'))
98
+ k['*'] = shift(press_key('8'))
99
+ k['('] = shift(press_key('9'))
100
+ k['|'] = shift(press_key('BACKSLASH'))
101
+ k[','] = press_key('LESS')
102
+ k['\\'] = press_key('BACKSLASH')
103
+ k['+'] = shift(press_key('PLUS'))
104
+ k['='] = press_key('PLUS')
131
105
 
132
106
  # Setup special keys
133
107
  special=Hash.new;
@@ -153,10 +127,10 @@ module Veewee
153
127
  special['<Home>'] = [{ 'code' => 'HOME', 'state' => 'press' }]
154
128
 
155
129
  for i in 1..12 do
156
- special["<F#{i}>"] = press_release("F#{i}")
130
+ special["<F#{i}>"] = press_key("F#{i}")
157
131
  end
158
132
 
159
- keycodes=Array.new
133
+ keycodes= ""
160
134
 
161
135
  until thestring.length == 0
162
136
  nospecial=true;
@@ -165,7 +139,7 @@ module Veewee
165
139
  #take thestring
166
140
  #check if it starts with a special key + pop special string
167
141
  special[key].each do |c|
168
- keycodes << c
142
+ keycodes.concat("#{c['code']} ")
169
143
  end
170
144
  thestring=thestring.slice(key.length,thestring.length-key.length)
171
145
  nospecial=false;
@@ -176,7 +150,11 @@ module Veewee
176
150
  code=k[thestring.slice(0,1)]
177
151
  if !code.nil?
178
152
  code.each do |c|
179
- keycodes << c
153
+ if(c == 'SHIFT_LEFT'):
154
+ keycodes.concat("#{c}\#")
155
+ else
156
+ keycodes.concat("#{c} ")
157
+ end
180
158
  end
181
159
  else
182
160
  ui.info "no scan code for #{thestring.slice(0,1)}"
@@ -6,7 +6,7 @@ module Veewee
6
6
  def build_info
7
7
  info=super
8
8
  info << { :filename => ".vbox_version",
9
- :content => "#{self.vbox_version}" }
9
+ :content => "#{self.vboxga_version}" }
10
10
  end
11
11
 
12
12
  # Transfer information provide by the provider to the box
@@ -14,7 +14,7 @@ module Veewee
14
14
  #
15
15
  def transfer_buildinfo(options)
16
16
  super(options)
17
- iso_image="VBoxGuestAdditions_#{self.vbox_version}.iso"
17
+ iso_image="VBoxGuestAdditions_#{self.vboxga_version}.iso"
18
18
  env.logger.info "About to transfer virtualbox guest additions iso to the box #{name} - #{ip_address} - #{ssh_options}"
19
19
  self.scp("#{File.join(env.config.veewee.iso_dir,iso_image)}",File.basename(iso_image))
20
20
  end
@@ -98,7 +98,7 @@ module Veewee
98
98
  end
99
99
 
100
100
  def attach_guest_additions
101
- full_iso_file=File.join(env.config.veewee.iso_dir,"VBoxGuestAdditions_#{self.vbox_version}.iso")
101
+ full_iso_file=File.join(env.config.veewee.iso_dir,"VBoxGuestAdditions_#{self.vboxga_version}.iso")
102
102
  ui.info "Mounting guest additions: #{full_iso_file}"
103
103
  command ="#{@vboxcmd} storageattach \"#{name}\" --storagectl \"IDE Controller\" --type dvddrive --port 1 --device 0 --medium \"#{full_iso_file}\""
104
104
  shell_exec("#{command}")
@@ -4,13 +4,12 @@ module Veewee
4
4
  module BoxCommand
5
5
 
6
6
  def download_vbox_guest_additions_iso(options)
7
- version=self.vbox_version
7
+ version=self.vboxga_version
8
8
  isofile="VBoxGuestAdditions_#{version}.iso"
9
9
  url="http://download.virtualbox.org/virtualbox/#{version}/#{isofile}"
10
10
  ui.info "Downloading vbox guest additions iso v #{version} - #{url}"
11
11
  download_iso(url,isofile)
12
12
  end
13
-
14
13
  end
15
14
  end
16
15
  end
@@ -2,6 +2,7 @@ module Veewee
2
2
  module Provider
3
3
  module Virtualbox
4
4
  module BoxCommand
5
+ UNSYNCED_VERSIONS = {"4.2.1" => "4.2.0", "4.1.23" => "4.1.22"}
5
6
 
6
7
  # Return the major/minor/incremental version of VirtualBox.
7
8
  # For example: 4.1.8_Debianr75467 -> 4.1.8
@@ -12,6 +13,13 @@ module Veewee
12
13
  return version
13
14
  end
14
15
 
16
+ def vboxga_version
17
+ affected_version?(self.vbox_version) ? UNSYNCED_VERSIONS[self.vbox_version] : self.vbox_version
18
+ end
19
+ protected
20
+ def affected_version?(ver)
21
+ RUBY_PLATFORM.downcase.include?("darwin") && UNSYNCED_VERSIONS.has_key?(ver)
22
+ end
15
23
  end
16
24
  end
17
25
  end
@@ -4,5 +4,5 @@ end
4
4
 
5
5
  # Only set the version constant if it wasn't set before
6
6
  unless defined?(Veewee::VERSION)
7
- ::Veewee::VERSION="0.3.0.beta2"
7
+ ::Veewee::VERSION="0.3.1"
8
8
  end