X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=input%2Fhowto%2Finstall-kvm.creole;h=c72af39489a728a20a34fc2349c22cf7ecf4f434;hb=7ba134fb155e7b0b2ca3ab6950f046462c03a9f8;hp=ae3188ac2e03c54a4949173bb63221d037dfc3bf;hpb=9c4a230512d2a8f611fc8369696ba3e4964cbb75;p=mirror%2Fdsa-wiki.git diff --git a/input/howto/install-kvm.creole b/input/howto/install-kvm.creole index ae3188a..c72af39 100644 --- a/input/howto/install-kvm.creole +++ b/input/howto/install-kvm.creole @@ -12,7 +12,7 @@ setup_env() { echo -n "New hostname: " && export LC_ALL=C && read guest && - target=/mnt/target && + target="/mnt/target-$guest" && mirror=`cat /etc/apt/sources.list /etc/apt/sources.list.d/debian.list 2>/dev/null | awk '/^deb.*debian/ {print $2; exit}'` && vgdefault=`vgdisplay -c | awk -F: '{print $1;exit}' | sed 's/ *//g'` && echo -n "Volume group? [$vgdefault]: " && @@ -37,7 +37,13 @@ setup_env() { echo "Boot device will be $dev_boot" && fs=ext4 fi && - dev_swap="/dev/mapper/$vg-$guest--swap" && + if [ "$vg" != "" ]; then + dev_swap="/dev/mapper/$vg-$guest--swap" + elif [ -d /SWAPFILES ]; then + dev_swap=/SWAPFILES/$guest-swap + else + echo "No idea how to do swap" && false + fi && echo -n "Use a /boot filesystem (strongly recommended)? [Y/n] " && read use_boot && echo "Swap device will be $dev_swap" && @@ -193,6 +199,14 @@ And set a password: chroot . passwd }}} +Set a nameserver config that works once the VM has booted. Later in the process we will install unbound anyway. +{{{ +cat > etc/resolv.conf << EOF +nameserver 8.8.8.8 +search debian.org +EOF +}}} + And unmount: {{{ @@ -207,7 +221,7 @@ And unmount: === virsh setup === -Setup a new kvm domain by creating a new file in /etc/da-virt/`hostname/$guest.xml. +Setup a new kvm domain by creating a new file in /etc/dsa-kvm/`hostname/$guest.xml. * Properly configure hostname * Pick a new uuid ({{{uuidgen}}})