Using command aliases in LXD to exec a shell

How do you get a shell into a LXD container? In the following tutorial I show several options and suggest to use a LXD alias that gives you a login shell. This works for containers from the ubuntu: repository of container images that have the default ubuntu non-root account.