Skip to content

Instantly share code, notes, and snippets.

@radez
Created November 16, 2015 15:20
Show Gist options
  • Save radez/bc8ae1e35366dcd0ea70 to your computer and use it in GitHub Desktop.
Save radez/bc8ae1e35366dcd0ea70 to your computer and use it in GitHub Desktop.
#!/bin/sh
sudo virsh destroy small-cent7
sudo virsh undefine small-cent7
sudo rm -f small-cent7.img
sudo qemu-img create -f qcow2 small-cent7.img 8G
#qemu-img create small-centos65.img 8G
sudo virt-install -n small-cent7 -r 2048 --vcpus=2 --network network=default \
--graphics=spice --noautoconsole --noreboot -v \
-l http://repos.dfw.quadranet.com/centos/7/os/x86_64/ \
--disk=path=small-cent7.img,format=qcow2 \
-x "ks=http://192.168.122.1/small-cent7.cfg"
# /tmp does not have enough space; use /var/lib/libvirt/images instead
#export TMPDIR=/var/lib/libvirt/images
#virt-sparsify --compress small-centos65.img small-centos652.img
#mv /var/lib/libvirt/images/small-centos652.img /var/lib/libvirt/images/small-centos65.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment