Booting UML for the First Time


Let's boot UML now:

host% ./linux


Notice two obvious things about the results, shown in Figure 2.2.

Figure 2.2. Output from the first boot of UML

Checking for /proc/mm...not found Checking for the skas3 patch in the host...not found Checking PROT_EXEC mmap in /tmp...OK Linux version 2.6.11-rc1-mm1 (jdike@tp.user-mode-linux.org) (gcc version 3.3.2      20031022 (Red Hat Linux 3.3.2-1)) #83 Thu Jan 27 12:16:00 EST 2005 Built 1 zonelists Kernel command line: root=98:0 PID hash table entries: 256 (order: 8, 4096 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 29368k available Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Checking for host processor cmov support...Yes Checking for host processor xmm support...No Checking that ptrace can change system call numbers...OK Checking syscall emulation patch for ptrace...missing Checking that host ptys support output SIGIO...Yes Checking that host ptys support SIGIO on close...No, enabling workaround Checking for /dev/anon on the host...Not available (open failed with errno 2) NET: Registered protocol family 16 mconsole (version 2) initialized on /home/jdike/.uml/3m3vDd/mconsole VFS: Disk quotas dquot_6.5.1 Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) NET: Registered protocol family 1 NET: Registered protocol family 17 Initialized stdio console driver Console initialized on /dev/tty0 Initializing software serial port version 1 VFS: Waiting 19sec for root device... VFS: Waiting 18sec for root device... VFS: Waiting 17sec for root device... VFS: Waiting 16sec for root device... VFS: Waiting 15sec for root device... VFS: Waiting 14sec for root device... VFS: Waiting 13sec for root device... VFS: Waiting 12sec for root device... VFS: Waiting 11sec for root device... VFS: Waiting 10sec for root device... VFS: Waiting 9sec for root device... VFS: Waiting 8sec for root device... VFS: Waiting 7sec for root device... VFS: Waiting 6sec for root device... VFS: Waiting 5sec for root device... VFS: Waiting 4sec for root device... VFS: Waiting 3sec for root device... VFS: Waiting 2sec for root device... VFS: Waiting 1sec for root device... VFS: Cannot open root device "98:0" or unknown-block(98,0) Please append a correct "root=" boot option Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(98,0) EIP: 0023:[<a015a751>] CPU: 0 Not tainted ESP: 002b:40001fa0 EFLAGS: 00000206     Not tainted EAX: 00000000 EBX: 00002146 ECX: 00000013 EDX: 00002146 ESI: 00002145 EDI: 00000000 EBP: 40001fbc DS: 002b ES: 002b Call Trace: a0863af0: [<a0030446>] printk+0x12/0x14 a0863b00: [<a003ff32>] notifier_call_chain+0x22/0x40 a0863b30: [<a002f9f2>] panic+0x56/0x108 a0863b40: [<a003c0f6>] msleep+0x42/0x4c a0863b50: [<a0002d96>] mount_block_root+0xd6/0x188 a0863bb0: [<a0002e9c>] mount_root+0x54/0x5c a0863bc0: [<a0002f07>] prepare_namespace+0x63/0xa8 a0863bd0: [<a0002ebb>] prepare_namespace+0x17/0xa8 a0863bd4: [<a000e190>] init+0x0/0x108 a0863be4: [<a000e190>] init+0x0/0x108 a0863bf0: [<a000e291>] init+0x101/0x108 a0863c00: [<a0027131>] run_kernel_thread+0x39/0x40 a0863c18: [<a000e190>] init+0x0/0x108 a0863c28: [<a0027117>] run_kernel_thread+0x1f/0x40 a0863c50: [<a0013211>] unblock_signals+0xd/0x10 a0863c70: [<a002c51c>] finish_task_switch+0x24/0xa4 a0863c84: [<a000e190>] init+0x0/0x108 a0863c90: [<a002c5ad>] schedule_tail+0x11/0x124 a0863cc4: [<a000e190>] init+0x0/0x108 a0863cd0: [<a001ad58>] new_thread_handler+0xb0/0x104 a0863cd4: [<a000e190>] init+0x0/0x108 a0863d20: [<a015a508>] __restore+0x0/0x8 a0863d60: [<a015a751>] kill+0x11/0x20

  1. The output resembles the boot output of a normal Linux machine.

  2. The boot was not very successful, as you can see from the panic and stack dump at the end.

