There's an inipost-file (http://static.thedudes.org/initpost) that can be used when creating hosts, so there's no need for manual tweaking.

+

There's an inipost-file (http://capa-support.mikrov.dk/downloads/initpost) that can be used when creating hosts, so there's no need for manual tweaking.

−

Put it in <code>/usr/lib/util-vserver/distributions/lucid</code>. Install the vserver with <code>--initstyle plain</code>. You still need to look over services when installing since we're tweaking Upstarts normal emits.

+

Put it in <code>/usr/lib/util-vserver/distributions/lucid</code>. Install the vserver with <code>--initstyle plain</code>.

−

!! Note !! The inipost-file is missing. You can temporarily download it from: http://dl.dropbox.com/u/1171189/initpost

+

You will still need to look over services when installing since we're tweaking Upstart's normal <code>emit</code> directives.

−

+

−

And more permanently here: http://capa-support.mikrov.dk/downloads/initpost

+

You can also have a look at http://wiki.raceme.org/dokuwiki/tof:computer:vserver:upstart_ubuntu_lucid for a manual procedure.

You can also have a look at http://wiki.raceme.org/dokuwiki/tof:computer:vserver:upstart_ubuntu_lucid for a manual procedure.

Running Ubuntu Lucid

There's an inipost-file (http://capa-support.mikrov.dk/downloads/initpost) that can be used when creating hosts, so there's no need for manual tweaking.
Put it in /usr/lib/util-vserver/distributions/lucid. Install the vserver with --initstyle plain.

You will still need to look over services when installing since we're tweaking Upstart's normal emit directives.

Remove low level services inside the guest

Then you need to get rid of anything in /etc/init/ that tries to fiddle with your Server's Hardware or other low-level Stuff that's already handled by your host's kernel/system. Having one such scriptlet still enabled might cause the whole upstart system to fail (like not being able to open /dev/console or failing to start the udev system).
Just remove these scriptlets, move them out of the way or rename them to something not ending in .conf. Be aware that upstart also parses subfolders of /etc/init/ for .conf files.

The utmp stuff is needed if you mount /var/run as tmpfs and you don't create utmp anywhere else.

Remove console outputs

If your VServer hangs on the command

vserver <name> stop

and puts out

A timeout occured while waiting for the vserver to finish and it will
be killed by sending a SIGKILL signal. The following process list
might be useful for finding out the reason of this behavior:
----------------------------------------------------------------------
<pid> <context> <name> ? Ss 0:00 /sbin/init
<pid> <context> <name> ? Ss 0:00 /sbin/init
----------------------------------------------------------------------

which will disable all lines with 'console output', and Upstart won't try output to it. Which is a good thing since it doesn't exist.

Another reason might be that you removed control-alt-delete.conf from /etc/init/ - which is used for a proper shutdown of the vserver:
20:00 <@Bertl> util-vserver does not execute stuff inside the guest, it simply sends a signal to init (inside the guest)
20:01 <@Bertl> (the singnal is SIGINT, and this equals to the CTRL-ALT-DEL action)

Adapt /etc/init/rc-sysinit.conf inside the guest

This depends on net-device-up IFACE=lo, remove this from the start line so that it reads:

start on filesystem

This scriptlet tries to parse /proc/cmdline which will not work and probably isn't needed inside a vserver.

Simply comment out or delete the whole for ARG in $(cat /proc/cmdline) do...done loop.

Notes for debugging

First, you need to run Upstart with the --debug flag;
one way of doing it is inserting --debug in INITCMD_START under the xplain-clause inside /usr/lib/util-vserver/vserver.functions (row 316 here)
so it reads

INITCMD_START=( /sbin/init --debug )

Second, you should enable console output in the rc-files inside /etc/init. If you had commented them out before, you could do

If you do things at a console of the machine it will now print out detailed information. More on how to debug an Upstart job you'll find on http://upstart.ubuntu.com/wiki/Debugging.
Notice that if one fails they all fail.

then you're probably running the current stable version 2.6.22.19-vs2.2.0.7.

Upstart's /sbin/init implementation requires it to be PID 1. It is linked against NPTL (in contrast to sysvinit), which has a bug in its caching getpid(2) wrapper. With this kernel version getpid(2) returns the cached PID to init, resulting in init replacing itself with telinit. You can fix this by upgrading to a 2.6.26+ kernel and a newer vserver patch, or by patching upstart:

For more information see the man pages of getpid(2) (NOTES) and clone(2) (BUGS).

Init procedure doesn't complete

SSH

If you've completed all above steps and some init scripts doesn't get invoked at all (most notably old SYSV init scripts) you might have encountered the same error that I did.
In Lucid guest I had to comment out (or remove) the oom never line in /etc/init/ssh.conf:

# replaces SSHD_OOM_ADJUST in /etc/default/ssh
#oom never

After commenting out this line initialization completed successfully.

D-BUS

When creating guest as chroot some packages you might expect are missing. One of these is D-BUS. Strangely enough the /etc/init/dbus.conf gets installed which prevents Upstart to finish its starting sequence.