bashlxc

How to set an initial script to be loaded at the start of LXC interactive session?


I'd like to have my favourite aliases and PS1 when starting an interactive LXD session by

lxc exec my-container -- su -l

I've placed.bashrc file in the $HOME directory (which is /home/root), but it didn't work.

As /bin/sh in my container does not point to /bin/bash, I've also tried the command lxc exec my-container -- /bin/bash , but if failed.


Solution

  • I figured it out myself.

    It required creating /root directory and placing my .bashrc there