Created
September 9, 2018 19:19
-
-
Save sidarta-luizalabs/7cab254508a560b04c98203413825880 to your computer and use it in GitHub Desktop.
tmp-create-vm
This file contains hidden or 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
#!/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