Remove message “Waiting for network configuration…” on ubuntu

On ubuntu, if your system boots without network in failsafe mode, it will wait a long time for network to be available. In many case, this won’t help much…

Moreover, if you’re trying to do things like kernel compiling and for some reason you can’t see the boot log (including this “Waiting for network configuration” message), you’ll have the impression of being stuck with a bad kernel, but in fact it is just waiting 120 seconds…

Just edit the file sudo vi /etc/init/failsafe.conf and remove all “sleep” instructions. The message will be displayed but it won’t wait any time.

To repair you network problems, you might want to check this post and this post.

Ugly things : Autologin of console at startup

→ Ugly but okay in a development virtual machine…

Add “– – autologin root” at the end of /etc/init/tty1.conf

It will auto-log you as root for the first console. For the others, do the same with /etc/init/tty[1-5].conf

You can autolog as “student” by replacing root by student. It’s a little safer … but still ugly.

How to debug at boot time

If all you get is a black screen when booting, boot in recovery mode to see a little more information :

recovery

When you are in the grub menu, choose the “recovery” version

If there is none or if it’s still black type “e” in the grub menu over the kernel entry you want. Find the line starting by linux, and add “ro single recovery” at the end.
Type F10 to boot.

recovery2

Grub normally have a “Previous versions” menu to allow you to boot with the ubuntu default kernel…

 

In fact if you get a black screen when booting, chances is that you’re missing some modules. But you can get more:

  • Add a serial device to your virtualbox, select “file” mode, with e.g. /tmp/vbox-jerry
  • run tail -f /tmp/vbox-jerry on your machine to watch that log file,
  • before booting, press e to edit the config and add at the tail of the command line ” console=ttyS0,57600″
  • this will work only for boot time, when syslogd will start, the log will go to /var/log/syslog
  • You can use the /etc/default/grub file like for the screen size (see slides of info0940) to make it permanent

A network problem during boot may stall you for 120 seconds, with or without a black screen ! So wait a little !

VM and Kernel compiling troubleshooting

Start’up Troubleshooting

 

  • Log in as “student” with the password mentioned in the auditorium and the slides.
  • If your virtual machine does not boot, you can check the boot log with a right-click on the virtual machine entry in VirtualBox.
    The kernel installed on ubuntu server *requires* PAE/NX extension to be enabled in your virtual box. This can be tuned in Settings>System>Processor for your virtual machine.
  • Ubuntu remembers which “network card” you have installed, so that interface IDs (i.e. eth0, eth1…) is consistent when you reboot. This may cause you to lose network connectivity when you copy your .vdi from one machine to another. If that happens (boot stalls on networking setup) reset the content of your /etc/udev/rules.d/*persistent-net.rules file.

Building Kernel Troubleshooting

  • The config file you’ve been given should provide all the options for a i386 build of the reference kernel sources. If you’re prompted with [Y/n/m] questions in “make oldconfig” step, you’re very likely to be trying to compile an amd64 kernel itself, which won’t work on the reference virtual machine. It is mandatory to compile the kernel in i386, see Shell, Linux and Kernel slides for more informations.
  • “CONFIG_DEBUG_SECTION_MISMATCH errors” essentially occurs when you’re including unsafe drivers in your kernel. Unless you’re experiencing this during “make bzImage”, you can safely ignore this.
  • quota exceeded while building may occur on ms8xx, with various error messages. use quota -v -s to check how much more space you can eat on the shared filesystem (/home). kdirstat $HOME can assist you in finding files that take too much room. You have 500Mo allowed, clearly not enough to build the kernel in your home directory. Beware, the compiler suite installed on ms8xx makes use of a “compiler cache”, in the (hidden) $HOME/.ccache directory. You’d more likely want to use some location in /tmp for that purpose. If that’s the case, create a personal sub-folder and export CCACHE_DIR=/tmp/OS$USER/ccache before you start compiling the kernel. Alternatively, you may prefer to restrict the size .ccache can grow. Check out the manpage for details.
  • permission denied during make install might occur. Part of the ‘install’ process is designed by your distribution maintainers for upgrading the distribution itself. This usually happens after vmlinuz and friends have been copied to $INSTALL_PATH, so most of the times, you do not need to bother.

Booting Kernel Troubleshooting

  • “init: failed to create pty…” errors on boot? may occur with your custom-built kernel. It’s annoying, but it’s not just you: it’s a bug not yet fixed in the distributed image. Retrieve the update definitions with sudo aptitude update and then selectively upgrade the buggy package (upstart): sudo aptitude upgrade upstart.
    the screen is completely black with your new kernel ? don’t panic (yet). Chances are that you’re missing some modules. The kernel has started, but cannot access some hardware (including fancy graphic modes). Try out the “recovery mode” for the corresponding kernel, then dig kern.log for an explanation. Use “insert CTRL+ALT+DEL” on your vbox’s “Machine” menu to return to the boot.
  • booting takes ages. Most likely, you’re stuck at network configuration. That may take several minutes when no network card is found (cf. Startup) or when modules for the network card cannot be located.