Created
November 1, 2016 01:10
-
-
Save kurobeats/294969aa054d0fa1f653f5f38f1d63d0 to your computer and use it in GitHub Desktop.
Vagrant to libvirt image maker
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
#!/usr/bin/bash | |
d_util=wget | |
distro=debian | |
release=jessie64 | |
version=8.6.1 | |
working_dir="/tmp" | |
boxid=`< /dev/urandom tr -dc a-z-0-9 | head -c8; echo` | |
inseckey="https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant" | |
cd $working_dir | |
$d_util https://atlas.hashicorp.com/$distro/boxes/$release/versions/$version/providers/virtualbox.box -O virtualbox.box | |
$d_util $inseckey -O ~/.ssh/vagrant | |
tar -xaf virtualbox.box | |
qemu-img convert -O qcow2 ./box-disk1.vmdk /mnt/hdd/vms/$distro_$boxid.qcow2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment