gpt4 book ai didi

linux - 无法登录用户模式 ​​Linux (UML)

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:37:32 27 4
gpt4 key购买 nike

对于我的 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”但还是​​不被接受。

谢谢。

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

./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

最佳答案

我已经编辑了我的答案!

这就是我所做的并且对我有用!

构建内核

# 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

关于linux - 无法登录用户模式 ​​Linux (UML),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14590066/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com