Sam Trenholme's webpage
Support this website

TinyVZ 0.7 released


August 20 2011

I have released TinyVZ 0.7 today. This will be my last TinyVZ release for the foreseeable future.

TinyVZ 0.7 is a tiny little OpenVZ template for making OpenVZ containers that use the lowest amount of memory and hard disk space possible.

This is a self-hosting template with all source code; it is possible to compile the entire system inside of the template. Look in the build/ directory (inside the template) for source code.

The main addition to this release of TinyVZ is that it is now possible to use the relevant vzctl commands to add or remove an IP, set the machine's hostname, determine what nameservers to use, as well as setting user's passwords. I had to add the Bash shell to do this; details below.

The tarball now contains the template's tarball inside of it, the relevant scripts used by vzctl, as well as an installation guide (README).

The system is for hard core UNIX/Linux gurus: The only editor is a miniature version of vi included with Busybox (actually, I also compiled in Busybox's version of the "ed" editor, for those who feel vi pampers the user too much); all configuration is done by editing text files. You will need to compile your own mail server, SSH server, web server, or other desired server.

It can be downloaded here:

One discovery I made making TinyVZ 0.7 is that, for the OpenVZ tools to work, not only is it mandatory for the container to have the Bash shell, but also that /bin/sh has to be a symlink to Bash. This is because the "vzctl" program prepends the contents of the Bash-only "/etc/vz/dists/scripts/functions" script to any script used by the container to configure the system, and there does not appear to be any way to configure a container to not use this Bash-only script.

Any OpenVZ template without /bin/sh as an alias for Bash can not be configured via the "vzctl" tools (nor the corresponding Proxmox/SolusVM/whatever tools that call "vzctl").

Since someone asked: The actual deed of concatenating the Bash-only script with the distribution-specific script run by vzctl is done by the read_script() function in src/lib/script.c in the vzctl source code. read_script() is, in turn, called by vps_exec_script() in src/lib/exec.c; vps_exec_script() is called from several places.

The offending code has the name DIST_FUNC whenever it is used to specify the offending script in vps_exec_script(). DIST_FUNC is specified in include/dist.h.

The code is spaghetti code; it took me hours to unravel all of this.

The real solution to this issue would be to replace DIST_FUNC with a parameter that can be controlled by the /etc/vz/dists/${distname}.func configuration file.

To post a comment about an entry, send me an email and I may or may not post your comment (with or without editing)