aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-08-06 17:05:57 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-08-06 17:05:57 -0400
commit536e7ff571614e53702a0f2f8e9e888f8dd87fa5 (patch)
treeee4e5191c3bfb3d4f0a3d074d66b65d9765f119a
parentbf4894692467528c2c4d8cf31bcdc1da8aa4c7bd (diff)
downloadkvm-manager-536e7ff571614e53702a0f2f8e9e888f8dd87fa5.tar.gz
kvm-manager-536e7ff571614e53702a0f2f8e9e888f8dd87fa5.tar.bz2
try to automate booting to d-i
-rw-r--r--README.md23
-rwxr-xr-xkvm-manager9
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