0

I have created an LXC container on CentOS 7. Every time I do sudo lxc-start -n mycontainer I'm greeted with a login prompt:

...
[  OK  ] Started Console Getty.
[  OK  ] Started Command Scheduler.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started Cleanup of Temporary Directories.
[  OK  ] Started Login Service.

mycontainer login: root
Password: 
Login incorrect

Doint CTRL+C or CTRL+Z won't get rid of it, which means I can't use this terminal anymore. However, on another terminal I can SSH into the container using the exact same password that is rejected above. I also tried root:root as I read somewhere that it would be the default.

All I want to do now is disable this login prompt so I can just use either lxc-attach or SSH to get a console. In Ubuuntu I never get a login prompt as default, is there a way to disable it on CentOS LXC to get the same behaviour? I looked up man lxc.container.conf but couldn't find anything useful. Thanks in advance.

1 Answer 1

0

To disable the login prompt on request, it should be started as a daemon, as follows:

sudo lxc-start -n mycontainer -d

The manual says this is the default behaviour (which I see in my Ubuntu machine) but for some reason it is not on this CentOS container on a CentOS host, and I'd still like to see answers showing how to restore the default behavior (start as a daemon).

1
  • 1
    Just comparing two debian versions (jessie's and stretch's) I can see the default behaviour changed: that was -F before, and it's -d after. So I think there's no behaviour to restore. I guess CentOS 8 will be using -d as default when released.
    – A.B
    Jul 1, 2019 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .