baselayout-vserver is dead!

To make it short: during the last months I have worked together with Roy to get baselayout-1.13 working within Linux-VServer and OpenVZ guests, and since 1.13.0_alpha5 it seems to work quite fine now … baselayout-vserver is dead! 88|

Now the long version: Since many things are not allowed inside virtual servers, the Gentoo VPS team has “forked” baselayout and stripped all delicate parts. Since maintaining an up-to-date baselayout-vserver (read: synced to original baselayout) is a PITA we have finally decided to make baselayout working in virtual servers.

Being able to check whether we are inside a virtual server or not, we made all delicate parts (e.g. mounting, sulogin, fsck, etc.) conditional, i.e. they will be skipped inside a virtual server. Additionally, baselayout-1.13 being more modular, previously needed init scripts can be punted from the default runlevels (e.g. modules, clock, hdparm, etc).

Summa summarum, it will enable you to use a normal baselayout within virtual servers.

In case you thought this is the only advantage: wrong! Additionally baselayout-vserver implied the ugliness of an extra portage profile and, being quite an essential package, also a set of extra stages. These are dead now as well! 88|

On a sidenote, a lot of Gentoo support patches have been merged into util-vserver trunk.

  • You can now use vserver ... build together with the template build method and the gentoo distribution target using a stage3 tarball! Hence, vserver-new is dead!
  • The gentoo init style has been reimplemented to work the same way as it would with an init process. This will bring back output of the boot process .. 😀
  • All emerge wrappers (vemerge, vesync, vupdateworld, vdispatch-conf) have been merged!
  • The init scripts have been split into vprocunhide and vservers.default again. You can now use vservers.default like the net init scripts. To start vservers of type MARK, just do ln -s vservers.default vservers.MARK and you’re done!

If you want to test all this new stuff, you have to follow these steps:

  • emerge util-vserver-svn – you can find the live svn ebuild in our overlay.
  • In case you didn’t do it with old init scripts: /etc/init.d/vprocunhide start
  • To build a new virtual server use one of these commands (depending on the init style you want):
    • vserver myguest build \
      --context 42 \
      --initstyle plain \
      -m template -- \
      -d gentoo \
      -t /vservers/stage3-i686-20061103.tar.bz2
    • vserver myguest build \
      --context 42 \
      --initstyle gentoo \
      -m template -- \
      -d gentoo \
      -t /vservers/stage3-i686-20061103.tar.bz2

A prepared stage3 with baselayout-1.13.0_alpha5 can be downloaded from here.

It should look something like this if you use my baselayout-1.13.0_alpha5 stage3:

zeus vservers # vserver myguest build \
> --context 42 \
> --initstyle gentoo \
> -m template -- \
> -d gentoo \
> -t /vservers/stage3-i686-20061103.tar.bz2
>>> Adding shared /usr/portage to fstab ...
>>> Checking init-style ... gentoo
>>> Installing special init-style magic ...
!!! You have to install a service (e.g. syslog-ng) and add it to the
!!! default runlevel before you start the guest the first time!
!!! Otherwise the guest will die as soon as it has finished booting.
!!! Consult the Gentoo Handbook on how to chroot and install
!!! packages into the guest environment.
>>> Found baselayout-1.13.0_alpha5
>>> Fixing inittab ...
>>> Fixing default runlevel scripts ...
>>> Fixing fstab ...
zeus vservers # vserver myguest start

Gentoo/Linux 1.13.0_alpha5;
 Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2

Press I to enter interactive boot mode

 * Using existing device nodes in /dev ...                  [ ok ]
 * Checking all filesystems ...                             [ ok ]
 * Mounting local filesystems ...                           [ ok ]
 * Activating (possible) swap ...                           [ ok ]
 * Setting hostname to localhost ...                        [ ok ]
 * Initializing random number generator ...                 [ ok ]
 * Starting local ...                                       [ ok ]
 * Setting system clock using the hardware clock [VPS] ...  [ ok ]
 * Starting syslog-ng ...                                   [ ok ]

If you downloaded my prepared stage, just ignore the warning about installing a service, i have already done this for you 😉

Report any difficulties to hollow[at] please ..

2 thoughts on “baselayout-vserver is dead!”

  1. Is there a way to migrate current vservers over to the new baselayout (1.13)?

    I have a plethora of vservers just dying for this new baselayout, and I would be miserable if I had to rebuild them all just to be able to use it.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>