Skip to content

Instantly share code, notes, and snippets.

@sudachi0114
Created April 21, 2021 05:07
Show Gist options
  • Save sudachi0114/dab2e6652e0e6895fb3fb405be01258f to your computer and use it in GitHub Desktop.
Save sudachi0114/dab2e6652e0e6895fb3fb405be01258f to your computer and use it in GitHub Desktop.
#!/bin/bash
# please set $VM_NAME
virt-install \
--name ${VM_NAME} \
--ram 8192 \
--disk path=/var/kvm/images/${VM_NAME}.img,size=100 \
--vcpus 4 \
--os-type linux \
--os-variant ubuntu18.04 \
--network bridge=br0 \
--graphics vnc,port=5901,listen=0.0.0.0,keymap=ja,password=vnc \
--noautoconsole \
--console pty,target_type=serial \
--cdrom=/var/kvm/iso/ubuntu-18.04.5-live-server-amd64.iso \
--host-device 01:00.0 \
--features kvm_hidden=on \
--machine q35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment