Skip to content

Instantly share code, notes, and snippets.

@calerogers
Created September 17, 2016 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save calerogers/2e7628a1d37ba271b74fdb8bc0efce7b to your computer and use it in GitHub Desktop.
Save calerogers/2e7628a1d37ba271b74fdb8bc0efce7b to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo qemu-img create -f qcow2 /home/username/$1.img 250G &&
sudo virt-install \
--name $1 \
--boot uefi \
--machine q35 \
--ram 16384 \
--vcpus 2 \
--disk path=/home/username/$1.img,format=qcow2 \
--location http://ftp.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64 \
--graphics none \
--noautoconsole \
-x "
preseed/url=http://url-to-preseed/preseed.cfg
console=ttyS0
locale=en_US
console-keymaps-at/keymap=us
console-setup/ask_detect=false
console-setup/layoutcode=us
keyboard-configuration/layout=USA
keyboard-configuration/variant=USA
hostname=$2
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment