Zenix Live

This page describes tips when running Zenix as a live CD or from a flash drive.

Contents

Use Zenix as a live CD

Using any software you wish, burn the Zenix .iso to a blank CD. Set your bios to boot from your CD or Flash Drive and reboot.

If needed, the Ubuntu wiki has a this page with detailed instructions on burning an iso using Windows, OSX, and Linux.

Install Zenix to a Flash Drive

Zenix is distributed as a "hybrid" image. Hybrid images can be used in two ways:

  1. With a CD, burn the iso to a cd as you would with any iso image.
  2. With a Flash drive, copy the image directly to a flash drive.

Graphical install

Unetbootin is a cross platform method of installing iso to flash drivers. Install unetbootin and then select the zenix iso from the menu (Under "Diskimage").

Command line install

The command line can be used to install Zenix to a flash drive and offers the most in terms of options and setting up persistence.

Copy the iso using dd:

  1. This will wipe all the data on your flash drive !!!
  2. The most common mistake is to write the data to a partition (/dev/sdb1) and not the entire disk (/dev/sdb).
dd if=zenix-2.0-i686.iso of=/dev/sdb bs=4096

Adding persistence to a flash drive

Afer using dd, gparted will sees the entire (flash) disk as unallocated space, so I made a partition using fdisk.

fdisk /dev/sdb

At the fdisk command prompt, type "n" for new partition, "p" for primary partition, 2 for second partition. Hit enter to use the remaining free space. Then w to write the changes to the partition table.

If you are unfamiliar with fdisk (or need a refresher) see this link .

Notice if you go with the defaults it will take the remaining space on the disk.

Next, use this new partition to make a persistent home:

mkfs.ext4 -m 0 -L home-rw /dev-sda1

To use other methods of persistence, use alternate labels for the file system (see the persistence section below).

How to use Persistence

Persistence is used when running Zenix live, from CD or flash drive, to save data or changes between sessions. Zenix is configured to use persistence by default, but you will first need to configure space to save the changes. Once configured, the persistent partition or file will automatically be detected, mounted, and available for use.

The terminology surrounding persistence is confusing at first, but in practice persistence is very easy to use.

In addition to the methods listed on this page, there are several online guides for creating a bootable, live flash drive with persistence. Useful online guides are listed below, although you may need to adjust to the way Zenix (Debian) manages persistence.

Types of persistence

Zenix has the capibility of using 3 types of persistence, full, home, and snapshots.

Persistence is versatile and can use either partitions (on a hard drive or a flash drive) or files to store changes. Partition labels and file names are used for configuration. Thus, with the proper partition label or file name, your storage space will be automatically discovered and mounted.

The following sections are from the man page and are a technical description of how to use a partition or a file.

Alternately, Skip the Technobabble and get on with it already.

Full Persistence

With full persistence you can "install" additional packages or make configuration changes and they will continue to be available when you reboot Zenix. While this has obvious uses, I would not "apt-get upgrade" in an attempt to keep all the packages up to date using persistence. Rather, I advise you use this method of persistence to add a few packages you feel are missing on Zenix, security updates only, or customizing system configuration files.

By 'full persistence' it is meant that instead of using a tmpfs for storing modifications to the read-only media (with the copy-on-write, COW, system) a writable partition is used. In order to use this feature a partition with a clean writable supported filesystem on it labeled "live-rw" must be attached on the system at bootime and the system must be started with the boot parameter 'persistent'. This partition could be an ext2 partition on the hard disk or on a usb key created with, e.g.

mkfs.ext2 -L live-rw /dev/sdb1

If you already have a partition on your device, you could just change the label with one of the following:

tune2fs -L live-rw /dev/sdb1 # for ext2,3,4 filesystems
dosfslabel /dev/sdb1 live-rw # for a fat filesystem

