diff --git a/bin/lxd-runin.sh b/bin/lxd-runin.sh index 96de737..7d76e7b 100755 --- a/bin/lxd-runin.sh +++ b/bin/lxd-runin.sh @@ -15,7 +15,15 @@ then else echo "Creating container '$NAME' ($OSTORUN)" lxc launch "images:$OSTORUN" "$NAME" - lxc config device add "$NAME" "$NAME-shared" disk source="$PWD" path="/root/$NAME" + if [[ ! -e ~/go/bin/ufs ]]; then + echo "Mounting $PWD as /root/$NAME read-only" + lxc config device add "$NAME" "$NAME-shared" disk source="$PWD" path="/root/$NAME" + else + echo "Sharing writeable $PWD as /root/$NAME" + lxc config device add IPython shared9p proxy listen=tcp:127.0.0.1:3333 connect=tcp:127.0.0.1:3333 bind=host + echo "Install https://github.com/aperezdc/9pfuse and " + echo "run `9pfuse -D 127.0.0.1:3333 /root/$NAME` on guest." + fi fi # https://stackoverflow.com/questions/7120426/how-to-invoke-bash-run-commands-inside-the-new-shell