I know this is probably google skills deficiency on my behalf but for the love of god I cant shell into a CentOS 7 container on an Ubuntu 17.04 host.

user@ubuntu1704:~$ lxc shell centos7

absolutely nothing happens ... no error and I cant find a way to specify login user and password.

Here is how I launched the container

lxc launch images:centos/7/amd64 centos7

it downloaded the image and launched it. info shows all is fine and has correct ip and everything. By default ssh connections refused (SELinux)

Please help!! very stuck!! Thanks alot !!

  • Have you tried lxc attach --name centos7 or lxc-attach --name centos7? – Patrick Oct 5 '17 at 23:57

Found it:

  • For CentOS images:lxc exec my-container -- bash

  • For Ubuntu images: lxc shell my-container, or

  • For Ubuntu images: lxc exec my-container -- sudo --login --user username

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.