vagrant-xhyve 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +21 -8
- data/lib/vagrant-xhyve/action/boot.rb +2 -4
- data/lib/vagrant-xhyve/action/import.rb +3 -4
- data/lib/vagrant-xhyve/util/vagrant-xhyve.rb +13 -1
- data/lib/vagrant-xhyve/version.rb +1 -1
- data/vendor/xhyve-ruby/lib/xhyve/dhcp.rb +14 -1
- data/vendor/xhyve-ruby/lib/xhyve/guest.rb +4 -4
- data/vendor/xhyve-ruby/spec/fixtures/dhcpd_leases.txt +7 -0
- data/vendor/xhyve-ruby/spec/lib/dhcp_spec.rb +1 -0
- metadata +33 -3
- data/vendor/xhyve-ruby/spec/fixtures/guest/loop.img +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dc49c89e9de2792a7810031af7517963a895dfa
|
4
|
+
data.tar.gz: ed2dac42bcf9188966a6a1f12eef64f86aac7c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa7db28167d2d73369698ac1419ef38bd01610a60ba77790f970ad368fb49008b031b6a00902688b48b348738883751e4e34cc28040451cec3ea6b82594499f
|
7
|
+
data.tar.gz: 1b8da947d8374a840fe6f9edd5ff4a9ea9141d7a7f6419a7a45deda0f1f0bba483c52d799367e40277f7b90f8002504c33ace5e2d53253f5473e8ba916c73a93
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# 0.4.0 (December 10th, 2016)
|
2
|
+
|
3
|
+
* Added qcow support to use with hyperkit
|
4
|
+
* Fixed intermittent failures with certain MAC addresses
|
5
|
+
|
6
|
+
# 0.3.0 (December 5th, 2016)
|
7
|
+
|
8
|
+
* Added `kernel_command` option to set custom kernel parameters (Nuno Passaro)
|
9
|
+
|
1
10
|
# 0.2.0 (July 23, 2016)
|
2
11
|
|
3
12
|
* Added ability to set custom binary (to work with docker beta etc)
|
data/README.md
CHANGED
@@ -7,7 +7,9 @@ provider to Vagrant.
|
|
7
7
|
|
8
8
|
## Features
|
9
9
|
|
10
|
-
*
|
10
|
+
* Basic features work
|
11
|
+
* Can work with Hyperkit fork of Xhyve
|
12
|
+
* qcow image support
|
11
13
|
|
12
14
|
## Limitations
|
13
15
|
|
@@ -15,8 +17,6 @@ You need to use sudo for most vagrant actions with the xhyve driver,
|
|
15
17
|
due to the entitlements needed for xhyve to run without sudo. More details
|
16
18
|
in the [xhyve github issue](https://github.com/mist64/xhyve/issues/60).
|
17
19
|
|
18
|
-
Also, sometimes launching a VM just fails. But I'm not quite sure why.
|
19
|
-
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
Install using standard Vagrant plugin installation methods. After
|
@@ -66,9 +66,7 @@ This provider exposes quite a few provider-specific configuration options:
|
|
66
66
|
integer for memory in MB or you can use the suffixed style, eg. 2G for two
|
67
67
|
Gigabytes
|
68
68
|
* `cpus` - The number of CPUs to give the VM
|
69
|
-
* `xhyve_binary` - use a custom xhyve version
|
70
|
-
included with [Docker for Mac Beta](https://docs.docker.com/engine/installation/mac/#docker-for-mac)
|
71
|
-
is interesting. The path is `/Applications/Docker.app/Contents/MacOS/com.docker.hyperkit`. )
|
69
|
+
* `xhyve_binary` - use a custom xhyve version
|
72
70
|
* kernel_command - send a custom kernel boot command
|
73
71
|
|
74
72
|
These can be set like typical provider-specific configuration:
|
@@ -92,6 +90,12 @@ There is minimal support for synced folders. Upon `vagrant up`,
|
|
92
90
|
`rsync` (if available) to uni-directionally sync the folder to
|
93
91
|
the remote machine over SSH.
|
94
92
|
|
93
|
+
## Using Docker's HyperKit Fork of Xhyve
|
94
|
+
|
95
|
+
Docker has a very nice port of Xhyve called [HyperKit](https://github.com/docker/hyperkit). It has some interesting features like better stability and qcow support (which this provider can't use yet).
|
96
|
+
|
97
|
+
If you want to try it out, either install hyperkit directly, or you can use the version bundled with [Docker for Mac](https://docs.docker.com/engine/installation/mac/). The path to the binary is `/Applications/Docker.app/Contents/MacOS/com.docker.hyperkit`. See the configuration section above for how to use this with the `xhyve_binary` option.
|
98
|
+
|
95
99
|
## Questions
|
96
100
|
|
97
101
|
Q. Should I use this for my work?
|
@@ -103,11 +107,15 @@ Q. Why?
|
|
103
107
|
|
104
108
|
A. This project is powered by ignorance and good intentions.
|
105
109
|
|
106
|
-
Q. Will I
|
110
|
+
Q. Will I ever not have to use sudo or setuid root?
|
107
111
|
|
108
112
|
A. There's a theory in that issue linked above that wrapping xhyve in an
|
109
113
|
app store app would help. If that were the case, you could probably use the
|
110
|
-
embedded binary with vagrant-xhyve.
|
114
|
+
embedded binary with vagrant-xhyve. Another option is to use setuid root.
|
115
|
+
|
116
|
+
Q. This sucks.
|
117
|
+
|
118
|
+
A. That's not a question, but why don't you try out [another implementation](https://github.com/sirn/vagrant-xhyve). Looks pretty nice.
|
111
119
|
|
112
120
|
## Acknowledgements
|
113
121
|
|
@@ -143,3 +151,8 @@ Use bundler to execute Vagrant:
|
|
143
151
|
```
|
144
152
|
$ bundle exec vagrant up --provider=xhyve
|
145
153
|
```
|
154
|
+
|
155
|
+
## Contributors
|
156
|
+
|
157
|
+
* Patrick Armstrong
|
158
|
+
* Nuno Passaro
|
@@ -76,10 +76,8 @@ module VagrantPlugins
|
|
76
76
|
private
|
77
77
|
|
78
78
|
def block_device_paths(base_path)
|
79
|
-
|
80
|
-
|
81
|
-
return block_file if File.exist? block_file
|
82
|
-
end
|
79
|
+
block_paths = Dir.glob File.join(base_path, "block*.{raw,img,qcow,qcow2}")
|
80
|
+
block_paths.sort
|
83
81
|
end
|
84
82
|
|
85
83
|
def kernel_file_path(base_path)
|
@@ -41,10 +41,9 @@ module VagrantPlugins
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def copy_block_files_to(from, to)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
44
|
+
block_glob = Dir.glob(File.join(from, "block*.{img,raw,qcow,qcow2}"))
|
45
|
+
log.debug("Copying #{block_glob} to #{to} ")
|
46
|
+
FileUtils.cp_r block_glob, to
|
48
47
|
end
|
49
48
|
|
50
49
|
def copy_file(from, to, filename)
|
@@ -48,12 +48,24 @@ module VagrantPlugins
|
|
48
48
|
'-c', @processors,
|
49
49
|
'-s', '0:0,hostbridge',
|
50
50
|
"#{"-s #{PCI_BASE - 1}:0,virtio-net" if @networking }" ,
|
51
|
-
"#{
|
51
|
+
"#{build_block_device_parameter}",
|
52
52
|
'-s', '31,lpc',
|
53
53
|
'-l', "#{@serial},stdio",
|
54
54
|
'-f', "kexec,#{@kernel},#{@initrd},'#{@cmdline}'"
|
55
55
|
].join(' ')
|
56
56
|
end
|
57
|
+
|
58
|
+
def build_block_device_parameter
|
59
|
+
block_device_parameter = ""
|
60
|
+
@blockdevs.each_with_index.map do |p, i|
|
61
|
+
if p.include? "qcow"
|
62
|
+
block_device_parameter << "-s #{PCI_BASE + i},virtio-blk,file://#{p},format\=qcow "
|
63
|
+
else
|
64
|
+
block_device_parameter << "-s #{PCI_BASE + i},virtio-blk,#{p} "
|
65
|
+
end
|
66
|
+
end
|
67
|
+
block_device_parameter
|
68
|
+
end
|
57
69
|
end
|
58
70
|
end
|
59
71
|
end
|
@@ -7,9 +7,11 @@ module Xhyve
|
|
7
7
|
MAX_ATTEMPTS = 60
|
8
8
|
|
9
9
|
def get_ip_for_mac(mac)
|
10
|
+
normalized_mac = normalize_mac(mac)
|
11
|
+
|
10
12
|
max = ENV.key?('MAX_IP_WAIT') ? ENV['MAX_IP_WAIT'].to_i : nil
|
11
13
|
ip = wait_for(max: max) do
|
12
|
-
ip = parse_lease_file_for_mac(
|
14
|
+
ip = parse_lease_file_for_mac(normalized_mac)
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
@@ -37,5 +39,16 @@ module Xhyve
|
|
37
39
|
sleep(WAIT_TIME)
|
38
40
|
end
|
39
41
|
end
|
42
|
+
|
43
|
+
# macos dhcp represents mac addresses differently from xhyve. Specifically,
|
44
|
+
# it doesn't display leading zeros. This function normalized the mac
|
45
|
+
# address to the macos format
|
46
|
+
def normalize_mac(mac)
|
47
|
+
# don't try to normalize if it doesn't seem like a mac...
|
48
|
+
return mac if mac !~ /.*:.*:.*:.*:.*:.*/
|
49
|
+
mac_parts = mac.to_s.split(":")
|
50
|
+
normalized_parts = mac_parts.map {|s| Integer(s, 16).to_s(16) }
|
51
|
+
normalized_parts.join(":")
|
52
|
+
end
|
40
53
|
end
|
41
54
|
end
|
@@ -33,8 +33,8 @@ module Xhyve
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def start
|
36
|
-
outfile, infile = redirection
|
37
|
-
@pid = spawn(@command,
|
36
|
+
outfile, errfile, infile = redirection
|
37
|
+
@pid = spawn(@command, out: outfile, err: errfile, in: infile)
|
38
38
|
if @foreground
|
39
39
|
Process.wait(@pid)
|
40
40
|
outfile.cooked!
|
@@ -59,9 +59,9 @@ module Xhyve
|
|
59
59
|
|
60
60
|
def redirection
|
61
61
|
if @foreground
|
62
|
-
[$stdout.raw!, $stdin.raw! ]
|
62
|
+
[$stdout.raw!, $stderr.raw!, $stdin.raw! ]
|
63
63
|
else
|
64
|
-
[NULLDEV, NULLDEV]
|
64
|
+
[NULLDEV, NULLDEV, NULLDEV]
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -3,6 +3,7 @@ require File.expand_path('../../spec_helper.rb', __FILE__)
|
|
3
3
|
RSpec.describe Xhyve::DHCP do
|
4
4
|
let(:leases) do
|
5
5
|
{
|
6
|
+
'9a:65:1b:12:cf:0f' => '192.168.64.35',
|
6
7
|
'9a:65:1b:12:cf:32' => '192.168.64.34',
|
7
8
|
'a6:84:b2:34:cf:32' => '192.168.64.5',
|
8
9
|
'ea:28:a:33:cf:32' => '192.168.64.4',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-xhyve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Armstrong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xhyve-ruby
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- example_box/vmlinuz
|
106
106
|
- lib/vagrant-xhyve.rb
|
107
107
|
- lib/vagrant-xhyve/action.rb
|
108
|
+
- lib/vagrant-xhyve/action/.boot.rb.swp
|
108
109
|
- lib/vagrant-xhyve/action/boot.rb
|
109
110
|
- lib/vagrant-xhyve/action/import.rb
|
110
111
|
- lib/vagrant-xhyve/action/is_created.rb
|
@@ -136,9 +137,39 @@ files:
|
|
136
137
|
- vendor/xhyve-ruby/Gemfile
|
137
138
|
- vendor/xhyve-ruby/README.md
|
138
139
|
- vendor/xhyve-ruby/Rakefile
|
140
|
+
- vendor/xhyve-ruby/coverage/.last_run.json
|
141
|
+
- vendor/xhyve-ruby/coverage/.resultset.json
|
142
|
+
- vendor/xhyve-ruby/coverage/.resultset.json.lock
|
143
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/application.css
|
144
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/application.js
|
145
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/colorbox/border.png
|
146
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/colorbox/controls.png
|
147
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/colorbox/loading.gif
|
148
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/colorbox/loading_background.png
|
149
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/favicon_green.png
|
150
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/favicon_red.png
|
151
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/favicon_yellow.png
|
152
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/loading.gif
|
153
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/magnify.png
|
154
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
|
155
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
|
156
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
|
157
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
|
158
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png
|
159
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
|
160
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
|
161
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
|
162
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png
|
163
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png
|
164
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png
|
165
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png
|
166
|
+
- vendor/xhyve-ruby/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png
|
167
|
+
- vendor/xhyve-ruby/coverage/index.html
|
139
168
|
- vendor/xhyve-ruby/example/test.rb
|
140
169
|
- vendor/xhyve-ruby/lib/rubygems_plugin.rb
|
141
170
|
- vendor/xhyve-ruby/lib/xhyve.rb
|
171
|
+
- vendor/xhyve-ruby/lib/xhyve/.dhcp.rb.swp
|
172
|
+
- vendor/xhyve-ruby/lib/xhyve/.guest.rb.swp
|
142
173
|
- vendor/xhyve-ruby/lib/xhyve/dhcp.rb
|
143
174
|
- vendor/xhyve-ruby/lib/xhyve/guest.rb
|
144
175
|
- vendor/xhyve-ruby/lib/xhyve/vendor/xhyve
|
@@ -146,7 +177,6 @@ files:
|
|
146
177
|
- vendor/xhyve-ruby/spec/fixtures/dhcpd_leases.txt
|
147
178
|
- vendor/xhyve-ruby/spec/fixtures/guest/README.md
|
148
179
|
- vendor/xhyve-ruby/spec/fixtures/guest/initrd
|
149
|
-
- vendor/xhyve-ruby/spec/fixtures/guest/loop.img
|
150
180
|
- vendor/xhyve-ruby/spec/fixtures/guest/vmlinuz
|
151
181
|
- vendor/xhyve-ruby/spec/lib/dhcp_spec.rb
|
152
182
|
- vendor/xhyve-ruby/spec/lib/guest_spec.rb
|
Binary file
|