[lxc-users] lxc-console not working on centos 7 container

Fajar A. Nugraha list at fajar.net
Thu Feb 12 10:20:03 UTC 2015


OK. So first of all, the steps that I posted above are NOT, in any
way, official or supported by lxc. However it works for me.

On Thu, Feb 12, 2015 at 3:23 PM, CDR <venefax at gmail.com> wrote:
> mount
> /dev/sda1 on / type ext4 (rw,errors=remount-ro)
> proc on /proc type proc (rw,noexec,nosuid,nodev)
> sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
> none on /sys/fs/cgroup type tmpfs (rw)
> none on /sys/fs/fuse/connections type fusectl (rw)
> none on /sys/kernel/debug type debugfs (rw)
> none on /sys/kernel/security type securityfs (rw)
> udev on /dev type devtmpfs (rw,mode=0755)
> devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
> tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
> none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
> none on /run/shm type tmpfs (rw,nosuid,nodev)
> none on /run/user type tmpfs
> (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
> none on /sys/fs/pstore type pstore (rw)
> systemd on /sys/fs/cgroup/systemd type cgroup
> (rw,noexec,nosuid,nodev,none,name=systemd)

Do you have systemd cgroup mounted?
# grep systemd /proc/mounts
systemd /sys/fs/cgroup/systemd cgroup
rw,nosuid,nodev,noexec,relatime,release_agent=/run/cgmanager/agents/cgm-release-agent.systemd,name=systemd
0 0

If not, try mounting it manually
# mkdir -p /sys/fs/cgroup/systemd
# mount -n -t cgroup -o
rw,nosuid,nodev,noexec,relatime,release_agent=/run/cgmanager/agents/cgm-release-agent.systemd,name=systemd
systemd /sys/fs/cgroup/systemdutopic ~ #


>
> I followed the steps
>
> This is all I get
> lxc-start -n c7v -F
> mount: sysfs already mounted or /usr/lib/x86_64-linux-gnu/lxc/sys busy
> mount: according to mtab, sysfs is mounted on /sys
> systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA
> +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
> Detected virtualization 'lxc'.
>
> Welcome to CentOS Linux 7 (Core)!
>
> Failed to install release agent, ignoring: No such file or directory
> Cannot add dependency job for unit display-manager.service, ignoring: Unit
> display-manager.service failed to load: No such file or directory.
> [  OK  ] Reached target Remote File Systems.
> [  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
> [  OK  ] Listening on Delayed Shutdown Socket.
> Failed to open /dev/autofs: No such file or directory
> Failed to initialize automounter: No such file or directory
> [FAILED] Failed to set up automount Arbitrary Executable File Formats File
> System Automount Point.
> See 'systemctl status proc-sys-fs-binfmt_misc.automount' for details.
> Unit proc-sys-fs-binfmt_misc.automount entered failed state.
> [  OK  ] Listening on Journal Socket.
>          Mounting Huge Pages File System...
>          Starting Create static device nodes in /dev...
>          Starting Apply Kernel Variables...
>          Starting Journal Service...
> [  OK  ] Started Journal Service.
> [  OK  ] Reached target Encrypted Volumes.
>          Mounting Debug File System...
>          Mounting POSIX Message Queue File System...
>          Mounting FUSE Control File System...


My GUESS is that you don't have systemd cgroup mounted. Here's what I have:

# lxc-start -F -n c7
mount: sysfs is already mounted or /usr/lib/x86_64-linux-gnu/lxc/sys busy
       sysfs is already mounted on /sys
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX
+IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc'.

Welcome to CentOS Linux 7 (Core)!

Failed to insert module 'autofs4'
Failed to install release agent, ignoring: No such file or directory
Cannot add dependency job for unit display-manager.service, ignoring:
Unit display-manager.service failed to load: No such file or
directory.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on Delayed Shutdown Socket.
[  OK  ] Reached target Encrypted Volumes.
Failed to open /dev/autofs: No such file or directory
Failed to initialize automounter: No such file or directory
[FAILED] Failed to set up automount Arbitrary Executable File Formats
File System Automount Point.
See 'systemctl status proc-sys-fs-binfmt_misc.automount' for details.
Unit proc-sys-fs-binfmt_misc.automount entered failed state.
[  OK  ] Listening on Journal Socket.
         Starting Create static device nodes in /dev...
         Starting Apply Kernel Variables...
         Mounting Huge Pages File System...
         Starting Journal Service...
[  OK  ] Started Journal Service.
         Mounting FUSE Control File System...
         Mounting Debug File System...
         Mounting POSIX Message Queue File System...
[  OK  ] Reached target Swap.
         Starting Remount Root and Kernel File Systems...
[  OK  ] Created slice Root Slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Created slice System Slice.
[  OK  ] Reached target Slices.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Started Create static device nodes in /dev.
[FAILED] Failed to start Apply Kernel Variables.
See 'systemctl status systemd-sysctl.service' for details.
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Mounted Debug File System.
[  OK  ] Mounted POSIX Message Queue File System.
[FAILED] Failed to start Remount Root and Kernel File Systems.
See 'systemctl status systemd-remount-fs.service' for details.
         Starting Load/Save Random Seed...
         Starting Configure read-only root support...
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started Configure read-only root support.
[  OK  ] Reached target Local File Systems.
         Starting Trigger Flushing of Journal to Persistent Storage...
         Starting Create Volatile Files and Directories...
[  OK  ] Started Trigger Flushing of Journal to Persistent Storage.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Reboot/Shutdown...
[  OK  ] Started Update UTMP about System Reboot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Reached target Timers.
[  OK  ] Reached target Paths.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting LSB: Bring up/down networking...
         Starting System Logging Service...
         Starting Login Service...
         Starting Permit User Sessions...
         Starting D-Bus System Message Bus...
[  OK  ] Started D-Bus System Message Bus.
         Starting Dump dmesg to /var/log/dmesg...
         Starting Cleanup of Temporary Directories...
[  OK  ] Started System Logging Service.
[  OK  ] Started Permit User Sessions.
[  OK  ] Started Cleanup of Temporary Directories.
         Starting Console Getty...
[  OK  ] Started Console Getty.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started Login Service.
[  OK  ] Started Dump dmesg to /var/log/dmesg.
[  OK  ] Started LSB: Bring up/down networking.
[  OK  ] Reached target Network.
         Starting OpenSSH server daemon...
[  OK  ] Started OpenSSH server daemon.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.

CentOS Linux 7 (Core)
Kernel 3.16.0-29-generic on an x86_64

c7 login:



-- 
Fajar


More information about the lxc-users mailing list