But since live system users cannot always use a hard drive partition, and considering that most USB keys have poor write speeds, 'full' persistence could be also used with just image files, so you could create a file representing a partition and put this image file even on a NTFS partition of a foreign OS, with something like:

dd if=/dev/null of=live-rw bs=1G seek=1 # for a 1GB sized image file
/sbin/mkfs.ext2 -F live-rw

Then copy the live-rw file to a writable partition

Persistent Home

A persistent home would be used to store personal data. Personal data can also be encrypted using Cryptkeeper.

I gave a description earlier of how I make a persistent home partition on flash drives, below is a more technical description.

As an alternate, you can use a file as above, but name the file 'home-rw'

If during the boot a partition (filesystem) image file or a partition labeled home-rw is discovered, this filesystem will be directly mounted at /home, thus permitting persistence of files that belong to e.g. the default user. It can be combined with full persistence.

Snapshots

Snapshots are yet another method and give better performance on flash drive, at the price of potential data loss and the inability to delete files.

Snapshots are collections of files and directories which are not mounted while running but which are copied from a persistent device to the system (tmpfs) at boot and which are resynced at reboot/shutdown of the system.

The content of a snapshot could reside on a partition or an image file (like the above mentioned types) labeled live-sn, but it defaults to a simple cpio archive named live-sn.cpio.gz. As above, at boot time, the block devices connected to the system are traversed to see if a partition or a file named like that could be found.

A power interruption during runtime could lead to data loss, hence a tool invoked live-snapshot --refresh could be called to sync important changes. This type of persistence, since it does not write continuously to the persistent media, is the most flash-based device friendly and the fastest of all the persistence systems.

A /home version of snapshot exists too and its label is home-sn.*; it works the same as the main snapshot but it is only applied to /home.

Snapshots cannot currently handle file deletion but full persistence and home automounting can.

Using persistence on a flash drive

Persistence can be used either as a file or a partition on a flash drive.

If you wish to use graphical tools to "install" and configure Zenix to run in live mode + persistence:

