Other than the two UML web-sites, the mailing lists are a great place to find answers. Try the user list or the devel list.

Troubleshooting

Appearance

Q: How do I stop UML launching all those xterms?

A1: Put "con=/dev/null con0=fd:0,fd:1 con1=xterm" on the command line. This suppresses all the virtual terminals except the first one (so you can log in if networking is broken!) and directs all the bootup & kernel message stuff to the terminal from which UML was launched.

A2: You even might launch a getty inside the uml and handle con0 like any other conX, don't forget to add <code>tty0</code> or <code>vc/0</code> to <code>/etc/securetty</code> if you want to allow root logins there.

A3: An other tip posted on the mailinglist was this commandline: <code>linux ro con0=null,fd:2 con1=fd:0,fd:1 ubda=/tmp/disk1</code>. No additional (x)term will be needed (disable all other gttys in inittab), messages on con0 are mapped to stderr and con1 is stdin/stdout of the current terminal or virtual console. This way you only need the terminal you launched the uml from and have the console and messages without adding a getty for con0 inside the uml.

A4: Edit /etc/inittab and comment out the extra terminals in the virtual system. # TERMINALS c1:12345:respawn:/sbin/agetty 38400 tty1 linux c2:12345:respawn:/sbin/agetty 38400 tty2 linux #c3:12345:respawn:/sbin/agetty 38400 tty3 linux #c4:12345:respawn:/sbin/agetty 38400 tty4 linux #c5:12345:respawn:/sbin/agetty 38400 tty5 linux #c6:12345:respawn:/sbin/agetty 38400 tty6 linux

UlfBartelt . o O ( Todo: Check how a system launched with this commandline behaves in single user mode. I expect this to act on con0 and this might be a problem. )

Networking

Q: I must configure UML network in a difficult situation and I'm out of ideas. Can you help me?

A: Take a look at our networking page for HOWTOs, guides and suggestions. Also, there are several other resources available on the Internet. Please add any useful links to the networking page as you find them.

Q: I can't get the guest kernel to ping it's own IP address, I get 'sendto: invalid argument', but it can ping the host and the host can ping both itself and the guest. what's up?

A: Make sure the guest kernel has a loopback-interface defined and up. You need this in order to ping your other interfaces.

Compiling

Q: I get a 'storage size of `ldt' isn't known' while compiling.

A: This is a Debian-ism. You can either comment that function and its caller out, or use this patch which apparently fixes it too: http://people.0x63.nu/%7Eandersg/uml-minor-fixes.diff (Answer from Dave Hansen's list post).

Q: When I compile on an x64 box with 32 bit mode it won't compile to a 32 bit target

A: For all compiles etc add SUBARCH=i386 to the command e.g. <verbatim> make linux ARCH=um SUBARCH=i386 </verbatim>

Q: What kernel compile options should I set

A1: Copy arch/um/defconfig to .config, when running 'make xconfig ARCH=um' you still have to do a 'save', otherwise you get a bunch of prompts at make time.

