1

对于我的UML (user mode linux),我构建了一个基于 Debian 的根文件系统并添加了一个用户“uml”。但是当我尝试登录 UML 时,它没有被接受:

<snip>
(none) login: uml

Ubuntu 5.10 "Breezy Badger" (none) tty0

(none) login:
</snip>

我的 UML 是从 Linux 2.6.27 源代码树构建的。root-fs 被创建为: debootstrap --arch i386 breezy <my-dir>

创建后root-fs,我 chroot 进入它并执行“adduser uml”。但是为什么UML不接受用户名“uml”呢?

顺便说一句,我也尝试过“root”,但也没有被接受。

谢谢。

更新:这是我在登录会话期间的完整日志:

./linux mem=128M ubda=/nobackup/hxu2/uml/debian-2
Locating the bottom of the address space ... 0x0
Locating the top of the address space ... 0xffffd000
Core dump limits :
        soft - 104857600
        hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...missing
Checking for tmpfs mount on /dev/shm...OK
Checking PROT_EXEC mmap in /dev/shm/...OK
Checking for the skas3 patch in the host:
  - /proc/mm...not found: No such file or directory
  - PTRACE_FAULTINFO...not found
  - PTRACE_LDT...not found
UML running in SKAS0 mode
[    0.000000] Linux version 2.6.27 (hxu2@sjc-ads-445) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)) #1 Sat Jan 26 21:41:07 PST 2013
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: mem=128M ubda=/nobackup/hxu2/uml/debian-2 root=98:0
[    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[42949372.960000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[42949372.960000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[42949372.960000] Memory: 126832k available
[42949372.960000] Calibrating delay loop... 3774.87 BogoMIPS (lpj=18874368)
[42949373.250000] Mount-cache hash table entries: 512
[42949373.250000] Checking for host processor cmov support...Yes
[42949373.250000] Checking that host ptys support output SIGIO...Yes
[42949373.250000] Checking that host ptys support SIGIO on close...No, enabling workaround
[42949373.250000] net_namespace: 288 bytes
[42949373.250000] /usr/include/linux/aio_abi.h not present during build
[42949373.250000] 2.6 host AIO support not used - falling back to I/O thread
[42949373.250000] NET: Registered protocol family 16
[42949373.280000] NET: Registered protocol family 2
[42949373.440000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[42949373.440000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[42949373.440000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[42949373.440000] TCP: Hash tables configured (established 4096 bind 4096)
[42949373.440000] TCP reno registered
[42949373.510000] NET: Registered protocol family 1
[42949373.510000] Checking host MADV_REMOVE support...<3>MADV_REMOVE failed, err = -22
[42949373.510000] Can't release memory to the host - memory hotplug won't be supported
[42949373.510000] mconsole (version 2) initialized on /users/hxu2/.uml/DytWds/mconsole
[42949373.510000] Host TLS support detected
[42949373.510000] Detected host type: x86_64 (GDT indexes 12 to 15)
[42949373.510000] VFS: Disk quotas dquot_6.5.1
[42949373.510000] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[42949373.510000] msgmni has been set to 248
[42949373.510000] io scheduler noop registered
[42949373.510000] io scheduler anticipatory registered (default)
[42949373.510000] io scheduler deadline registered
[42949373.510000] io scheduler cfq registered
[42949373.510000] TCP cubic registered
[42949373.510000] NET: Registered protocol family 17
[42949373.510000] Initialized stdio console driver
[42949373.510000] Console initialized on /dev/tty0
[42949373.510000] console [tty0] enabled
[42949373.510000] Initializing software serial port version 1
[42949373.510000] console [mc-1] enabled
[42949373.510000]  ubda: unknown partition table
[42949373.510000] kjournald starting.  Commit interval 5 seconds
[42949373.510000] EXT3-fs: mounted filesystem with ordered data mode.
[42949373.510000] VFS: Mounted root (ext3 filesystem) readonly.
 * version 2.86 booting
 * Entering runlevel: 2


Ubuntu 5.10 "Breezy Badger" (none) tty0

(none) login: uml
(none) login: root
df^H^H^H




 * Id "1" respawning too fast: disabled for 5 minutes
 * no more processes left in this runlevel

Ubuntu 5.10 "Breezy Badger" (none) tty0

(none) login: uml

Ubuntu 5.10 "Breezy Badger" (none) tty0

(none) login: uml
(none) login: 
Login timed out after 60 seconds.

更新:我尝试与答案相同,并收到此错误。注意我在 32 位 i386 中构建了 2.6.27 内核。

[42949373.510000] VFS: Mounted root (ext3 filesystem) readonly.
modprobe: FATAL: Could not load /lib/modules/2.6.27/modules.dep: No such file or directory

INIT: version 2.88 booting
INIT: Entering runlevel: 2
[42949373.660000] Serial line 0 assigned device '/dev/pts/8'

INIT: Id "c0" respawning too fast: disabled for 5 minutes

Debian GNU/Linux 6.0 (none) tty0

(none) login: root

Login incorrect
4

2 回答 2

0

我已经编辑了我的答案!

这就是我所做的,它对我有用!

构建内核

# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.tar.gz

# bunzip2 linux-2.6.39.tar.gz

# make ARCH=um defconfig

# make ARCH=um

下载root-fs

# wget http://fs.devloop.org.uk/filesystems/Debian-Squeeze/Debian-Squeeze-AMD64-root_fs.bz2

# bunzip2 Debian-Squeeze-AMD64-root_fs.bz2

启动 UML Linux

./vmlinux ubda=/root/Debian-Squeeze-AMD64-root_fs mem=128m umid=debian
...
...
...
Debian GNU/Linux 6.0 (none) tty0

(none) login: root
Last login: Wed Jan 30 19:57:33 UTC 2013 on tty0
Linux (none) 2.6.39 #1 Wed Jan 30 11:49:25 PST 2013 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@(none):~# whoami
root
于 2013-01-29T19:25:41.290 回答
0

我刚刚发布了一个可能相关的问题。然后偶然发现了答案,这至少对我有用。

您正在运行哪个主机版本?我发现以 2.6.18-194.8.1.el5 作为主机,这些版本的 UML 确实可以工作,而对于 2.6.9-89.0.11.ELlargesmp 主机则不行。

为什么?... 我不知道 :(

于 2013-07-18T22:31:04.450 回答