failed 9p experiment
authorIan Kelling <iank@fsf.org>
Mon, 16 Oct 2017 03:21:11 +0000 (20:21 -0700)
committerIan Kelling <iank@fsf.org>
Mon, 16 Oct 2017 03:21:11 +0000 (20:21 -0700)
symlinks like /a/exe/x -> /a/bin/x would fail to read,
ls: cannot read symbolic link 'rs': Too many levels of symbolic links

demohost-mount [new file with mode: 0755]

diff --git a/demohost-mount b/demohost-mount
new file mode 100755 (executable)
index 0000000..416ab2e
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+
+
+[[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
+
+virsh destroy demohost ||:
+
+# there's some other ways to configure it, but by default, we get perms of this user
+usermod -a -G ian libvirt-qemu
+usermod -a -G traci libvirt-qemu
+
+
+virsh attach-device demohost <(e "<filesystem type='mount' accessmode='mapped'> <source dir='/q'/> <target dir='/q'/> </filesystem>") --config ||:
+virsh attach-device demohost <(e "<filesystem type='mount' accessmode='mapped'> <source dir='/a'/> <target dir='/a'/> </filesystem>") --config ||:
+
+virsh start demohost
+while ! timeout -s 9 5 ssh demohost :; do sleep 3; done
+
+ssh root@demohost bash -s <<'EOFOUTER'
+set -eE -o pipefail
+
+cat >>/etc/modules <<EOF
+loop
+virtio
+9p
+9pnet
+9pnet_virtio
+EOF
+service kmod start
+
+cat >>/etc/fstab <<'EOF'
+/a /a            9p             trans=virtio    0       0
+/q /q            9p             trans=virtio    0       0
+/q/p  /p  none  bind  0 0
+EOF
+mkdir -p /a /q /p
+mount /a
+mount /q
+mount /p
+EOFOUTER