- modify an ISO
- launch a web server or upload kickstart files to an http server
- write a json file with 20 or more parameters in it
- Launch the ISO in virtualbox as a new VM.
- yum update, and install "kernel-headers" and "kernel-devel", and reboot. REBOOT is important because if you don't your guest additions will try to install from the old kernel and fail. See https://www.centos.org/forums/viewtopic.php?t=3811 .
- Go to "settings" and check the live cd/dvd box.
- Go to Devices -> Insert Guest Additions CD Image.
- Now mount your guest additions . This is necessary if you want vagrant to do useful stuff (like set ip address, share folders, and so on).
mount /dev/cdrom /mnt/vboxadditions- Now
sh /mnt/VBoxLinuxAdditions.run . This will run the guest additions installation. If it tails , you probably have issues with the kernel source code directory - make sure `uname -a` - Now set up SSHD.
- turn off iptables
- add vagrant default ssh keys for user "root" and user "vagrant"
(see http://jayunit100.blogspot.com/2014/04/insecure-keys-for-devtest-ssh.html) - Start sshd and MAKE SURE you can ssh into the account passwordlessly from inside your machine. Note that you may need to set ssh_user in your Vagrantfile to "root" if you don't have a vagrant user.
vagrant package --base vagrant-base-box-creator --out newbox.box
- Congratulations ! You should now have a vagrant box which is bundled with both the vbox image and the vagrant box json file. - Now publish your box to vagrantcloud and your all set !

No comments:
Post a Comment