Skip to content

Commit

Permalink
Try automatic project sharing with LXD conainer over 9p filesystem.
Browse files Browse the repository at this point in the history
#32

More work needs to be done to make it work with remote containers
by reusing LXD connection.
  • Loading branch information
abitrolly committed Jan 6, 2020
1 parent 6db3d85 commit 03c040f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/lxd-runin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03c040f

Please sign in to comment.