Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidarta-luizalabs/7cab254508a560b04c98203413825880 to your computer and use it in GitHub Desktop.
Save sidarta-luizalabs/7cab254508a560b04c98203413825880 to your computer and use it in GitHub Desktop.
tmp-create-vm
#!/bin/sh
if [ -z "$1" ] ;
then
echo Specify a virtual-machine name.
exit 1
fi
sudo virt-install \
--name $1 \
--ram 4096 \
--disk path=/var/lib/libvirt/images/$1.img,size=8 \
--vcpus 2 \
--os-type linux \
--os-variant ubuntu16.04 \
--network bridge:virbr0,model=virtio \
--graphics none \
--console pty,target_type=serial \
--location 'http://gb.archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/' \
--extra-args 'console=ttyS0,115200n8 serial'
#--location 'http://gb.archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/' \
#--location 'http://ftp.debian.org/debian/dists/stretch/main/installer-amd64/' \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment