Permanent link to this article: https://blog.simos.info/using-command-aliases-in-lxd-to-exec-a-shell/

3 comments

1 ping

  1. One advantage of overriding the ‘shell’ alias instead of using ‘ubuntu’ is that Bash completion keeps working with ‘shell’ (both for filling the command name and the names of the container)

    1. Indeed, that’s an issue. Using the snap package of LXD, it is not possible to edit /etc/bash_completion.d/lxc with the completion rules because this is a link into the read-only LXD image.
      What you can do instead, is take a copy of this file, then remove the link and place the actual file in place. By doing so, you can edit it and add new commands. To add ubuntu (as in lxc ubuntu mycontainer), search for shell in the completion file and add ubuntu in the list.

    • Makrand on May 9, 2020 at 06:25
    • Reply

    Nice Article! BTW, is there any way to login into non ubuntu containers are regular user?

    Also, do you work on development on LXC/D?

  1. […] We can now create a container that uses the nonetwork profile. When we run lxc launch, we specify the nonetwork profile, and use the default ubuntu container image (ubuntu:) which is currently Ubuntu 18.04 LTS. In a few months this will switch to Ubuntu 20.04 LTS. We are happy with any LTS container image. If you wanted to specify specifically Ubuntu 18.04 LTS, replace ubuntu: with ubuntu:18.04. Finally, we give the name withoutnetworking. Once the container is created, we lxc list it to verify there is no IP address and finally we get a shell into it with lxc ubuntu containername. […]

Leave a Reply to Makrand Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: