macinbox 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +1 -1
- data/README.md +19 -12
- data/lib/macinbox/actions/create_box_from_vdi.rb +86 -0
- data/lib/macinbox/actions/create_hdd_from_image.rb +2 -1
- data/lib/macinbox/actions/create_image_from_installer.rb +37 -3
- data/lib/macinbox/actions/create_vdi_from_image.rb +62 -0
- data/lib/macinbox/actions/create_vmdk_from_image.rb +4 -3
- data/lib/macinbox/actions.rb +2 -0
- data/lib/macinbox/cli.rb +16 -1
- data/lib/macinbox/version.rb +1 -1
- data/macinbox.gemspec +2 -2
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56a162b7814012ac1d148abdbec556b1ad44c947
|
4
|
+
data.tar.gz: 0f6bb9b0154454670a525045fc40627462d84e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa4a303bfdf7567dad85868082c79ed8e3305f6a72245f043995c0d4d2ae08fd1c07a95f197dcae949b1801e202a84e47fbe9e7aa7b40d6fe4c0478fa9ffb1ba
|
7
|
+
data.tar.gz: 3a3f827be1a640ec9394344bc0a5e5695a9f6304587203d9ddeb1ebbc5c050db8ffe43f15ac73e35952da1c86316ecf528c663037d46548f587653b06f3df2c9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 3.1.0 (January 21, 2019)
|
2
|
+
|
3
|
+
FEATURES:
|
4
|
+
|
5
|
+
- Add support for virtualbox box format. [GH-18]
|
6
|
+
|
7
|
+
BUG FIXES:
|
8
|
+
|
9
|
+
- Make vagrant ssh key installation more reliable.
|
10
|
+
- Update gemspec requirements for Mojave. [GH-17]
|
11
|
+
|
1
12
|
## 3.0.0 (December 14, 2018)
|
2
13
|
|
3
14
|
FEATURES:
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Puts macOS Mojave in a Vagrant box.
|
|
7
7
|
<i>Some sequences shortened. Original run time 14.5 minutes.</i>
|
8
8
|
</p>
|
9
9
|
|
10
|
-
Supports creating boxes in either the 'vmware_fusion', 'vmware_desktop' or '
|
10
|
+
Supports creating boxes in either the 'vmware_fusion', 'vmware_desktop', 'parallels', or 'virtualbox' formats.
|
11
11
|
|
12
12
|
## System Requirements
|
13
13
|
|
@@ -20,8 +20,8 @@ Supports creating boxes in either the 'vmware_fusion', 'vmware_desktop' or 'para
|
|
20
20
|
|
21
21
|
The following software is required. Versions other than those mentioned may work, but these are the latest versions tested:
|
22
22
|
|
23
|
-
* [macOS 10.14.
|
24
|
-
* [Vagrant 2.2.
|
23
|
+
* [macOS 10.14.2 Mojave installer application](http://appstore.com/mac/macosmojave)
|
24
|
+
* [Vagrant 2.2.3](https://www.vagrantup.com/)
|
25
25
|
|
26
26
|
To create and boot a box in the 'vmware_fusion' or 'vmware_desktop' formats you must also have:
|
27
27
|
|
@@ -32,9 +32,13 @@ To create and boot a box in the 'vmware_fusion' or 'vmware_desktop' formats you
|
|
32
32
|
|
33
33
|
To create and boot a box in the 'parallels' format you must also have:
|
34
34
|
|
35
|
-
* [Parallels Desktop 14 for Mac Pro Edition 14.0
|
35
|
+
* [Parallels Desktop 14 for Mac Pro Edition 14.1.0](https://www.parallels.com/products/desktop/)
|
36
36
|
* [Vagrant Parallels Provider 1.7.8](https://parallels.github.io/vagrant-parallels/)
|
37
37
|
|
38
|
+
To create and boot a box in the 'virtualbox' format you must also have:
|
39
|
+
|
40
|
+
* [VirtualBox 6.0.2 with the extension pack](https://www.virtualbox.org)
|
41
|
+
|
38
42
|
## Installation
|
39
43
|
|
40
44
|
Install the gem:
|
@@ -107,7 +111,11 @@ By default `macinbox` will configure the guest OS to have HiDPI resolutions enab
|
|
107
111
|
|
108
112
|
## Box Format Support
|
109
113
|
|
110
|
-
By default `macinbox` will create a Vagrant box in the 'vmware_desktop' format with the VMware Tools pre-installed.
|
114
|
+
By default `macinbox` will create a Vagrant box in the 'vmware_desktop' format with the VMware Tools pre-installed.
|
115
|
+
|
116
|
+
When the box format is set to 'parallels' using the `--box-format` option then the Parallels Tools are pre-installed instead.
|
117
|
+
|
118
|
+
When the box format is set to 'virtualbox' no guest extensions are installed. Note that some features behave differently with VirtualBox. The screen resolution is set to 1280x800 and HiDPI resolutions are not supported. The GUI scale factor is set to 2.0 (so that the VM displays properly on a host with a retina display) unless the `--no-hidpi` option is used. Lastly, ssh port-forwarding is enabled by default so that the host can connect to the guest.
|
111
119
|
|
112
120
|
## Implementation Details
|
113
121
|
|
@@ -131,7 +139,7 @@ This tool performs the following actions:
|
|
131
139
|
The box created by this tool includes a built-in Vagrantfile which disables the following default Vagrant behaviors:
|
132
140
|
|
133
141
|
1. Checking Vagrant Cloud for new versions of the box
|
134
|
-
1. Forwarding from port 2222 on the host to port 22 (ssh) on the guest
|
142
|
+
1. Forwarding from port 2222 on the host to port 22 (ssh) on the guest (VMware Fusion and Parallels Desktop only)
|
135
143
|
1. Sharing the root folder of the Vagrant environment as '/vagrant' on the guest
|
136
144
|
|
137
145
|
To re-enable the default ssh port forwarding you can add the following line to your environment's Vagrantfile:
|
@@ -157,6 +165,7 @@ This project was inspired by the great work of others:
|
|
157
165
|
* https://github.com/boxcutter/macos
|
158
166
|
* https://github.com/chilcote/vfuse
|
159
167
|
* http://www.modtitan.com/2017/10/lazy-vm-building-hacks-with-autodmg-and.html
|
168
|
+
* https://github.com/AlexanderWillner/runMacOSinVirtualBox
|
160
169
|
|
161
170
|
## Why?
|
162
171
|
|
@@ -181,18 +190,16 @@ opts = Macinbox::CLI::DEFAULT_OPTION_VALUES
|
|
181
190
|
opts[:collector] = Macinbox::Collector.new
|
182
191
|
opts[:full_name] = "Vagrant"
|
183
192
|
opts[:password] = "vagrant"
|
184
|
-
opts[:box_format] = "
|
193
|
+
opts[:box_format] = "virtualbox"
|
185
194
|
opts[:image_path] = "macinbox.dmg"
|
186
|
-
opts[:
|
187
|
-
opts[:hdd_path] = "macinbox.hdd"
|
195
|
+
opts[:vdi_path] = "macinbox.vdi"
|
188
196
|
opts[:box_path] = "macinbox.box"
|
189
197
|
opts[:boxes_dir] = File.expand_path "~/.vagrant.d"
|
190
198
|
opts[:debug] = true
|
191
199
|
include Macinbox::Actions
|
192
200
|
CreateImageFromInstaller.new(opts).run
|
193
|
-
|
194
|
-
|
195
|
-
CreateBoxFromHDD.new(opts).run
|
201
|
+
CreateVDIFromImage.new(opts).run
|
202
|
+
CreateBoxFromVDI.new(opts).run
|
196
203
|
```
|
197
204
|
|
198
205
|
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'rubygems/package'
|
3
|
+
|
4
|
+
require 'macinbox/error'
|
5
|
+
require 'macinbox/logger'
|
6
|
+
require 'macinbox/task'
|
7
|
+
|
8
|
+
module Macinbox
|
9
|
+
|
10
|
+
module Actions
|
11
|
+
|
12
|
+
class CreateBoxFromVDI
|
13
|
+
|
14
|
+
def initialize(opts)
|
15
|
+
@input_vdi = opts[:vdi_path] or raise ArgumentError.new(":vdi_path not specified")
|
16
|
+
@output_path = opts[:box_path] or raise ArgumentError.new(":box_path not specified")
|
17
|
+
|
18
|
+
@box_name = opts[:box_name] or raise ArgumentError.new(":box_name not specified")
|
19
|
+
@cpu_count = opts[:cpu_count] or raise ArgumentError.new(":cpu_count not specified")
|
20
|
+
@memory_size = opts[:memory_size] or raise ArgumentError.new(":memory_size not specified")
|
21
|
+
|
22
|
+
@gui = opts[:gui]
|
23
|
+
@fullscreen = opts[:fullscreen]
|
24
|
+
@hidpi = opts[:hidpi]
|
25
|
+
|
26
|
+
@collector = opts[:collector] or raise ArgumentError.new(":collector not specified")
|
27
|
+
@debug = opts[:debug]
|
28
|
+
|
29
|
+
raise Macinbox::Error.new("VDI not found") unless File.exist? @input_vdi
|
30
|
+
end
|
31
|
+
|
32
|
+
def run
|
33
|
+
@temp_dir = Task.backtick %W[ /usr/bin/mktemp -d -t create_box_from_vdi ]
|
34
|
+
@collector.add_temp_dir @temp_dir
|
35
|
+
|
36
|
+
Logger.info "Assembling the box contents..." do
|
37
|
+
|
38
|
+
@box_dir = "#{@temp_dir}/#{@box_name}.box"
|
39
|
+
|
40
|
+
FileUtils.mkdir @box_dir
|
41
|
+
|
42
|
+
File.write "#{@box_dir}/metadata.json", <<~EOF
|
43
|
+
{"provider": "virtualbox"}
|
44
|
+
EOF
|
45
|
+
|
46
|
+
File.write "#{@box_dir}/Vagrantfile", <<~EOF
|
47
|
+
Vagrant.configure(2) do |config|
|
48
|
+
config.vm.box_check_update = false
|
49
|
+
config.vm.synced_folder ".", "/vagrant", disabled: true
|
50
|
+
config.vm.provider "virtualbox" do |v|
|
51
|
+
v.gui = #{@gui}
|
52
|
+
end
|
53
|
+
end
|
54
|
+
EOF
|
55
|
+
|
56
|
+
task_opts = @debug ? {} : { :out => File::NULL }
|
57
|
+
|
58
|
+
Task.run %W[ VBoxManage createvm --register --name macinbox --ostype MacOS1013_64 ] + [task_opts]
|
59
|
+
|
60
|
+
@collector.on_cleanup do
|
61
|
+
Task.run %W[ VBoxManage unregistervm macinbox --delete ] + [task_opts]
|
62
|
+
end
|
63
|
+
|
64
|
+
Task.run %W[ VBoxManage modifyvm macinbox --usbxhci on --memory #{@memory_size} --vram 128 --cpus #{@cpu_count} --firmware efi --chipset ich9 --mouse usbtablet --keyboard usb ] + [task_opts]
|
65
|
+
Task.run %W[ VBoxManage setextradata macinbox CustomVideoMode1 1280x800x32 ] + [task_opts]
|
66
|
+
Task.run %W[ VBoxManage setextradata macinbox VBoxInternal2/EfiGraphicsResolution 1280x800 ] + [task_opts]
|
67
|
+
Task.run %W[ VBoxManage setextradata macinbox GUI/ScaleFactor 2.0 ] + [task_opts] if @hidpi
|
68
|
+
Task.run %W[ VBoxManage storagectl macinbox --name #{"SATA Controller"} --add sata --controller IntelAHCI --hostiocache on ] + [task_opts]
|
69
|
+
Task.run %W[ VBoxManage storageattach macinbox --storagectl #{"SATA Controller"} --port 0 --device 0 --type hdd --nonrotational on --medium #{@input_vdi} ] + [task_opts]
|
70
|
+
Task.run %W[ VBoxManage modifyvm macinbox --boot1 disk ] + [task_opts]
|
71
|
+
Task.run %W[ VBoxManage export macinbox -o #{@box_dir}/box.ovf ] + [task_opts]
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
Logger.info "Moving the box to the destination..." do
|
76
|
+
FileUtils.chown_R ENV["SUDO_USER"], nil, @box_dir
|
77
|
+
FileUtils.mv @box_dir, @output_path
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
@@ -102,7 +102,8 @@ module Macinbox
|
|
102
102
|
FileUtils.mv "#{@temp_dir}/macinbox.hdd", @output_path
|
103
103
|
end
|
104
104
|
|
105
|
-
|
105
|
+
task_opts = @debug ? {} : { :out => File::NULL }
|
106
|
+
Task.run %W[ /usr/sbin/diskutil eject #{@device.shellescape} ] + [task_opts]
|
106
107
|
@device = nil
|
107
108
|
|
108
109
|
end
|
@@ -43,6 +43,10 @@ module Macinbox
|
|
43
43
|
check_macos_versions
|
44
44
|
create_wrapper_image
|
45
45
|
create_scratch_image
|
46
|
+
case @box_format
|
47
|
+
when /^virtualbox$/
|
48
|
+
setup_efi_partition
|
49
|
+
end
|
46
50
|
install_macos
|
47
51
|
create_rc_vagrant
|
48
52
|
case @box_format
|
@@ -112,7 +116,36 @@ module Macinbox
|
|
112
116
|
FileUtils.mkdir @scratch_mountpoint
|
113
117
|
quiet_flag = @debug ? [] : %W[ -quiet ]
|
114
118
|
Task.run %W[ /usr/bin/hdiutil create -size #{@disk_size}g -type SPARSE -fs #{@fstype} -volname #{"Macintosh HD"} -uid 0 -gid 80 -mode 1775 #{@scratch_image} ] + quiet_flag
|
115
|
-
Task.
|
119
|
+
devices = Task.backtick %W[ /usr/bin/hdiutil attach #{@scratch_image} -mountpoint #{@scratch_mountpoint} -nobrowse -owners on ]
|
120
|
+
puts devices if @debug
|
121
|
+
@efi_device = devices[/([^ \n]*)([ \t])+EFI/, 1]
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def setup_efi_partition
|
126
|
+
Logger.info "Setting up EFI partition..." do
|
127
|
+
@efi_mountpoint = "#{@temp_dir}/efi_mountpoint"
|
128
|
+
FileUtils.mkdir @efi_mountpoint
|
129
|
+
opts = @debug ? {} : { :out => File::NULL }
|
130
|
+
Task.run %W[ /usr/sbin/diskutil mount -mountPoint #{@efi_mountpoint} #{@efi_device} ] + [opts]
|
131
|
+
Task.run %W[ /bin/mkdir -p #{@efi_mountpoint}/EFI/drivers ]
|
132
|
+
Task.run %W[ /bin/cp /usr/standalone/i386/apfs.efi #{@efi_mountpoint}/EFI/drivers/ ]
|
133
|
+
File.write "#{@efi_mountpoint}/startup.nsh", <<~'EOF'
|
134
|
+
@echo -off
|
135
|
+
echo "Loading APFS driver..."
|
136
|
+
load "fs0:\EFI\drivers\apfs.efi"
|
137
|
+
echo "Refreshing media mappings..."
|
138
|
+
map -r
|
139
|
+
echo "Searching for bootloader..."
|
140
|
+
for %d in fs1 fs2 fs3 fs4 fs5 fs6
|
141
|
+
if exist "%d:\System\Library\CoreServices\boot.efi" then
|
142
|
+
echo "Found %d:\System\Library\CoreServices\boot.efi, launching..."
|
143
|
+
"%d:\System\Library\CoreServices\boot.efi"
|
144
|
+
endif
|
145
|
+
endfor
|
146
|
+
echo "Failed."
|
147
|
+
EOF
|
148
|
+
Task.run %W[ /usr/sbin/diskutil unmount #{@efi_device} ] + [opts]
|
116
149
|
end
|
117
150
|
end
|
118
151
|
|
@@ -300,11 +333,12 @@ module Macinbox
|
|
300
333
|
if @short_name == "vagrant"
|
301
334
|
Logger.info "Installing the default insecure vagrant ssh key..." do
|
302
335
|
contents = <<~EOF
|
303
|
-
#!/bin/sh
|
304
|
-
rm /etc/rc.vagrant
|
305
336
|
while [ ! -e /Users/vagrant ]; do
|
306
337
|
sleep 1
|
307
338
|
done
|
339
|
+
while [ `stat -f %u /Users/vagrant` == 0 ]; do
|
340
|
+
sleep 1
|
341
|
+
done
|
308
342
|
if [ ! -e /Users/vagrant/.ssh ]; then
|
309
343
|
mkdir /Users/vagrant/.ssh
|
310
344
|
chmod 0700 /Users/vagrant/.ssh
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'shellwords'
|
3
|
+
|
4
|
+
require 'macinbox/error'
|
5
|
+
require 'macinbox/logger'
|
6
|
+
require 'macinbox/task'
|
7
|
+
|
8
|
+
module Macinbox
|
9
|
+
|
10
|
+
module Actions
|
11
|
+
|
12
|
+
class CreateVDIFromImage
|
13
|
+
|
14
|
+
def initialize(opts)
|
15
|
+
@input_image = opts[:image_path] or raise ArgumentError.new(":image_path not specified")
|
16
|
+
@output_path = opts[:vdi_path] or raise ArgumentError.new(":vdi_path not specified")
|
17
|
+
|
18
|
+
@collector = opts[:collector] or raise ArgumentError.new(":collector not specified")
|
19
|
+
@debug = opts[:debug]
|
20
|
+
|
21
|
+
raise Macinbox::Error.new("input image not found") unless File.exist? @input_image
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
@temp_dir = Task.backtick %W[ /usr/bin/mktemp -d -t create_vdi_from_image ]
|
26
|
+
@collector.add_temp_dir @temp_dir
|
27
|
+
|
28
|
+
Logger.info "Attaching the image..." do
|
29
|
+
|
30
|
+
@collector.on_cleanup do
|
31
|
+
%x( /usr/sbin/diskutil eject #{@device.shellescape} > /dev/null 2>&1 ) if @device
|
32
|
+
end
|
33
|
+
|
34
|
+
@device = %x(
|
35
|
+
/usr/bin/hdiutil attach #{@input_image.shellescape} -nomount |
|
36
|
+
/usr/bin/grep _partition_scheme |
|
37
|
+
/usr/bin/cut -f1 |
|
38
|
+
/usr/bin/tr -d [:space:]
|
39
|
+
)
|
40
|
+
|
41
|
+
raise Macinbox::Error.new("failed to attach the image") unless File.exist? @device
|
42
|
+
end
|
43
|
+
|
44
|
+
Logger.info "Converting the image to VDI format..." do
|
45
|
+
task_opts = @debug ? {} : { :out => File::NULL }
|
46
|
+
Task.run %W[ VBoxManage convertfromraw #{@device} #{@temp_dir}/macinbox.vdi --format VDI ] + [task_opts]
|
47
|
+
Task.run %W[ /usr/sbin/diskutil eject #{@device} ] + [task_opts]
|
48
|
+
@device = nil
|
49
|
+
end
|
50
|
+
|
51
|
+
Logger.info "Moving the VDI to the destination..." do
|
52
|
+
FileUtils.chown ENV["SUDO_USER"], nil, "#{@temp_dir}/macinbox.vdi"
|
53
|
+
FileUtils.mv "#{@temp_dir}/macinbox.vdi", @output_path
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -44,13 +44,14 @@ module Macinbox
|
|
44
44
|
end
|
45
45
|
|
46
46
|
Logger.info "Converting the image to VMDK format..." do
|
47
|
+
task_opts = @debug ? {} : { :out => File::NULL }
|
47
48
|
rawdiskCreator = "#{@vmware_fusion_app}/Contents/Library/vmware-rawdiskCreator"
|
48
49
|
vdiskmanager = "#{@vmware_fusion_app}/Contents/Library/vmware-vdiskmanager"
|
49
50
|
Dir.chdir(@temp_dir) do
|
50
|
-
Task.run %W[ #{rawdiskCreator} create #{@device} fullDevice rawdisk lsilogic ]
|
51
|
-
Task.run %W[ #{vdiskmanager} -t 0 -r rawdisk.vmdk macinbox.vmdk ]
|
51
|
+
Task.run %W[ #{rawdiskCreator} create #{@device} fullDevice rawdisk lsilogic ] + [task_opts]
|
52
|
+
Task.run %W[ #{vdiskmanager} -t 0 -r rawdisk.vmdk macinbox.vmdk ] + [task_opts]
|
52
53
|
end
|
53
|
-
Task.run %W[ /usr/sbin/diskutil eject #{@device.shellescape} ]
|
54
|
+
Task.run %W[ /usr/sbin/diskutil eject #{@device.shellescape} ] + [task_opts]
|
54
55
|
@device = nil
|
55
56
|
end
|
56
57
|
|
data/lib/macinbox/actions.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "macinbox/actions/create_box_from_hdd"
|
2
|
+
require "macinbox/actions/create_box_from_vdi"
|
2
3
|
require "macinbox/actions/create_box_from_vmdk"
|
3
4
|
require "macinbox/actions/create_hdd_from_image"
|
4
5
|
require "macinbox/actions/create_image_from_installer"
|
6
|
+
require "macinbox/actions/create_vdi_from_image"
|
5
7
|
require "macinbox/actions/create_vmdk_from_image"
|
6
8
|
require "macinbox/actions/install_box"
|
data/lib/macinbox/cli.rb
CHANGED
@@ -33,7 +33,7 @@ module Macinbox
|
|
33
33
|
raise Macinbox::Error.new("Installer app not found: #{@options[:installer_path]}")
|
34
34
|
end
|
35
35
|
|
36
|
-
if not ["vmware_fusion", "vmware_desktop", "parallels"].include? @options[:box_format]
|
36
|
+
if not ["vmware_fusion", "vmware_desktop", "parallels", "virtualbox"].include? @options[:box_format]
|
37
37
|
raise Macinbox::Error.new("Box format not supported: #{@options[:box_format]}")
|
38
38
|
end
|
39
39
|
|
@@ -45,6 +45,10 @@ module Macinbox
|
|
45
45
|
raise Macinbox::Error.new("Parallels Desktop app not found: #{@options[:parallels_path]}")
|
46
46
|
end
|
47
47
|
|
48
|
+
if /^virtualbox$/ === @options[:box_format] && !File.exists?('/usr/local/bin/VBoxManage')
|
49
|
+
raise Macinbox::Error.new("VBoxManage not found: /usr/local/bin/VBoxManage")
|
50
|
+
end
|
51
|
+
|
48
52
|
vagrant_home = ENV["VAGRANT_HOME"]
|
49
53
|
|
50
54
|
if vagrant_home.nil? or vagrant_home.empty?
|
@@ -100,6 +104,7 @@ module Macinbox
|
|
100
104
|
@options[:image_path] = "macinbox.dmg"
|
101
105
|
@options[:vmdk_path] = "macinbox.vmdk"
|
102
106
|
@options[:hdd_path] = "macinbox.hdd"
|
107
|
+
@options[:vdi_path] = "macinbox.vdi"
|
103
108
|
@options[:box_path] = "macinbox.box"
|
104
109
|
@options[:boxes_dir] = vagrant_boxes_dir
|
105
110
|
@options[:collector] = collector
|
@@ -132,6 +137,16 @@ module Macinbox
|
|
132
137
|
Actions::CreateBoxFromHDD.new(@options).run
|
133
138
|
end
|
134
139
|
|
140
|
+
when /^virtualbox$/
|
141
|
+
|
142
|
+
Logger.info "Creating VDI from image..." do
|
143
|
+
Actions::CreateVDIFromImage.new(@options).run
|
144
|
+
end
|
145
|
+
|
146
|
+
Logger.info "Creating box from VDI..." do
|
147
|
+
Actions::CreateBoxFromVDI.new(@options).run
|
148
|
+
end
|
149
|
+
|
135
150
|
end
|
136
151
|
|
137
152
|
Logger.info "Installing box..." do
|
data/lib/macinbox/version.rb
CHANGED
data/macinbox.gemspec
CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.required_ruby_version = '~> 2.3'
|
26
26
|
|
27
|
-
s.requirements << "macOS
|
28
|
-
s.requirements << "macOS
|
27
|
+
s.requirements << "macOS Mojave"
|
28
|
+
s.requirements << "macOS Mojave installer app"
|
29
29
|
s.requirements << "Vagrant"
|
30
30
|
|
31
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macinbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Kramer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,9 +60,11 @@ files:
|
|
60
60
|
- lib/macinbox.rb
|
61
61
|
- lib/macinbox/actions.rb
|
62
62
|
- lib/macinbox/actions/create_box_from_hdd.rb
|
63
|
+
- lib/macinbox/actions/create_box_from_vdi.rb
|
63
64
|
- lib/macinbox/actions/create_box_from_vmdk.rb
|
64
65
|
- lib/macinbox/actions/create_hdd_from_image.rb
|
65
66
|
- lib/macinbox/actions/create_image_from_installer.rb
|
67
|
+
- lib/macinbox/actions/create_vdi_from_image.rb
|
66
68
|
- lib/macinbox/actions/create_vmdk_from_image.rb
|
67
69
|
- lib/macinbox/actions/install_box.rb
|
68
70
|
- lib/macinbox/cli.rb
|
@@ -93,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
95
|
- !ruby/object:Gem::Version
|
94
96
|
version: '0'
|
95
97
|
requirements:
|
96
|
-
- macOS
|
97
|
-
- macOS
|
98
|
+
- macOS Mojave
|
99
|
+
- macOS Mojave installer app
|
98
100
|
- Vagrant
|
99
101
|
rubyforge_project:
|
100
102
|
rubygems_version: 2.5.2.3
|