From 315491c0757875f52816511ba6558d6171ec0106 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 20 Oct 2020 11:01:59 +0800 Subject: [PATCH] [feature] kvm --- kvm/install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 kvm/install.sh diff --git a/kvm/install.sh b/kvm/install.sh new file mode 100755 index 0000000..fbdd9af --- /dev/null +++ b/kvm/install.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +DIR=$(readlink -f $(dirname $0)) +. $DIR/../env.sh + +# tips +# 1. to relocate default pool +# ``` +# virsh pool-destroy default +# virsh pool-edit default # modify the `update` node +# virsh pool-start default +# ``` +# 2. create non-preallocated storage image file (slower performance but smaller size for copying) +# `qemu-img create -o preallocation=off -f qcow2 /path/to/img.qcow2 10G` +# 3. connecting to guest os prerequiste: use system session / guest nic source uses NAT + + +# install tools for kvm +case "$PM" in + apt) + sudo apt install libvirt-daemon-system libvirt-clients virt-manager bridge-utils + ;; + pacman) + # TODO + ;; +esac + +# configuration +sudo usermod -aG libvirt $USER