9

I am trying to run wine in a 64b OS ( LUNA ) so i did follow this guide ! to set up wine , and i did chose to follow the first option : lxc container

Problem arise when i have to run the container:

sudo lxc-start -n my32bitbox

I am asked for a user-name and a password that i do not know.

I did try : root/root; user:user; my-username at the OS:my-password at the OS; ubuntu:ubuntu etc etc etc .

But not luck so far. if someone out there can help me put here, I really appreciate.

Alejandro
  • 135

3 Answers3

17

On newer installs, at least on my current install, you get this message instead of the old ubuntu/ubuntu message: (emph. mine)

You just created an Ubuntu container (release=trusty, arch=amd64, variant=default)

To enable sshd, run: apt-get install openssh-server

For security reason, container images ship without user accounts and without a root password.

Use lxc-attach or chroot directly into the rootfs to set a root password or create user accounts.

so how do you create a new user on a new LXC?

As hinted, you can either chroot into the rootfs, of use lxc-attach, which is the easiest option:

you@hostbox:/$ lxc-attach -n yourlxc
root@yourlxc:/# adduser username
Nanne
  • 649
3

The q. is pretty old, the other answers are too and it is yet again different. What we do use to access shell in a linux container is exec command - similar to what we have in kubes:

lxc exec <cont name> -- <cmd line>

if that is ubuntu then cmd line may be "bash" and it gives you a shell in a container as root.

1

Attention: this answer was correct at the time (2013), now it is not any longer: the correct way to do it is the one in Nanne's answer.


From the reference you gave, it seems you are trying to set up an LXC in Ubuntu. If this is so, this easy-to-locate Web page tells you that default username/password pair in newly-minted LXC's are:

  username: ubuntu
  password: ubuntu
MariusMatutiae
  • 48,517
  • 12
  • 86
  • 136