Configuration Howto

From Knoppix Documentation Wiki
Revision as of 08:18, 1 July 2011 by Clinton (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Two options

  • From the command line use "saveconfig".
  • From KDE use the knoppix menu and find the "save configuration" item.

The system prompts you for what to save, and where to save it (choose from all the local disks and removable media that the system knows about). When you restart knoppix just add a boot parameter (see also Cheat Codes for more options). E.g.:

boot: knoppix myconfig=/mnt/sda1

Or, to scan all local disks:

boot: knoppix myconfig=scan


Change default runlevel

Just edit the initdefault line in /etc/inittab:

# The default runlevel

Then saveconfig.

Useful if you want to suppress the auto-start of the xsession.

Start ssh on startup

If you haven't used ssh yet, then start it up, to initialise the keys:

$ /etc/init.d/ssh start

Then add a line to /etc/inittab with the desired runlevels in the second column:

# Start ssh on startup
ss:4:wait:/etc/init.d/ssh start

Then saveconfig.

Nice for people who want to use knoppix as a server and connect with remote clients. Also for VMWare users where knoppix is the guest OS.

This is admittedly a bit of a hack, since the normal /etc/rc mechanism would work, but would not be saved in the persistent configuration. In this case we would simply add a symlink to rc4.d linking to /etc/init.d/ssh.

Add user accounts

Just use /usr/sbin/useradd as normal, and then save the config.

Mount user's home directories

If you add user accounts then the new users will prefer to be able to have a persistent home directory. This can be achieved by mounting and linking during init. Create a script in /etc/init.d (e.g. /etc/init.d/setup-homes) that mounts a local drive or image, and links a directory there to /home/<uname>. Then run this script automatically at start up by adding a line to /etc/inittab

# Mount user homes

Then saveconfig.

Add more software

Similar to the user home directory example, just install the software on a local drive, and create a script to mount it on startup (and if desired link it into standard path locations like /bin, /usr/bin). Then saveconfig.

Pitfalls and problems

Symlinks are not saved

The saved configuration only consists of true files, not symlinks, hence the problem with /etc/rc mentioned above. (This is true at knoppix 3.6, please edit this page if things have changed.)

Overwriting auto-generated files

Certain files (e.g. /etc/fstab) are auto-generated by knoppix on startup (mostly in /etc/init.d/knoppix-autoconfig), and then overwritten from the saved configuration.

Boot parameters

You can't set boot parameters (a.k.a. Cheat Codes) except by typing them at boot time. It is, however, probably the most trivial re-mastering to change boot parameters.

Language preferences

Language preferences are always overridden at startup according to the boot parameter lang= (see also Cheat Codes). Changes to /etc/sysconfig/keyboard will go into the saved configuration, but are always ignored.

Don't use

Many forum posts are from users who have hacked to change startup behaviour. This script is auto-generated by saveconfig every time you save the configuration, so manual changes will be overwritten. Use init instead.

Behind the scenes

The save config script actually saves all true files from /etc that are missing or different from the distribution (at /KNOPPIX/etc).