summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2020-05-29 22:29:15 +0200
committerStefan Kreutz <mail@skreutz.com>2020-05-29 22:29:15 +0200
commit0a0e111167f544b5ac660bc7629be9bb9b34b91f (patch)
tree959b923700a1d5379b507f3c78433350ddbbe870
parent394e05445225984057cca0c2eaef8fc8eab1aeab (diff)
downloadautoinstall-openbsd-on-qemu-0a0e111167f544b5ac660bc7629be9bb9b34b91f.tar
Serve mirror at unprivileged port 8080
-rw-r--r--install.conf4
-rwxr-xr-xrun20
2 files changed, 11 insertions, 13 deletions
diff --git a/install.conf b/install.conf
index bde6b40..a417f93 100644
--- a/install.conf
+++ b/install.conf
@@ -7,9 +7,9 @@ Setup a user = puffy
Password for user = *************
What timezone are you in = UTC
Location of sets = http
-HTTP Server = 10.0.2.2
+HTTP Server = 10.0.2.1
Unable to connect using https. Use http instead = yes
-URL to autopartitioning template for disklabel = http://10.0.2.2/disklabel
+URL to autopartitioning template for disklabel = http://10.0.2.1/disklabel
Set name(s) = site66.tgz
Checksum test for site66.tgz failed. Continue anyway = yes
Unverified sets: site66.tgz. Continue without verification = yes
diff --git a/run b/run
index 7e1d8c0..55ea44f 100755
--- a/run
+++ b/run
@@ -2,12 +2,12 @@
# Auto-install OpenBSD/amd64 6.6 to a QEMU guest machine.
#
-# Run the following command to serve the OpenBSD mirror at http://127.0.0.1
-# (port 80):
+# Run the following command to serve the OpenBSD mirror at
+# http://127.0.0.1:8080:
#
-# sudo python3 -m http.server \
+# python3 -m http.server \
# --directory ./openbsd-vm/mirror \
-# --bind 127.0.0.1 80
+# --bind 127.0.0.1 8080
#
# Pass the following options to ssh or scp to connect to the guest machine:
#
@@ -39,7 +39,8 @@
#
# Port forwardings:
#
-# host:2222 -> guest:22
+# 10.0.2.1:80 -> host:8080
+# host:2222 -> guest:22
#
# Copyright (c) 2020 Stefan Kreutz <mail@skreutz.com>
@@ -113,12 +114,9 @@ then
# Wait until the HTTP server is online.
#
- # TODO: Serve HTTP and TFTP from another virtual machine to remove the
- # necessity to bind to a privileged port. Maybe use Linux' tftpd from Arch
- # Linux package tftp-hpa. Redirect ports using qemu.
- while [ ! "$( curl --silent --location --write-out '%{http_code}\n' --output /dev/null http://127.0.0.1/install.conf )" = 200 ] ;
+ while [ ! "$( curl --silent --location --write-out '%{http_code}\n' --output /dev/null http://127.0.0.1:8080/install.conf )" = 200 ] ;
do
- ( >&2 printf "Please serve the directory ./openbsd-vm/mirror at http://127.0.0.1 (port 80).\n" )
+ ( >&2 printf "Please serve the directory ./openbsd-vm/mirror at http://127.0.0.1:8080.\n" )
sleep 5
done
@@ -141,6 +139,6 @@ qemu-system-x86_64 \
-m "${MEMORY_SIZE}" \
-smp "cpus=${CPU_COUNT}" \
-device e1000,netdev=n1 \
- -netdev user,id=n1,hostname=openbsd-vm,tftp=.openbsd-vm/tftp,bootfile=auto_install,hostfwd=tcp::2222-:22 \
+ -netdev "user,id=n1,hostname=openbsd-vm,tftp-server-name=10.0.2.1,tftp=.openbsd-vm/tftp,bootfile=auto_install,hostfwd=tcp::2222-:22,guestfwd=tcp:10.0.2.1:80-cmd:socat - tcp:127.0.0.1:8080" \
-drive "file=${VM_FILE},media=disk,if=virtio" \
-nographic
Generated by cgit. See skreutz.com for my tech blog and contact information.