It's worth comparing this to the boot output of a Linux system, which is normally available by running dmesg. You'll see a lot of similaritiesmany of the messages, such as the ones from the filesystem and network subsystems, are identical. Much of the rest are totally different, although they should seem similar in purpose. This is largely due to hardware drivers initializing. UML doesn't have the same hardware or drivers as the host, so their bootup messages will be different.

If you have access to Linux on several different architectures, such as x86 and x86_64 or ppc, you'll see the same sorts of differences between their boot output. In fact, this is a very apt comparison because UML is a different architecture from the Linux kernel running on the host.

Let's look at the output in more detail.

Checking for /proc/mm...not found Checking for the skas3 patch in the host...not found Checking PROT_EXEC mmap in /tmp...OK


These are checking the environment on the host to see if it can run at all (the executable /tmp check) and whether the host kernel has capabilities that allow UML to run more efficiently. You'll see more of this below, but these particular checks need to be done very early.

Checking for host processor cmov support...Yes Checking for host processor xmm support...No Checking that ptrace can change system call numbers...OK


These are checking some more capabilities of the host. The first two are checking processor capabilities, and the last is checking whether the host has a feature that's absolutely needed for UML to run (which all modern hosts do).

mconsole (version 2) initialized on /home/jdike/.uml/3m3vDd/mconsole ... Initialized stdio console driver ... Initializing software serial port version 1


Here, UML is initializing its drivers. A UML boot has much less output of this sort compared with a boot of a physical Linux system.

This is because UML uses resources on the host to support its virtual hardware, and there are many fewer types of these resources than there are different types of devices on a physical system. For example, every possible sort of block device within UML can be accessed as a host file, so block devices require a single UML driver. In contrast, the host has multitudes of block drivers, for IDE disks, SCSI disks, SATA disks, and so on. Because of the uniform interface provided by the host, UML requires many fewer drivers in order to access these devices and the data on them.

The first driver is the mconsole [2]driver, which allows a UML to be controlled and managed from the host. This has no hardware equivalent on most Linux systems. The last two are the console and serial line drivers, which obviously do have hardware equivalents, except that the UML drivers will communicate using virtual devices such as pseudo-terminals rather than physical devices such as a graphics card or serial line.

[2] MConsole stands for "Management Console" and is a mechanism for controlling and monitoring a UML instance from the host.

VFS: Waiting 1sec for root device... VFS: Cannot open root device "98:0" or unknown-block(98,0) Please append a correct "root=" boot option Kernel panic - not syncing: VFS: Unable to mount root fs on \       unknown-block(98,0)


Here is the panic that killed off this attempted run of UML. The problem is that we didn't provide UML with a root device, so it couldn't mount its root filesystem. This is fatal and causes the panic and the stack trace. You can make a physical Linux machine do exactly the same thing by putting a bogus root= option on the kernel command line using LILO or GRUB. [3]

[3] UML needs no bootloader like the host needs LILO or GRUB. As it is run from the command line, you can think of the host as being the UML bootloader.

Finally, an important point is that we just panicked a UML kernel, and the only result was that we were dropped back to the shell prompt. The host system itself, and everything else on the system, was totally unaffected by the crash. This demonstrates the basis of many of the advantages of UML over a physical systemit can be used in ways that may cause system crashes or other software malfunctions, but the damage is limited to the virtual machine. As we will see later, even this damage can be undone quite easily.

That may have been interesting, but not very useful. Now, we will boot UML successfully and see how it looks inside.



User Mode Linux
User Mode Linux
ISBN: 0131865056
EAN: 2147483647
Year: N/A
Pages: 116
Authors: Jeff Dike

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net