opfthailand.blogg.se

Vagrant create box from iso
Vagrant create box from iso







vagrant create box from iso

The repository contains three powershell scripts, which automate large parts of the box creation. Add a metadata.json containing and zip it together with the Virtual Hard Drive and Virtual Machines directory. Package as Vagrant boxĪlmost done! Open the directory, where you exported the vm to, Snapshots may be deleted. Finally export it, this may take some time. The VM is now configured, shut it down and compact the disk with the HyperV wizard at Settings -> Hard Drive -> Edit.

vagrant create box from iso

Obviously you are in trouble if you had set the maximum size of the virtual disk too high! This is necessary to allow compaction of the disk image. The last three commands first fill all remaining space on the virtual disk with a single zero file, then delete that file. Kickstart settingsĪt last clean up and prepare virtual disk optimization. To provide some guidance I will explain the most important settings and post-installation steps.

vagrant create box from iso

Set the root password to "vagrant", if you want to publish the box later. I recommend using this to automate the installation, but you can of course perform a manual installation, detailed instructions are available here. Assigned memory and cpu count can also be changed later by Vagrant. You can increase the cpu count in the VM settings. Operating System: path/to/centos-install.iso.Make sure to select the correct virtual switch and set the path to the install. At the time of writing, that is version 6.6, which comes with HyperV support built-in. Download the latest CentOs6 release image. You should have enabled HyperV and set up a virtual switch for the VMs, called "vm-network". It contains the kickstart config and powershell scripts to automate large parts of the process. Source code can be found in my github repository. The instructions given in this post were the starting point for my adjusted configuration. This post shows how to create one from scratch. Unfortunately I was not able to find a working CentOs box for HyperV. After upgrading my laptop to Windows 8.1 I realized that one cannot easily run VirtualBox and HyperV in parallel.









Vagrant create box from iso