Alternately you can use command line tools (fdisk, dd, mkfs( to configure a flash drive.

Using persistence on a hard drive

Persistence will also work on hard drives. Configure a partition or file using any of the methods above.

If you use a partition you can share the partition with other operating systems.

Set the live user password

The live user name is 'buddha' and by default the password is blank/empty

Setting a password is necessary if you are going to log out and back in, to start awesome for example, or implement changes to the mouse of shell settings. A password can be set from the menu, under Configuration, or from the command line.

sudo passwd buddha

How to Restart Slim

In the event you need to restart slim, use the following commands;

sudo /etc/init.d/slim restart

If you restart Slim from within X (graphical environment), you will drop to a command line interface (console), and Slim does not restart.

Don't Panic, simply run the command a second time.

Once restarted, you will automatically be logged into the default session.

Custom Configuration Menu Options

These options are in the menu under "Configuration". While using most of these options is straight forward, a few deserve additional information here.

Cairo Composite Manager

Cairo composite manager is included for eye candy and is configured for transparency and some animation of the menu and windows.

Cairo composite manager has additional features which can be configured (or turned off) from the cairo icon (blue bug) in the panel.

cairo preferences

Conky

When using the "Nice and Clean" conky theme (with Awesome) know that the configuration a bit of a "hack" (I did not write it) in that the config files are "modular". Essentially there are multiple conky processes running, and there is a 4th for weather, but you would need to configure it (customizing it to your location).

Because of this, you may see some flickering of the background image or the theme may seem odd. Wait about 9 seconds for conky to load.

Once the conky theme is loaded, the time may not be aligned to the background image. This happens because the configuration files use absolute positioning. Feel free to customize the configuration files(or write a script to detect your monitor resolution).

Custom Key Bindings

I added a few custom key bindings (keyboard shortcuts) for both openbox and Awesome.

Openbox

"Open a Terminal" → Alt + t
"XKill" → Alt + x
"Dmenu" → Alt-F2

Awesome

The "Mod4" key is the key with the Windows logo on it.

"Open a Terminal" → Mod4 + enter.
"dmenu functionality" → Mod4 + r
"Xkill" → mod4 + Ctrl + x

When using xkill (and some other menu items) in awesome, the mouse cursor shows as "busy" for a short time following execution of the Xkill command. Although annoying, this does not seem to slow down the system or prevent use of the mouse.

As an alternate, use Mod4-shift-c (default Awesome key binding) to kill the active window.

See also: Zenix Awesome page

Using sudo in a Console

For some reason, in a console (ctrl-alt-F1), 'sudo -i' is trying to start X

As a work around, use sudo su -

sudo su -

Improving Monitor Resolution

General tips

Slim seems to start too soon, and the resulting in a low resolution on some monitors. To resolve this, restart slim.

You can also set/change your monitor resolution, using a graphical configuration tool, from the Configuration menu.

Alternately you can set a resolution manually using xrandr

To list possible resolutions:

xrandr -q

To set a resolution (Change '1400x1050' to your desired resolution listed in the command above):

xrandr -s 1400x1050

To set a dpi:

In general, xrandr should set a proper dpi. If it does not, the size of your fonts will be off, typically too large.

large dpi

In that event, you can manually set a dpi by editing ~/.Xdefaults . The syntax is:

Xft.dpi: 72

The default dpi is typically 96, experiment with a range of numbers until you fine one that is comfortable.

After editing ~/.Xdefaults , the changes will take effect automatically, but only applied to NEW Windows.

small dpi

If the changes are not automatically applied, either set them manually or log out and back in.

xrdb -merge ~/.Xdefaults

Dual Monitors

To configure dual monitors, use xrandr:

List your monitors and resolutions (monitors are on the second line, 'DVI-I-1' and 'DVI-I-2')

buddha@zenix:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 4096 x 4096
DVI-I-1 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 520mm x 320mm
1920x1200 60.0*+
1600x1200 60.0
1680x1050 60.0
1280x1024 75.0
1280x960 60.0
1152x864 75.0
1024x768 75.1  70.1  60.0
832x624 74.6
800x600 72.2  75.0  60.3  56.2
640x480 72.8  75.0  60.0
720x400 70.1
DVI-I-2 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 520mm x 320mm
1920x1200 60.0*+
1600x1200 60.0
1680x1050 60.0
1280x1024 75.0
1280x960 60.0
1152x864 75.0
1024x768 75.1  70.1  60.0
832x624 74.6
800x600 72.2  75.0  60.3  56.2
640x480 72.8  75.0  60.0
720x400 70.1
TV-1 disconnected (normal left inverted right x axis y axis)

Configure dual screens, including positioning and resolution:

xrandr --auto --output DVI-I-2 --mode 1920x1200 --left-of DVI-I-1

Virtualbox / KVM

In Virtualbox and KVM, you need to first turn off cario-compmanager (the little 'blue bug' in the panel).

cairo off

Then set a resolution with xrandr or from the menu as outlined above.

Wireshark

When running Zenix Live, Wireshark runs as root. This is a minor security vulnerability, and, after installing Zenix, Wireshark will run without invoking root priviliges.

Test PSAD

First, check the /etc/hosts.deny file

sudo cat /etc/hosts.deny

Test psad using nmap with a spoofed ip addres

sudo nmap -D 192.168.0.100 localhost

You may need to run nmap twice.

Then

sudo cat /etc/hosts.deny
sudo iptables -L -v -n | grep 192.168.0.100

You will see psad added the spoofed ip address "192.168.0.100" to iptables and /etc/hosts.deny

To flush the blocked ip

sudo /usr/sbin/psad -F

Wait 5 seconds ...

sudo cat /etc/hosts.deny
sudo iptables -L -v -n | grep 192.168.0.100

The spoofed ip address has been cleared.