我在fedora-20中使用默认配置文件和默认的fedora模板创建了一个lxc容器。
lxc-create -n root -t fedora
当我尝试启动容器时,我会收到用户名和密码提示。
在ubuntu中,似乎他们使用默认的“ubuntu”作为用户名和密码。我尝试使用模板中指定的“root”之类的密码的不同组合,但无法登录。
这是输出:
[root@localhost ~]# lxc-start -n root
systemd 208 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc'.
Welcome to Fedora 20 (Heisenbug)!
Set hostname to <root.localdomain>.
[ OK ] Reached target Remote 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 ] 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...utomount 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 udev Kernel Socket.
[ OK ] Listening on udev Control Socket.
[ OK ] Reached target Encrypted Volumes.
[ OK ] Listening on Journal Socket.
Starting Apply Kernel Variables...
Mounting Debug File System...
Starting udev Coldplug all Devices...
Mounting Huge Pages File System...
Mounting POSIX Message Queue File System...
Mounting FUSE Control File System...
Starting Create static device nodes in /dev...
Mounting Configuration File System...
Starting Journal Service...
[ OK ] Started Journal Service.
[ OK ] Reached target Paths.
[ OK ] Reached target Swap.
Starting Remount Root and Kernel File Systems...
Mounting Temporary Directory...
[ OK ] Started Apply Kernel Variables.
[ OK ] Mounted Debug File System.
[ OK ] Mounted Huge Pages File System.
[ OK ] Mounted POSIX Message Queue File System.
[ OK ] Mounted FUSE Control File System.
[ OK ] Started Create static device nodes in /dev.
[ OK ] Mounted Configuration File System.
[ OK ] Started Remount Root and Kernel File Systems.
[ OK ] Mounted Temporary Directory.
Starting Load/Save Random Seed...
Starting Configure read-only root support...
Starting udev Kernel Device Manager...
[ OK ] Reached target Local File Systems (Pre).
<30>systemd-udevd[24]: starting version 208
[ OK ] Started Load/Save Random Seed.
[ OK ] Started udev Kernel Device Manager.
[ 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 udev Coldplug all Devices.
[ OK ] Started Create Volatile Files and Directories.
Starting Update UTMP about System Reboot/Shutdown...
<46>systemd-journald[18]: Received request to flush runtime journal from PID 1
[ OK ] Started Trigger Flushing of Journal to Persistent Storage.
[ OK ] Started Update UTMP about System Reboot/Shutdown.
[ OK ] Reached target System Initialization.
[ OK ] Reached target Timers.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
Starting System Logging Service...
Starting Permit User Sessions...
Starting Login Service...
Starting D-Bus System Message Bus...
[ OK ] Started D-Bus System Message Bus.
[ OK ] Started Permit User Sessions.
Starting Getty on tty3...
[ OK ] Started Getty on tty3.
Starting Getty on tty4...
[ OK ] Started Getty on tty4.
Starting Getty on tty2...
[ OK ] Started Getty on tty2.
Starting Getty on tty1...
[ OK ] Started Getty on tty1.
Starting Console Getty...
[ OK ] Started Console Getty.
[ OK ] Reached target Login Prompts.
Starting Cleanup of Temporary Directories...
[ OK ] Started System Logging Service.
[ OK ] Started Cleanup of Temporary Directories.
[ OK ] Reached target Sound Card.
[ OK ] Started Login Service.
[ OK ] Reached target Multi-User System.
Fedora release 20 (Heisenbug)
Kernel 3.11.10-301.fc20.x86_64 on an x86_64 (console)
root login: root
Password:
Last failed login: Thu Jun 5 08:37:20 UTC 2014 on console
There were 3 failed login attempts since the last successful login.
Cannot make/remove an entry for the specified session
Fedora release 20 (Heisenbug)
Kernel 3.11.10-301.fc20.x86_64 on an x86_64 (console)
root login:
答案 0 :(得分:2)
尝试检查/ var / lib / lxc / $ container_name /
应该有一个名为tmp_root_pass
的文件将在您第一次成功登录后到期。
ls / var / lib / lxc / ovs / config rootfs tmp_root_pass
答案 1 :(得分:0)
对我来说lxc-attach -n root
有效。它chroots到系统,你可以从那里设置root密码。