The lxc-start command starts a container. As with other lxc commands, you must provide the name of the container to start:
# lxc-start -n ubuntuContainer
The boot sequence may hang and you may see errors similar to the following one. These are caused by the container's boot sequence trying to perform graphics operations, such as displaying a splash screen without graphics support in the client:
<4>init: plymouth-upstart-bridge main process (5) terminated with
status 1
...
You can wait for these errors to time out and ignore them, or you can disable the splash screen. Disabling the splash screen varies between distributions and releases. The files may be in /etc/init, but that's not guaranteed.
There are two ways to work within a container:
- lxc-attach: This attaches directly to a root account on a running container
- lxc-console: This opens a console for a login session on a running container
The first use of a container is to attach directly to create user accounts:
# lxc-attach -n containerName root@containerName:/# root@containerName:/# useradd -d /home/USERNAME -m USERNAME root@containerName:/# passwd USERNAME Enter new UNIX password: Retype new UNIX password:
After you've created a user account, log in as an unprivileged user or root with the lxc-console application:
$ lxc-console -n containerName Connected to tty 1 Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself Login: