Skip to content

Instantly share code, notes, and snippets.

@AndiSusanto15
Created April 27, 2020 06:20
Show Gist options
  • Save AndiSusanto15/8a169ebe873cf93214c056939cd5db37 to your computer and use it in GitHub Desktop.
Save AndiSusanto15/8a169ebe873cf93214c056939cd5db37 to your computer and use it in GitHub Desktop.
#!/bin/bash
virt-install \
--name $1 \
--ram 2048 \
-v \
--autostart \
--virt-type kvm \
--disk path=/var/lib/libvirt/images/$1.qcow2,size=40 \
--vcpus 1 \
--cpu host \
--os-type linux \
--os-variant centos7.0 \
--network bridge=br0 \
--graphics none \
--console pty,target_type=serial \
--location '/root/iso/CentOS-7-x86_64-Minimal-2003.iso' \
--extra-args 'console=ttyS0,115200n8 serial' | tee -a logs/kvm.install-$1.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment