Created
April 27, 2018 18:55
-
-
Save 23jodys/cf193ec126efb4908f0b93a7c8d55c28 to your computer and use it in GitHub Desktop.
Building vagrant box from existing box with VMWare fusions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant init <base box> | |
vagrant up | |
vagrant ssh | |
# Do your customizations here | |
# yum -y install blah blah | |
# don't forget to clean up, yum clean all | |
# Reset the insecure key | |
dd if=/dev/zero of=/EMPTY bs=1M; rm -f /EMPTY | |
curl https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub > ~/.ssh/authorized_keys | |
exit | |
vagrant halt | |
cd .vagrant/machines/default/vmware_fusion/<UUID>/ | |
echo "{\"provider\": \"vmware_fusion\"}" > metadata.json | |
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -d *.vmdk | |
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -k *.vmdk | |
tar czvf ~/mybox.box ./* | |
vagrant box add mybox.box --name mine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment