7

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.

0

3 Answers 3

0

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
1
  • This is no longer the case. You need to attach to the root user, then use passwd to set the root password.
    – Phizaz
    Commented Aug 25, 2019 at 3:11
16

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
1
  • 1
    FWIW, I had to install the lxc-utils package to get lxc-attach on Ubuntu 18.04.
    – Cimm
    Commented May 23, 2018 at 12:18
2

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.

You must log in to answer this question.

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