From 536e7ff571614e53702a0f2f8e9e888f8dd87fa5 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sun, 6 Aug 2017 17:05:57 -0400 Subject: try to automate booting to d-i --- README.md | 23 ++++++++++++++++++----- kvm-manager | 9 +++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b27080c..d60e284 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ Recommendations +++++++++++++++ * `openssh-server` : i've been using ssh to access the vm's serial console - + * `debian-installer-netboot` : having one of the d-i netboot packages installed makes guest installation easier + INSTALLATION ------------ @@ -101,19 +102,31 @@ additional access to other users. At this point, your virtual server is created, however, it has no operating system and it has not been started. -There are two options for installing debian onto the virtual server: +There are three options for installing debian onto the virtual server: + * debian-installer * netboot * iso (like a CD install) -To use netboot, make sure you have a working DHCP server running on your -host server and offering addresses over your bridge interface. + +"debian-installer" is the simplest, but it requires that you have one +of the debian-installer-netboot packages installed +(e.g. `debian-installer-9-netboot-amd64`): + + touch /home/$GUESTNAME/vms/$GUESTNAME/debian-installer + +Once the guest starts with the installer, you can remove this file to +avoid booting back into the installer. + +To use the "netboot" method, make sure you have a working DHCP server +running on your host server and offering addresses over your bridge +interface. Then, indicate that the server should boot via the network with: touch /home/$GUESTNAME/vms/$GUESTNAME/netboot -Alternatively, you can make a debian boot ISO image: +Finally, you can make a debian boot ISO image: * Make the directory /usr/local/share/ISOs * Create a serial console enabled debian installer. diff --git a/kvm-manager b/kvm-manager index a46f26a..800bf92 100755 --- a/kvm-manager +++ b/kvm-manager @@ -98,6 +98,7 @@ up() { CDISO="$OWNERHOME/vms/$VMNAME/cd.iso" NETBOOT="$OWNERHOME/vms/$VMNAME/netboot" + DEBIAN_INSTALLER="$OWNERHOME/vms/$VMNAME/debian-installer" KERNEL="$OWNERHOME/vms/$VMNAME/kernel" INITRD="$OWNERHOME/vms/$VMNAME/initrd" KVMARGS= @@ -110,6 +111,14 @@ up() { if [ "$CMDLINE" ]; then KERNEL_CMDLINE="$CMDLINE" fi + elif [ -e "$DEBIAN_INSTALLER" ] ; then + # FIXME: this should be generalized to pick the version and + # the architecture -- perhaps an empty $DEBIAN_INSTALLER would + # default to the latest sensible version, but its contents + # could otherwise select the version (and the arch if + # specified) + KVMARGS="-kernel /usr/lib/debian-installer/images/9/amd64/text/debian-installer/amd64/linux -initrd /usr/lib/debian-installer/images/9/amd64/text/debian-installer/amd64/initrd.gz -no-reboot" + KERNEL_CMDLINE="console=ttyS0,115200n8 -- console=ttyS0,115200n8" elif [ -e "$NETBOOT" ] ; then BOOTCHOICE=n elif [ -e "$CDISO" ] && [ -e $(readlink -f "$CDISO") ] ; then -- cgit v1.2.3