12

I recently installed the 32 bit lxc container on a 64 bit Ubuntu 12.04 system. When I run the command sudo lxc-start -n my32bitbox I am greeted with a login prompt. I enter the default login and password which is: login= ubuntu ; password= ubuntu; but I am still unable to log on to the container. How can I resolve this issue?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Crelloc
  • 121
  • 1
  • 1
  • 3
  • Does authentication log file of the container show any login fail? See /var/lib/lxc/my32bitbox/rootfs/var/log/auth.log after login try. (Use appropriate container's rootfs address if you haven't created the container in the defualt path) – SuB Dec 12 '14 at 13:57

5 Answers5

16

login to container

lxc exec <container-name> -- sudo --login --user <username>

get the shell prompt of the container

lxc exec <container-name> -- sudo /bin/bash
3
lxc-start -n <container_name> -d
lxc-attach -n <container_name>

does the trick

amc
  • 7,142
Ham5ter
  • 39
2

You can also use ssh command to login to LXC-container:

ssh lxcuser@container_ip_address

To find out the LXC IP-address you can use this:

ssh ubuntu@`sudo lxc-info -iH -n CN`

where CN is the container name and 'ubuntu' is the user acc in the LXC.

OpenITeX
  • 123
1
lxc exec <container> passwd

set your passwd exit out (ctrl-a q)

then

lxc console <container>
1

You need to enter the password for the "sudo" command to gain root privilege, in order to run lxc-start. It is not the login prompt for the container itself.

OpenITeX
  • 123
Jing Qiu
  • 111