A2: The defaults (if you don't use defconfig above) miss a couple in 2.6.x. This is what I would recommend adding - CONFIG_HOST_FS (Host filesystem, under UML-specific options), CONFIG_BLK_DEV_UBD (Virtual Block Device under block devices), all the character devices, UML Network devices - whichever ones you need - I would recommend turning on Virtual network device and the daemon transport. Feel free to correspond with IanMcDonald if you have problems.

Running Kernel 2.6

Q: UML boot startup. init(8) starts successfully, but nothing else starts. If I set init=/bin/sh, and then try to run other programs, I get something like "<code>sh: ../nptl/sysdeps/unix/sysv/linux/fork.c:132: libc_fork: Assertion </code>"..."<code> != ppid' failed.</code>".

A: You're probably using a version of glibc compiled with Native POSIX Thread Library (NPTL) support, in the UML filesystem. The UML kernel doesn't support NPTL, but inside the UML the glibc is trying to use NPTL, so you get this assertion failure. Try recompiling glibc without NPTL support. (How? The system is not booting? But see below for special note on Debian system.)

On Debian and Red Hat (and Fedora), you can disable NPTL at runtime by renaming /lib/tls (to /lib/tls.bak, for example) in your UML guest's root filesystem.

Another symptom of the same problem is that after updating some packages inside a working UML installation, the UML stopped working with the messages mentioned in the question. It may also stop booting properly, with messages like "INIT: Id X respawning too fast", or if setpgid is complaining, giving an "No such process" when the pid exists. There are other reasons why this could be happening, but if your UML was working properly and all you did was upgrade packages, then this is a likely reason.

See this message from Blaisor to the user-mode-linux-devel mailing list for more information.

Another symptom can be Segmentation Fault of some application when it is run. Make sure you have enough memory/swap. If it is not a memory problem, it's quite possibly the "/lib/tls" problem. Example: Installation of firefox 1.0.6 in ubuntu image (Hoary 5.04) during chrome registry initialization fails because of this.

Q: UML kernel panics on boot when running on Ubuntu 6.06, and a 64-bit opteron processor. Home-brew and precompiled UML kernels all fail regardless of the version, with the message: handle_trap - failed to wait at end of syscall, errno = 0, status = 2943

A: the 2.6.15 kernels that ship for Ubuntu 64-bit have a bug in them. On 32-bit Ubuntu, everything runs fine, but the 64-bit OS needs a recompile. 2.6.17.8 definitely works, but I haven't tested any earlier kernels. It may be a compilation error or an actual kernel bug. A recompile will definitely fix it however. Recompiling the kernel Ubuntu's Way

Q: UML boot startup. The UML kernel (2.4) launches but then stops (pushing the UML into the background) with something like:

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

     [1]+  Stopped                 /usr/bin/linux umid=myuml ubd0=...

OR

     Checking for the skas3 patch in the host...found
     Checking for /proc/mm...found

     Suspended (signal)

A: You're HOST system is probably using a version of glibc that was compiled with Native POSIX Thread Library (NPTL) support. This is a known problem that was recently fixed in 2.6 (Blaisor will backport the fix to 2.4 when he finds the time). The solution is to launch the UML without using the HOST libraries inside /lib/tls. There are several options:

  1. Set the environmental variable "LD_ASSUME_KERNEL" to "2.4.1" prior to running the UML. This can be done by running "export LD_ASSUME_KERNEL=2.4.1" before launching the UML or by launching the UML with something like "LD_ASSUME_KERNEL=2.4.1 /usr/bin/linux ubd0=..."
  1. Compile UML with both CONFIG_MODE_TT and CONFIG_MODE_SKAS enabled. This implies a static link during compile, and static linking on normal distros happens against non-NPTL libs (except Gentoo, which breaks this rule). This is the most common method of compiling UML, which is why this bug is not often seen.
  1. Alternatively, compile UML with CONFIG_STATIC_LINK (see the previous option for an explanation).
  1. Move /lib/tls to /lib/tls.off on the HOST. However, this slows down threaded programs on the the host. Use this solution as the last resort.

See this message from Blaisor for a technical explanation of the issue.

Setting up the installed distribution

Q: Whenever I try to log in as root I get 'login incorrect', even though I'm using the right password.

A: You probably don't have the tty you're logging in on listed in /etc/securetty. Root will only be allowed to login on ttys listed in that file. You will need to boot to single user mode and add ttys/0 or vc/0 (devfs) or tty0 or ttyS0 (no devfs) to /etc/securetty.

UlfBartelt . o O ( Do you mean tty0 in the answers above and below? )<br> SteveBenson . o O ( /dev/ttys/ is a devfs thing, which I incorrectly assumed. Answers edited accordingly.)<br> UlfBartelt . o O ( I think /dev/tty# is /dev/vc/# with devfs and the devfsish /dev/ttys/# are /dev/ttyS# without devfs. I only have non-devfs systems as hosts and am using some devfs-ish systems as guests, so maybe I am mixing something? I am asking and maybe I am confused, especially I don't say you're wrong... put confused into ultra-bold letters... )<br> SteveBenson . o O ( Yes, I think you're right. I put vc/0 and ttyS0 in the answers too. I guess whether your uml's console is ttys/0 or vc/0 depends on how uml is set up to create the console.)<br> UlfBartelt . o O ( Hmmm... I never understood why uml has consoles... serial lines with getty mapped to ports or file descriptors on the host would really be enough. One big difference is the behaviour of console0: On a real system, it always is the currently visible virtual console, on uml it is just an other console like all the others... confusing... )<br> ... to be continued ... ;-)

Q: The UML boots, but at the end of the boot I get 'INIT: Id "x" respawning too fast: disabled for 5 minutes' messages.

A: Your /etc/inittab is configured to run gettys on tty ports that don't exist within the UML instance, e.g. inittab uses static device filenames but UML uses devfs (or vice versa). You need to edit the /etc/inittab of your root_fs.<br>

$ mount -o loop root_fs mnt $ vi mnt/etc/inittab $ umount mnt

Change the lines for the mentioned gettys to run on the correct devices (see table below for the correct device names). You can as well comment out the lines mentioned, if you don't need them. If UML is configured to use devfs you could also try to pass it devfs=nomount as a parameter on the command line.

| static | devfs ----------------+--------+--------- console (conX) | ttyX | vc/X ----------------+--------+--------- serial (sslX) | ttySX | tts/X ----------------+--------+---------

BoneIdol .o O ( I got this running a 2.6.8-um kernel. Adding con=.. statement didn't help either. The fix was to mv /lib/tls /lib/tls.disabled as mentioned here http://www.citi.umich.edu/projects/asci/uml/2.6.6uml.html and http://sourceforge.net/mailarchive/message.php?msg_id=6991583 )

A: See compile options question and load back in the character devices

#Problems Booting

Q: When booting RH9 with a freshly built (& patched) 2.4.23 UML kernel, UML hangs just after the 'Press I for interactive startup' bit.

A: On the user mailing list, theres a message, and one line fix to this problem - see this article. It boots just fine (RH9) after this is done. 2.4.23-2um already contains the fix.

Q: When booting I get an error saying there is nothing more to do in INIT level, or that no process to run in INIT level.

A: Try booting with init=/sbin/sh, if that still doesn't work, then try searching for your problem in ther UML list's archives.

Q: When booting I get: <BR>

VFS: Cannot open root device "devicename" or unknown-block(x,y) <BR> Please append a correct "root=" boot option. <BR>

A: Try root=/dev/ubd/0 (especially for devfs), if that doesn't work try root=/dev/ubd0 and if that doesn't work try /dev/ubda. If none of those work look for your problem on the UML list's archives, if you can't find it post to the UML-user list.

A: Enable the virtual block device. See the compile part of this document

Q: When booting, the UML kernel hangs at "Mounted devfs on /dev". The UML kernel process appears to be spinning (using up all host CPU). Running strace on it reveals that the UML is in an infinite loop handling SIGSEGVs.

A: See http://marc.theaimsgroup.com/?l=user-mode-linux-user&m=107933444730789&w=2. The first solution was trying to changing the -O2 in your Makefile (in the UML kernel source tree) to -O1 and fully recompile the UML kernel. Later, it was discovered that this bug happens only on SuSE 9.1 hosts (but I guess it will appear also with GCC 3.4.x); the correct fix (included in late UML releases) is to add -fno-unit-at-a-time to the compiler flags; the "unit at a time" optimization seriously breaks Uml.

Q: When booting, the kernel silently exits near the message "Initializing stdio console driver", or the following message appears "Sleeping process xxx got unexpected signal : 11".

A: The How-to is incorrectly stating that the default guest kernel configuration is fine. In fact, you should enable at least the following options:

  • under "Character devices" * "file descriptor channel support" * "port channel support" * "tty channel support" * "xterm channel support"
  • under "Block devices" * "Virtual block device"

See also compile section of this page.

#Problems while running

Q: An application that requires large amounts of memory hangs or crashes and "map : /proc/mm map failed, err = 12" appears in the UML's kernel log.

A: There is a restriction in the *HOST* linux, for handling DOS's it seems, which has the effect of restricting UML to 256MB memory by default.

To increase this you need alter /proc/sys/vm/max_map_count which defaults to 65536. I've not tested this but try dividing the amount of memory you need (in bytes) by 4096 to get the minimum figure thats needed, e.g. 1G would need at least 262144. Simply echo <value> > /proc/sys/vm/max_map_count to change the limit; also, some early 2.6 kernel (at least until 2.6.3) don't support this setting; in this case, you need to upgrade. On 2.4 kernels this may happen, too, I guess, but you would need to use a very old 2.4 kernel in this case.

In detail (you can just skip this part, if you prefer so): this is, actually, a limit on the number of memory mappings a process can create; since UML needs to create one memory mapping for every 4k of its "virtual RAM", and the limit is by default 65536 = 64 * 1k, you get 64 * 1k * 4k = 256M of memory at most.

Q: Programs randomly segfault when I try to run them in uml.

A: Make sure your guest has enough memory and has a swap disk image. Many people run UML with no swap and not a lot of memory which can cause programs to segfault when memory runs out.

Using TLS seems to also cause this problem. Renaming /lib/tls to /lib/tls-old in the UML fixed this problem for me (you may also need to check /usr/lib/tls.) I believe this is because as of 2.6.14 UML does not yet support TLS and any programs using it can randomly segfault. This will probably change in a future UML/kernel version.

Q: Why is the UML guest *so* much slower than the host? It runs fine for a little while, then hangs for long periods of time. There also seems to be a lot more disk access than there should be.

A: Make sure you have /tmp mounted as tmpfs or a similar RAM-based filesystem. Quoting from http://www.stearns.org/slartibartfast/uml-coop.html :

> Once the host came up, I modified /etc/fstab to include the following line:
>
> tmpfs     /tmp    tmpfs   defaults,size=7168M 0 0
>
> 
which took effect on the next reboot. From that point on, all files stored in the /tmp directory actually get stored in memory, not on disk (a ramdisk, essentially, but one that can grow and shrink and strangely enough, get swapped out istself). Because the UML kernels put their entire ram images in /tmp on the host, this avoids a terrible bottleneck.

Note that you probably won't actually *see* the files in /tmp if you look, because they're deleted (but still held open) as soon as they're created.

Q: My uml guest hangs when doing large disk I/O such as untarring files or installing packages.

One way that UML can be slow is if you have CONFIG_BLK_DEV_UBD_SYNC set in your uml kernel. This will cause syncs to block the uml instance until they complete, resulting in long pauses. Disabling it in your kernel config will speed up your uml instance significantly. If you change, in the UML command line, things like "ubd0=file1 ubd1=file2" to "ubd0s=file1 ubd1s=file2", you will get again the same safety, without the big slowdown caused by CONFIG_BLK_DEV_UBD_SYNC.

More info on this can be found in these two threads (especially the second):

http://marc.theaimsgroup.com/?l=user-mode-linux-user&m=107022862505588&w=2

http://marc.theaimsgroup.com/?l=user-mode-linux-user&w=2&r=1&s=bonnie+almost&q=b

Q: I get the following error when I telnet to my UML guest: "getpty: No such file or directory"

Mount your /dev/pts filesystem by adding the following line to your fstab :

none    /dev/pts devpts    gid=5,mode=620    0 0

More info can be found in Documentation/devices.txt.

Q: 'dig', 'host' & 'nslookup' all die with a segmentation fault.

A: This is another symptom of the Native POSIX Thread Library (NPTL) problem (see above, in Kernel Problems). The solution of simply renaming /lib/tls to something else fixed the problem on my Debian system.

External links about troubleshooting

  Page Info My Prefs Log in
This page (revision-2) last changed on 10:30 03-Nov-2006 by Dave Pearson.
 

JSPWiki v2.4.71
[RSS]