skip to Main Content

When running my Kali Linux docker container headerless-kali-linux without mounting volumes using the command:

docker run --rm -it headerless-kali-linux

The bash terminal within the container has colours and aesthetic features, which I want. They look like this:

Aesthetic features

However, when I mount my volumes to the container with the command:

docker run --rm -it -v %cd%root:/root -v %cd%postgresql:/var/lib/postgresql headerless-kali-linux

The aesthetic features go, as if volumes should somehow affect that, and I’m left with plain bash in my terminal. If anyone has any idea why this is happening, please let me know! Thanks in advance!

2

Answers


  1. Chosen as BEST ANSWER

    This problem seems to be fixed when creating docker volumes as opposed to using a local source in the C drive. You can also create a container first, not remove it, see its ID with docker ps -a and then populate local directories with docker cp <container ID>:/path/to/dir /path/to/local/volume. From here you can attach the volumes to the local sources with the -v /path/to/local/volume:/path/to/dir option when running.


  2. why this is happening

    You are mounting /root so you are overwriting shell startup files, that could set up the configuration.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search