Search Results: "enrico"

18 July 2006

Enrico Zini: Fifth day in Addis

Setting up a mail server
Background Some terminology:
MTA
Mail Transport Agent
MUA
Mail User Agent
MDA
Mail Delivery Agent
SMTP
Simple Mail Transfer Protocol
MX
Mail eXchange
POP
Post Office Protocol
IMAP
Internet Message Access Protocol
With SMTP you connect to a server and send two things: envelope and message. The envelope looks like this:
MAIL FROM: <enrico@enricozini.org>
RCPT TO: <rms@fsf.org>
RCPT TO: <linus@linux.org>
The message looks like this:
From: <enrico@enricozini.org>
To: <rms@fsf.org>
Cc: <linus@linux.org>
Message-ID: <1234567@enricozini.org>
Subject: Test mail
Hi Richard,
this is a test mail.  I'm also writing
Linus to show how to send to more people.
Cheers,
Enrico
There is no authentication. There is no encryption. Two usual types of access control:
  1. Outbound e-mail is normally only accepted from an internal network
  2. Inbound e-mail is normally accepted from anywhere
The DNS is used to find the SMTP server to use to send a message:
$ host -t MX yahoo.com
yahoo.com MX 10 smtp1.yahoo.com
yahoo.com MX 20 smtp2.yahoo.com
yahoo.com MX 20 smtp3.yahoo.com
The process of sending an E-Mail:
  1. Enrico writes an E-Mail:

    From: Enrico Zini <enrico@enricozini.org>
    To: Richard Stallman <rms@fsf.org>
    Subject: Hello from Addis
    Hi Richard,
    Addis is a wonderful city, even if
    it rains a lot.
    Bye,  Enrico
    
  2. Enrico's MUA connects to the SMTP server (for example, port 25 of smtp.aau.edu.et):

    HELO enricozini.org
    200 OK Hello enricozini.org
    MAIL FROM: <enrico@enricozini.org>
    200 OK Mail from enrico@enricozini.org
    RCPT TO: <rms@fsf.org>
    
    Here, the SMTP server performs relay control: "do we relay mail to rms@fsf.org?":
    • Outbound e-mail is normally only accepted from an internal network
    • Inbound e-mail is normally accepted from anywhere
    A target address could be refused:
    413 ERR I don't relay for rms@fsf.org
    
    In this case, the destination is not local but the recipient is accepted because I'm inside the local network:
    200 OK Destination rms@fsf.org
    DATA
    200 OK Please send message body
    From: Enrico Zini <enrico@enricozini.org>
    To: Richard Stallman <rms@fsf.org>
    Subject: Hello from Addis
    Date: Mon, 17 Jul 2006 09:49:45 +0300
    Message-ID: <124372643@enricozini.org>
    Hi Richard,
    Addis is a wonderful city, even if
    it rains a lot.
    Bye,  Enrico
    .
    200 OK Message accepted
    QUIT
    200 OK Bye.
    
  3. The SMTP server needs to find out where to send the message, using the DNS:

    $ host -t MX fsf.org
    fsf.org MX 10 mail.fsf.org
    fsf.org MX 20 mail.gnu.org
    
  4. So the SMTP server tries the first one and connects to port 25 of mail.fsf.org:

    HELO smtp.aau.edu.et
    200 OK Hello smtp.aau.edu.et
    MAIL FROM: <enrico@enricozini.org>
    200 OK Mail from enrico@enricozini.org
    RCPT TO: <rms@fsf.org>
    
    The destination is accepted because it's for a local user:
    200 OK Destination rms@fsf.org
    DATA
    200 OK Please send message body
    From: Enrico Zini <enrico@enricozini.org>
    To: Richard Stallman <rms@fsf.org>
    Subject: Hello from Addis
    Date: Mon, 17 Jul 2006 09:49:45 +0300
    Message-ID: <124372643@enricozini.org>
    Received: by mail.aau.edu.et
      on Mon, 17 Jul 2006 09:55:53 +0300
      from 10.4.15.158
    Hi Richard,
    Addis is a wonderful city, even if
    it rains a lot.
    Bye,  Enrico
    .
    200 OK Message accepted
    QUIT
    200 OK Bye.
    
  5. Now, mail.fsf.org will invoke a MDA to write the mail in Richard Stallman's mailbox.

Example of problems with mail handling:
  • Accepting inbound connections:
    • Malicious input:
      • logic errors
      • buffer overflows
      • DoS (Denial Of Service) attacks
      • Connection floods
  • Performing outbound connections:
    • Programming errors:
      • Flooding of connections
  • Performing routing:
    • Unauthorised relays
    • Mail loops
  • Writing to the local hard drive:
    • Filling up the hard drive
    • Writing to the wrong files
  • Writing to the local hard drive as root:
    • In case of error or attack, any file in the system can potentially be compromised
RFC-822 is the original standard for E-mail. RFCs are standard Internet documents. Have a look at RFC documents released the 1st of April.
postfix Common setup: "Internet site with smarthost". More difficult to maintain: "Internet site". A smarthost is a machine that will relay e-mail for you. Questions asked with "Internet site with smarthost":
  • Mail name: aau.edu.et (name used to publicly identify the mail server)
  • Smarthost name: smtp.telecom.net.et (SMTP server that will relay our e-mail)
To test a mail server:
$ telnet localhost 25
HELO me
MAIL FROM: <a@b.c>
RCPT TO: <mail@of.a.local.user>
DATA
hi
.
QUIT
By default, you find locally delivered mail in /var/mail/username. Postfix configuration files:
/etc/postfix/master.cf
configures how all the postfix components run together (man 5 master)
/etc/postfix/main.cf
Main postfix configuration (man 5 postconf)
To rewrite addresses:
  1. In /etc/postfix/main.cf:

    canonical_maps = hash:/etc/postfix/canonical
    
  2. Then in /etc/postfix/canonical you can add the rewrite rules, like:

    enrico   enrico@enricozini.org
    
  3. When /etc/postfix/canonical is modified you need to regenerate the index:

    sudo postmap canonical
    
    (same is when you change the alias file: sudo postalias /etc/aliases)
(see file:///usr/share/doc/postfix/html/ADDRESS_REWRITING_README.html) Manipulating the message queue:
mailq - List the mail queue.
Example:
mailq
postqueue - Postfix queue control
Examples:
# Like mailq
postqueue -p
# Tries to send every message in the queue
postqueue -f
# Tries to send every message in the queue for that site
postqueue -s site
postsuper - Postfix superintendent
Examples:
# Deletes one message
sudo postsuper -d 7C4D2EC0F5D
# Deletes all messages held in the queue for later delivery
sudo postsuper -d ALL deferred
Different mail queues in postfix:
incoming
mail who just entered the system
active
mail to be delivered
deferred
mail to be delivered later because there were problems
hold
mail that should not be delivered until released from hold
Mail logs are in:
/var/log/mail.log
/var/log/mail.err
/var/log/mail.info
/var/log/mail.warn
Mail delivery Mailbox formats:
  • mbox: single file, mail separated by "From " lines
  • maildir: one directory per folder, one file per mail
  • mh: similar to maildir, but not really used
Alternate MDA: procmail: allows to filter mail automatically into different folders. Mail forwarding with ~/.forward: allows to redirect mail to a different address: just put the address you want to send to in the file ~/.forward.
POP or IMAP server Installation:
apt-get install dovecot
Configuration is in:
/etc/dovecot/dovecot.conf
The main thing that is needed is to enable the mail protocols you want:
protocols = imaps
Server monitoring To make all sorts of graphs:
apt-get install munin munin-node
Example: http://munin.ping.uio.no To compute more statistics:
  • anteater
  • isoqlog
  • mailgraph
Monitor system logs: logcheck:
  • sends you mail with abnormal log lines
  • It's important to customize what is normal and you do it with regular expressions
Filtering viruses and spam clamav - Virus scanner Virus scanning:
  • Postfix gives the mail to clamav that scans it and gives it back if it's clean.
  • Strategies for infected mail:
    • silently delete it
    • refuse the mail and send a notification to the sender
    • refuse the mail and send a notification to the receiver
    • quarantine the e-mail
    • refuse delivery with a SMTP error
    • deliver with an extra header that says that it's a virus
spamassassin - Spam filter Spam scanning:
  • Postfix gives the mail to spamd that scans it and gives it back with some spam information.
  • Strategies for spam mail:
    • silently delete it
    • refuse the mail and send a notification to the sender
    • refuse the mail and send a notification to the receiver
    • quarantine the e-mail
    • refuse delivery with a SMTP error
    • deliver with an extra header that says that it's spam
  • New techniques:
    • greylisting: when you receive a mail from a host you've never seen before, refuse it with a temporary error, and accept it the second time (after some time delay). Spammers normally don't retry, and implementing retry would increase their cost of sending e-mail.
    • crossassassin: if more than some amount of your users receive a mail with the same message ID, throw it away. Sending mails with different headers would increase the cost of sending e-mail.
Man pages and sections Man pages are divided in sections:
  • man man shows all the sections of the manpages
  • man 5 postconf shows the postconf manpage in the "configuration file" section
  • Normally manpages are referred as manpage(section) (e.g. postconf(5) )

Enrico Zini: Fifth day in Addis

Samba To get samba:
apt-get install samba samba-doc smbclient
To get the Samba Web Administration Tool:
apt-get install swat netkit-inetd
The configuration is in /etc/samba:
  • One [global] section with the general settings
  • One section per share
One could use swat at http://localhost:901/ but it does not work easily on Ubuntu. To see what is shared:
smbclient -L localhost
To access a share:
smbclient //localhost/name-of-the-share
To add a new user:
sudo smbpasswd -a username
To change the password of a user:
sudo smbpasswd username
To test accessing a share as a user:
smbclient //localhost/web -U yared
Documentation:
man smb.conf
To force the user or group used to access a share:
force user = enrico
force group = www-data
To set the unix permissions for every created file:
# For files
create mask = 0664
# For directories
directory mask = 0775
Example share configuration for a webspace:
mkdir /var/www/public
chgrp www-data /var/www/public
chmod 0775 /var/www/public
Then, in /etc/samba/smb.conf:
[web]
   comment = Webspace
   path = /var/www
   writable = yes
   public = no
   force group = www-data
   create mask = 0664
   directory mask = 0775
Example share configuration for a read only directory where only a limited group of people can write:
[documents]
   comment = Documents
   path = /home/enrico/Desktop/documents
   force user = enrico
   public = yes
   writable = no
   write list = enrico, yared
Print server (CUPS) Installation:
apt-get install cupsys
Configuration:
  • On the web (not enabled in Ubuntu):

    http://localhost:631/
    
  • On the desktop:

    System/Administration/Printing
    
Example IPP URIs:
ipp://server[:port]/printers/queue
http://server:631/printers/queue
ipp://server[:port]/...
For example:
ipp://server/printers/laserjet
"This printer uri scheme can be used to contact local or remote print services to address a particular queue on the named host in the uri. The "ipp" uri scheme is specified in the Internet Print Protocol specifications and is actually much more free form that listed above. All Solaris and CUPS based print queues will be accessed using the formats listed above. Access to print queues on other IPP based print servers requires use of the server supported ipp uri format. Generally, it will be one of the formats listed above."
GRUB The configuration file is in /boot/grub/menu.lst. The documentation can be accessed as info grub after installing the package grub-doc. Quick list of keys for info:
arrows
move around
enter
enters a section
l
goes back
u
goes up one node
q
quit
/
search
Grub trick to have a memory checker:
  1. apt-get install memtest86+

  2. Add this to /boot/grub/menu.lst:

    title Memory test
        root (hd0,5)
        kernel /boot/memtest86+.bin
    
Firewall With iptables:
man iptables
# Only allow in input the network packets
# that are going to the web server
iptables -P INPUT DROP
iptables -A INPUT --protocol tcp --destination port 80 -j ACCEPT
# To reset the input chain as the default
iptables -F INPUT
iptables -P INPUT ACCEPT
Some links:
Squid Installation:
apt-get install squid
The configuration is in /etc/squid/squid.conf. To allow the local network to use the proxy:
# Add this before "http_access deny all"
acl our_networks src 10.4.15.0/24
http_access allow our_networks
To use a parent proxy:
cache_peer proxy.aau.edu.et     parent    8080  0  proxy-only no-query
Pay attention because /var/spool/squid will grow as the cache is used. The maximum cache size is set in the directive cache_dir. Information about squid access control is at http://www.squid-cache.org/Doc/FAQ/FAQ-10.html To check that the configuration has no syntactic errors: squid -k parse. To match urls:
acl forbiddensites url_regex [-i] regexp
For info about regular expressions:
man regex
Example filtering by regular expression:
acl skype url_regex -i [^A-Za-z]skype[^A-Za-z]
http_access deny skype
Transparent proxy setup: http://www.tldp.org/HOWTO/TransparentProxy.html
Problems found today Hiccups of the day:
  • swat does not run on Ubuntu because Ubuntu does not have inetd
  • swat does not allow root login on Ubuntu because root does not have a password
  • smbpasswd -a does not seem to update the timestamp of /var/lib/samba/passwd.tdb
  • cups web admin does not work on Ubuntu
  • LDAP is still not so intuitive to set up

Enrico Zini: Fourth day in Addis

Unix file permissions:
drwxr-xr-x   2 root root    38 2006-07-14
 
+- Is a directory
drwxr-xr-x   2 root root    38 2006-07-14
 ---
   
  +- User permissions (u)
drwxr-xr-x   2 root root    38 2006-07-14
    ---
      
     +- Group permissions (g)
drwxr-xr-x   2 root root    38 2006-07-14
       ---
         
        +- Permissions for others (o)
drwxr-xr-x   2 root root    38 2006-07-14
               ----
                 
                +- Owner user
drwxr-xr-x   2 root root    38 2006-07-14
                    ----
                      
        Owner group -+
Other bits:
  • 4000 Set user ID:
    • For executable files: run as the user who owns the file, instead of the user who runs the file
    • For directories: I think it's not used
  • 2000 Set group ID:
    • For executable files: run as the group who owns the file, instead of the group of the user who runs the file
    • For directories: when a file is created inside the directory, it belongs to the group of the directory instead of the default group of the user who created the file
  • 1000 Sticky bit:
    • For files: I think it's not used anymore
    • For directories: only the owner of a file can delete or rename the file
The executable bit for directories means "can access the files in the directory". If a directory is readable but not executable, then I can see the list of files (with ls) but I cannot access the files. To access a file, all the directories of its path up to / need to be executable. Commands to manipulate permissions:
  • chown - change file owner and group
  • chgrp - change group ownership
  • chmod - change file access permissions
  • sudo adduser enrico www-data adds the user enrico to the group www-data.
Example setup for a website for students:
# Create the group 'students'
mkdir /var/www/students
chgrp students /var/www/students
chmod 2775 /var/www/students
# If you don't want other users to read the files of the students:
chmod 2770 /var/www/students
adduser www-data students
 (this way the web server can read the
  pages)
# when you add a user to a group, it does not affect running processes:
 - users need to log out and in again
 - servers need to be restarted
Apache:
  • To install apache2 without a graphical interface:

    apt-cache search apache2   less
    sudo apt-get install apache2
    
  • By default, /var/www is where is the static website.

  • By default, ~/public_html is the personal webspace for every user, accessible as: http://localhost/~user

  • By default, /usr/lib/cgi-bin contains scripts that are executed when someone browses http://website/cgi-bin/script

  • By default, apache reads the server name from the DNS. If we don't have a name in the DNS and we want to use the IP, we need to set:

    ServerName 10.4.15.158
    
    in /etc/apache/apache2.conf (set it to your IP address)
  • To access the Apache manual: http://localhost/doc/apache2-doc/manual/

  • http://localhost/doc/apache2-doc/manual/mod/mod_access.html The access control module

  • http://localhost/doc/apache2-doc/manual/mod/mod_auth.html The user authentication module

  • To edit a user password file, use:

    htpasswd - Manage user files for basic authentication
    
  • Example .htaccess file to password protect a directory:

    AuthUserFile /etc/apache2/students
    AuthType Basic
    AuthName "Students"
    Require valid-user
    
  • Information about .htaccess is in http://localhost/doc/apache2-doc/manual/howto/htaccess.html

  • If you need to tell apache to listen on different ports, add a Listen directive to /etc/apache2/ports.conf. Then you can use:

    <VirtualHost www.training.aau.edu.et:9000>
    [...]
    </VirtualHost>
    
  • To setup an HTTPS website:

    • Documentation is in http://localhost/doc/apache2-doc/manual/ssl/

    • How to create a certificate: http://www.tc.umn.edu/~brams006/selfsign.html

    • Create a certificate:

      /usr/sbin/apache2-ssl-certificate -days 365
      
    • Create a virtual host on port 443:

      <VirtualHost www.training.aau.edu.et:443>
      [...]
      </VirtualHost>
      
    • Enable SSL in the VirtualHost:

      SSLEngine On
      SSLCertificateFile /etc/apache2/ssl/apache.pem
      
    • Enable listening on the HTTPS port (/etc/apache2/ports.conf):

      Listen 443
      
Apache troubleshooting:
  • check that there are no errors in the configuration file:

    apache2ctl configtest
    
    This it is always a good thing to do before restarting or reloading apache.
  • read logs in /var/log/apache2/

  • if you made a change but you don't see it on the web, it can be that you have the old page in the cache of the browser: try reloading a few times.

To install PHP
  • apt-get install libapache2-module-php5

  • then by default, every file .php is executed as php code

  • Small but useful test php file:

    <? phpinfo() ?>
    
To install MySQL
  • apt-get install mysql-client mysql-server

  • for administration run mysql as root:

    • Create a database with:

      create database students
      
  • Give a user access to the database:

    # Without password
    grant all on students.* to enrico;
    # With password
    grant all on students.* to enrico identified by "SECRET";
    
  • More information can be found at http://www-css.fnal.gov/dsg/external/freeware/mysqlAdmin.html

To use MySQL from PHP:
apt-get install php5-mysqli php5-mysql
Problems found today:
  • the apache2 manual in /usr/share/doc/manual can only be viewed using apache because it uses MultiView. So you need to have a working apache to read how to have a working apache.
  • chmod does not have examples in the manpage.

Enrico Zini: Third day in Addis

Believe it or not, a network that fails often is the best thing to have when you are teaching network troubleshooting. Various tools useful for networking:
  • ifconfig - configure a network interface

  • dnsmasq - Simple DNS and DHCP server

  • host - DNS lookup utility

  • route - show / manipulate the IP routing table

  • arping - send ARP REQUEST to a neighbour host

  • mii-tool - view, manipulate media-independent interface status (IOW, see if the cable works)

  • nmap - Network exploration tool and security / port scanner Examples:

    # Look at what machines are active in the local network:
    nmap -sP 10.5.15.0/24
    # Look at what ports are open in a machine:
    nmap 10.5.15.26
    
  • tcpdump - dump traffic on a network It can be used to see if there is traffic, and to detect traffic that shouldn't be there.

Useful tip:
# Convert a unix timestamp to a readable date
date -d @1152841341
What happens when you browse a web page:
  1. type the address www.google.com in the browser
  2. the browser needs the IP address of the web server:
  1. look for the DNS address in /etc/resolv.conf (/etc/resolv.conf is created automatically by the DHCP client)
  2. try all the DNS servers in /etc/resolv.conf until one gives you the IP address of www.google.com
  3. take the first address that comes from the DNS (in our case was 64.233.167.104)
  1. figure out how to connect to 64.233.167.104:
  1. consult the routing table to see if it's in the local network:
  1. if it's in the local network, then look for the MAC address (using ARP - Address Resolution Protocol)
  2. if it'd not in the local network, then send through the gateway (again using ARP to find the MAC address of the gateway)
  1. Send out the HTTP request to the local web server or through the gateway, using the Ethernet physical protocol, and the MAC address to refer to the other machine.
Troubleshooting network problems:
  1. See if the network driver works:
  1. With ifconfig, see if you see the HWaddr:. If you do not see it, then the linux driver for the network card is not working. Unfortunately there's no exact way to say that it works perfectly
  1. See if you have an IP address with ifconfig. If you find out that you need to rerun DHCP (for example, if the network cable was disconnected when the system started), then you can do it either by deactivating/reactivating the Ethernet interface using System/Administration/Networking or, on a terminal, running:

    # ifdown eth0
    # ifup eth0
    
    If you don't get an IP, try to see if the DHCP server is reachable by running:
    $ arping -D [address of DHCP server]
    
  2. See if the local physical network works:

  1. With sudo mii-tool, see if the cable link is ok. If it's not, then it's a problem in the cable or the plugs, or simply the device at the other end of the cable is turned off.
  2. Try arping or ping -n on a machine in the local network (like the gateway) to see if the local network works.
  1. See if the DNS works:
  1. Find out the DNS address:

    cat /etc/resolv.conf
    
  2. If it's local, arping it

  3. If it's not local, ping -n it

  4. Try to resolve a famous name using that DNS:

    $ host [name] [IP address of the DNS]
    
  5. Try to resolve the name of the machine you're trying to connect. If you can resolve a famous name but not the name you need, then it's likely a problem with their DNS.

  1. If you use a proxy, see if the proxy is reachable: check if the proxy name resolves to an IP, if you can ping it, if you can telnet to the proxy address and port:

    $ telnet [proxy address] [proxy port]
    
    you quit telnet with ^]quit.
  2. If you can connect directly to the web server, try to see if it answers:

    $ telnet [address] 80
    
    If you are connected, you can confirm that it's a web server:
    GET / HTTP/1.0 (then Enter twice)
    
    If it's a web server, it should give you something like a webpage or an HTTP redirect.
When you try to setup a service and it doesn't work:
  1. check that it's running:

    $ ps aux   grep dnsmasq
    
  2. check that it's listening on the right port:

    $ sudo netstat -lp
    
  3. check that it's listening from the outside:

    $ nmap [hostname]
    
  4. check for messages in /var/log/daemon.log or /var/log/syslog

  5. check that the configuration is correct and reload or restart the server to make sure it's running with the right configuration:

    # /etc/init.d/dnsmasq restart
    
dnsmasq:
By default: works as a DNS server that serves the data in /etc/hosts. By default: uses /etc/resolv.conf to find addresses of other DNS to use when a name is not found in /etc/hosts. To enable the DHCP server, uncomment:
dhcp-range=192.168.0.50,192.168.0.150,12h
in /etc/dnsmasq.conf and set it to the range of addresses you want to serve. Pay attention to never put two DHCP servers on the same local network, or they will interfere with each others. To test if the DHCP server is working, use dhcping (not installed by default on Ubuntu). To communicate other information like DNS, gateway and netmask to the clients, use this piece of dnsmasq.conf:
# For reference, the common options are:
# subnet mask - 1
# default router - 3
# DNS server - 6
# broadcast address - 28
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.0.1
dhcp-option=6,192.168.0.1
dhcp-option=28,192.168.0.255
Problems found today:
  • changing the name of the local machine in /etc/hosts breaks sudo, and without sudo it's impossible to edit the file. The only way to fix this is a reboot in recovery mode.
  • dhclient -n -w is different than dhclient -nw
Quick start examples with tar:
# Create an archive
tar zcvf nmap.tar.gz *.deb
# Extract an archive
tar zxvf nmap.tar.gz
# Look at the contents of an archive
tar ztvf nmap.tar.gz
Quick & dirty way to send a file between two computers without web server, e-mail, shared disk space or any other infrastructure:
# To send
nc -l -p 12345 -q 1 < nmap.tar.gz
# To receive
nc 10.5.15.123 12345 > nmap.tar.gz
# To repeat the send command 20 times
for i in  seq 1 20 ; do nc -l -p 12345 -q 1 < nmap.tar.gz ; done

13 July 2006

Enrico Zini: First pratical lesson

Notes after today's training session. Small index of most used shell commands:
  • ls - list directory contents
  • cp - copy files and directories
  • mv - move (rename) files
  • rm - remove files or directories
  • find - search for files in a directory hierarchy
  • cat - concatenate files and print on the standard output
  • more - file perusal filter for crt viewing
  • less - opposite of more (quit with 'q')
  • cd - Change the current directory to DIR. (use "help cd" instead of "man cd")
  • mkdir - make directories
  • rmdir - remove empty directories
Small index of commands useful for combining in pipelines:
  • grep, egrep, fgrep, rgrep - print lines matching a pattern
  • tail - output the last part of files
  • head - output the first part of files
  • sort - sort lines of text files
  • uniq - report or omit repeated lines
  • sed - stream editor
  • wc - print the number of newlines, words, and bytes in files
Problems found during the lesson:
  • You set the system default locale to Amharic, and the gdm login will be in Amharic input mode. We didn't find out how to switch it back to input roman characters. Right click on the input field to set the input method doesn't work. Since usernames are not in Amharic, you're locked out.

  • So you CTRL+ALT+F1, login and try dpkg-reconfigure locales. On Ubuntu Dapper, it does not work anymore.

  • So you dig and dig and dig and finally find that you can force a locale in /etc/default/gdm (but not in /etc/gdm/locale.conf, nor in /etc/gdm/gdm.conf).

  • Then the internet works for a bit and you look up how to reconfigure locales in Ubuntu. Turns out you have to use localeconf, which is not installed by default, is not in universe and thus not on the CDs, and needs to be downloaded from the Internet.

  • The Ubuntu wiki is all on https, which defeats any attempt of proxy caching.

  • An Internet proxy needs to be configured 3 times: in Gnome, in Firefox and in Synaptic (well, apt). This is especially tricky when you forgot to setup the proxy in Synaptic and seemingly unrelated applications fail, like the Ubuntu language selector, which internally invokes the package manager to download missing langpacks.

  • Some short descriptions in the NAME section of manpages are hard to understand, or wrong. Noted on apt-get, apt-cache and less. Top prize goes to apt-cache:

    NAME
           apt-cache - APT package handling utility -- cache manipulator
    DESCRIPTION
           [...] apt-cache does not manipulate the state of the system but
           does provide operations to search and generate interesting output
           from the package metadata. [...]
    
    So apt-cache is a manipulator that doesn't manipulate. A possible improvement can be "query the APT package cache".
  • The language selector in Ubuntu Breezy doesn't really exit and keeps the package database locked. This seems to be fixed in Dapper, and probably had been fixed in some Breezy update. System updates here are a problem: my Dapper (with some Universe things in it) wanted to download more than 120Mb of data, and the Uni network was giving me 14Kbps. It's been a nice opportunity to teach about fuser -uva and kill.

  • dict, squid and many other packages from 'main' are not on the normal Ubuntu CDs: is there an easy way to build a CD with them? Or do Ubuntu CDs with extra packages already exist? I'll have to find out.

  • cupsys has documentation outside of /usr/share/doc, in /usr/share/cups/doc-root.

  • man works on all commands, except cd, which is an internal shell command and thus needs help instead of man. I should remember to ponder about autogenerating manpages from help output.

  • Is there an index-like manpage with a list of the core Unix commands and their short descriptions? It there's not, it's easy to generate:

    #!/bin/sh
    DIR=$ 1:-"/bin" 
    (
    find $DIR   while read FILE
    do
       if [ -x $FILE ] && ! [ -d $FILE ]
       then
               LANG=C COLUMNS=2000 man  basename $FILE    \
                     grep ^SYNOPSIS -B 100   grep ^NAME -A 100   \
                     tail -n +2   head -n +2   \
                     grep -v '^[ \t]*$'
       fi
    done
    )   sort   uniq   sed 's/^ \+//'
    
    Try running it on /bin and /sbin: it's great!. Also, since it doesn't redirect stderr, it nicely exposes a number of manpage problems.
Lots of bugs to report when I come home: from here it'll take ages, and lots of money on the hotel internet connection, and some are Ubuntu-specific so I'd need to do everything online with Malone. As usual, teaching is one of the best ways to find bugs. I propose an Etch training session a month before release. Other things to do:
  • Find more info about that Wikipedia live CD with Wikipedia browsable without the Internet.
  • Make a collection of Free technical E-books: even those Indian low-cost book editions are too expensive here, so E-books mean a lot.

11 July 2006

Enrico Zini: Pride

http://www.linux.com/article.pl?sid=06/07/03/1744235 "Roaming Ethernet configuration with Guessnet"

Enrico Zini: First day in Addis

First day in Addis Ababa, after the introductory session for this 10 days Linux training. Interesting new quotes I picked up from the excellent presentation of Dr. Dawit:
Much that I bound I could not free
Much that I freed returned to me
(I didn't manage to transcribe the attribution)
And this one for Bubulle, about translation:
When you speak to me in my language
you speak to my heart
when you speak to me in English
you speak to my head
(sb.)
Incomplete list of questions I've been asked, in bogosort -n order:
  • How do I get support?
  • Are the configuration files always the same accross different distributions?
  • What is the level of interoperatibility between the various Linux distributions? And between different Unix-like systems?
  • Does plug and play work well when I change hardware?
  • Can I access NTFS partitions?
  • How do I play multimedia files in restricted formats?
  • I heard that NFS has security problems: can it be secured, or are there other file sharing alternatives?
  • Can I access a desktop remotely?
  • Can I install Linux on a computer where there's Windows already? Do I need to partition?
  • Can I be sure to find drivers for my hardware?
I'm happy to find that we've been successful in building more and more good answers for these questions.

8 July 2006

Martin Michlmayr: LSM, FrOSCon, FLOSSWorld

Well, I've been conferencing again. I'm currently sitting in a train with Andreas Barth, returning from the Libre Software Meeting in Nancy, France. We attended the conference to take part in a workshop organized by EDOS, an EU-sponsored project which focuses on challenges the makers of Linux distributions are facing. Andreas, Enrico Zini and I gave overviews of various issues in Debian and the EDOS folks (which includes a number of people working on Mandriva) presented their work. Some of it seems pretty interesting and can potentially be integrated into Debian but time will tell. Andreas posted a summary to get a discussion going. Last week I attended FrOSCon near Bonn to present the keynote speech. I really liked the conference because it was a true community event, with lots of effort put in by the local organizers, and the event was pretty relaxing (at least for me, probably not for the organizers who did a great job hiding all the work that is required behind the scenes). Just before attending FrOSCon, I met up with a friend from high school and spent a few days in Amsterdam. A few weeks ago I attended FLOSSWorld in Brussels to talk about skill development in FLOSS communities. FLOSSWorld is a project to study free software communities all around the world as an extension of the work done a few years which focused on Europe. One of the nice things about FLOSSWorld was that my hotel was a few minutes on one side of the cathedral in Brussels and the conference venue a few minutes on the other side. So I finally managed to visit the cathedral, something I never managed to do in all the years I attended FOSDEM in Brussels.

Enrico Zini: Debtags smart search

I did more thinking and prototyping to the debtags smart search ideas. The result is an interactive search session with quite some smartness inside. It shows two groups of tags to choose from. The first group of tags has tags related to the keyword search. The second group has tags that, if choosen, operate a substantial trimming of the result set. We're not yet reading for uploading the new library stack to Debian. If you want to play from subversion repositories, see this mail. I can however show an example interactive session needs to be shared. Notice how I get to a high quality solution in just 2 iterations:
$ tools/debtags smartsearch image editor
Tag selection:
1) hardware::camera (44/18710)
2) works-with::image:raster (335/18710)
3) hardware::storage:dvd (27/18710)
4) special::meta (86/18710)
5) devel::debian (55/18710)
6) works-with::archive:iso9660 (44/18710)
7) use::typesetting (61/18710)
8) special::not-yet-tagged (5745/18710)
9) devel::library (3727/18710)
10) role::sw:utility (2707/18710)
11) interface::x11 (2434/18710)
12) interface::commandline (2137/18710)
13) x11::application (2040/18710)
14) role::content:data (1573/18710)
18710 packages selected so far.
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): +2 -9 +11
Tag selection:
1) interface::x11 (wanted)
2) works-with::image:raster (wanted)
3) devel::library (unwanted)
4) hardware::camera (10/113)
5) special::meta (1/113)
6) use::typesetting (1/113)
7) works-with::video (8/113)
8) made-of::lang:c++ (2/113)
9) suite::gnome (9/113)
10) uitoolkit::athena (9/113)
11) uitoolkit::gtk (50/113)
12) role::sw:application (41/113)
13) use::viewing (39/113)
14) role::sw:utility (33/113)
15) use::editing (30/113)
16) uitoolkit::qt (23/113)
17) suite::kde (18/113)
113 packages selected so far.
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): +15
Tag selection:
1) interface::x11 (wanted)
2) use::editing (wanted)
3) works-with::image:raster (wanted)
4) devel::library (unwanted)
5) hardware::camera (1/30)
6) special::meta (1/30)
7) works-with::video (3/30)
8) made-of::lang:c++ (1/30)
9) suite::gnome (2/30)
10) uitoolkit::athena (4/30)
11) x11::application (24/30)
12) role::sw:application (15/30)
13) uitoolkit::gtk (11/30)
14) uitoolkit::qt (7/30)
15) suite::gimp (6/30)
16) suite::kde (6/30)
17) x11::application (24/30)
18) role::content:data (5/30)
30 packages selected so far.
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): d
gimp - The GNU Image Manipulation Program
babygimp - An icon editor in Perl-Tk
cinepaint - motion picture image painting and retouching tool
cinepaint-data - data files for CinePaint
digikamimageplugins - image editor plugins for digikam and showfoto
kiconedit - an icon editor for KDE
kchart - a chart drawing program for the KDE Office Suite
gimp-data-extras - An extra set of brushes, palettes, and gradients for The GIMP
scribus - Open Source Desktop Publishing
xpaint - simple paint program for X
puredata - realtime computer music and graphics system
gimp-data - Data files for The GIMP
gimp-python - Python support and plugins for The GIMP
gimp-gap - The GIMP Animation Package
gimp-texturize - generates large textures from a small sample
gnome-iconedit - A small tool to create icons for the gnome-desktop
gpaint - GNU Paint - a small, easy to use paint program for GNOME
gsumi - pressure sensitive "ink" drawing
gtkmorph - Digital image warp and morph (gtk)
gtkmorph-example - digital image warp and morph, examples
xmorph - digital image warp and morph (x11)
imaptool - A tool for creating client-side image maps
junior-art - Debian Jr. Art
kcoloredit - a color palette editor and color picker for KDE
kolourpaint - a simple paint program for KDE
kimagemapeditor - HTML image map editor for KDE
pixmap - A pixmap editor
saods9 - image display tool for astronomy
sppc - Simple Panel Plot Composer
tkpaint - Versatile bitmap/pixmap editing tool
This other section is worth seeing as well: it shows the relevant tags computed for various keyword searches (I cut out the part which is always the same):
$ tools/debtags smartsearch kernel image
1) admin::boot (132/18710)
2) use::driver (108/18710)
3) admin::kernel (252/18710)
4) protocol::dhcp (24/18710)
5) role::sw:source (79/18710)
6) admin::hardware (161/18710)
7) devel::debian (55/18710)
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): k audio editor
1) sound::midi (33/18710)
2) works-with::music-notation (25/18710)
3) works-with::audio:wav (51/18710)
4) works-with::video:oggtheora (5/18710)
5) field::arts (21/18710)
6) sound::mixer (65/18710)
7) sound::recorder (10/18710)
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): k package manager
1) x11::window-manager (79/18710)
2) suite::xfce (34/18710)
3) x11::display-manager (10/18710)
4) x11::theme (82/18710)
5) works-with::software:package (110/18710)
6) suite::kde (503/18710)
7) made-of::data:icons (43/18710)
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): k debian package
1) suite::debian (282/18710)
2) devel::packaging (75/18710)
3) devel::debian (55/18710)
4) works-with::software:package (110/18710)
5) use::dialing (47/18710)
6) admin::user-management (114/18710)
7) hardware::modem (87/18710)
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): k linux kernel
1) admin::kernel (252/18710)
2) role::sw:source (79/18710)
3) use::driver (108/18710)
4) interface::svga (31/18710)
5) hardware::usb (32/18710)
6) admin::filesystem (151/18710)
7) hardware::camera (44/18710)
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): k gps
1) field::geography (57/18710)
2) hardware::emulation (98/18710)
3) works-with::image:vector (107/18710)
4) devel::ide (41/18710)
5) works-with::software:running (93/18710)
6) made-of::lang:ada (26/18710)
7) x11::application (2040/18710)
Your choice (+#, -#, =#, K word, View, Done, Quit, ?): q
This thing is getting smart. Can't wait for this to get seriously picked up by some GUI (think adept!).

6 July 2006

Enrico Zini: Passing data through vims using the X clipboard

So you have this nicely formatted piece of code in one vim and you'd like to paste it into another vim, but that usually messes up things. What I used to do was this:
  1. Select the code using V
  2. :w!/tmp/foobar
  3. Switch to the other vim
  4. :r/tmp/foobar
Then with vim7 I could just load files in different tabs and do everything inside vim. But sometimes I have more than one vim running anyway. Today I figured out a better way:
  1. Select the code using any of v, V, ^V
  2. Copy into the X clipboard: "*y
  3. Switch to the other vim
  4. "*p
It SO works. It'll even allow you to copy and paste block selections accross different vim instances. Of course this can also be used to copy and paste pieces of text to/from any other program that can access the X clipbpard, like X applications or the nice xclip commandline tool:
  1. (any command) xclip
  2. Switch to vim
  3. "*p
Of course that is just an example: a better way to do it directly in vim is:
  1. :r!(any command)
But I'm happy, for two reasons:
  1. I can copy an paste arbitrary vim things between aribtrary vims using the X selection
  2. Within 10 minutes I'll receive 5 e-mails telling me of even better ways of doing this.
Update: some kind people suggested to use the :set paste and :set nopaste trick and then do normal copy&pasting using the X terminal.
That is what most people do, and what I used to do sometimes, but:
  • it takes too much typing;
  • it makes it awkward to select big quantities of text that don't fit in one screen;
  • it can't copy and paste arbitrary vim objects (try pasting a ^V block selection with :paste);
  • it doesn't always exactly paste what was copied (you copy tabs and you're likely to paste spaces).

29 June 2006

Enrico Zini: New Economy

The short version:
Welcome to Benq-Siemens mobile phone support. Where do I click on this program in front of me to get the answer you need?
And when I'd tell them where exactly they should click, they weren't trusting me. It must be because I wasn't using the precise words they have on screen: the interface and user manual of my phone are in Italian, and I had to translate back to English. So I later downloaded the English manual. I was saying "phone lock code" when the English manual said "phonecode". I'm impressed. So at some point I asked them: "Suppose that my phone is broken. Do you have a list of repair services near Manchester?". Turns out they don't. The Benq-Siemens support center has no list of their own repair centers, and tells you (I swear) to google for it. I'll wait to be back to Italy: I know where to go, there. Conclusion: is there a SIP-VoIP software with a "record phone call" functionality? I don't know of any so far. Some things, if you just tell them, they're hard to believe.

27 June 2006

Enrico Zini: MyODBC, one row at a time

In case you were wondering how to get the query result one row at a time with the MySQL driver of UnixODBC, it's very easy. You just need to:
SQLSetStmtAttr(stm, SQL_ATTR_CURSOR_SCROLLABLE, (SQLPOINTER)SQL_NONSCROLLABLE, SQL_IS_INTEGER);
But not, of course, before having set the DSN Options field to 1048576 (with the ODBCConfig tool or something similar). It wasn't too hard to find out after reading most of the MySQL driver source code. And qalculate has a nice useful built-in shift operation.

21 June 2006

Jos Parrella: CNSL 2 Caracas

I flooded the Planet just by upgrading WordPress. So this weekend it’s happening in Caracas. The National Free Software Congress (CNSL) arrives to the capital in the second edition of the only nation-wide Free Software event. It will take place on Colegio Universitario de Caracas, in La Floresta, near the Indian Embassy, France Square and other nice landmarks of the city. The event is promoted by GLoVE, a national NGO which is currently organizing the CNSL and hosting several Linux User Groups (the whole list here in spanish, follow the links) including CHASLUG, the Free Software Users Group for the Young. I’m part of the group, but it’s currently run by three guys under 18. As in FLISOL Caracas, this will be a themed event featuring two days of conferences, keynote speakers, workgroups, expositions, installation festival and security related events. The first day is aimed to Free Software in Society, including presentations from government officials related to recent activities towards the Country migration. As Enrico pointed it in debconf-discuss and debian-project, some recent activities have been turning stronger the Free Software migration process in Venezuela. The announcement from the Department of Science and Technology of the mass capacitation of the citizens in the usage of computers featuring the Gnome Desktop Environment took everyone by surprise. Numbers are varying, being the more conservative around 400.000 people having their first computer relationship with Free Software, GNU/Linux and Gnome. Distribution? I haven’t see it yet, but most likely it will be Debian (the whole Department is using Debian) Saturday will also feature some conferences from community members about their experience on Free Software usage and how they can change the way people communicate and act with each other, specially noting the nationwide speech from Octavio Rossell about Free Software and GNU/Linux and the interesting presentation from Efra m M rquez-Arreaza on Business Models. Finally, on saturday, renowned economist Felipe P rez-Mart will be presenting his work Game Theory Applied to the Free Software Development Model. Sunday will be a hands-on day, like in FLISOL Caracas. The main speeches focus on development, featuring experienced programmers on PHP, Perl and Mono presenting Web and Desktop development tendencies in those programming languages. We will also feature an Ajax presentation and three workgroups about Linux Distributions, Web Development and Free Software and Education. On special guests, CNSL Caracas is proud to announce the visit of two fellow partners from IEEE Colombia: Erika Luque and Jeffrey Borb n from the District University of Bogot , and the special conference from Rafael N ez, who was apprehended in Miami, FL (US) for the massive attack of 679 servers in 2001, one of whom was the Air Force Training System in Colorado. He was also accused of attacking the Department of Defense servers and stealing confidential data from NASA. He made seven months of prision in Denver after declaring himself guilty of all charges and having the Judge to look on evidence of his work against child pornography with the Venezuelan CICPC. (more info in spanish) On the security side, Sunday will host the second Key Signing Party (guidelines in spanish here) and the first CACert assurance in Venezuela. We made the first KSP in CNSL Aragua (where I had the opportunity to speak about Debian and make a hands-on session on Marvelous Debian) with about 10 people. This time we’re aiming to something between 25 and 50 people. This is the first event promoting security culture in our Country and hopefully it will have a warm welcome in the public. Caracas will also be the inflexion point of the Congress, which will now travel to the Eastern part of the Country, usually forgotten by all the hacktivists in Venezuela. In states Sucre, Monagas and Bol var people is ready to have their first contact with free software through this Congress and hopefully next year the Congress will have a venue in each state of the Country (including the two most inhabited by natives, Delta Amacura and Amazonas) If you’re in Caracas, you’re welcome to pass by after registering (it’s free as in who cares) and if you’re not, you’re welcome to listen to the streaming that will be announced here. See you there!

20 June 2006

Enrico Zini: Debian grammars for polygen, or polygen grammars for Debian

Thanks to the cooperation with Mohammed Adn ne Trojette there's a new fantastic repository of:
S ::=  Debian  grammars for  Polygen 
       Debian   Polygen  grammars
    ;
You can find it at http://people.debian.org/~enrico/polygen-debian/ with all the instructions on how to play.

17 June 2006

Enrico Zini: DB-ALLe released!

DB-ALLe has been released! After more than a year of (paid) work, DB-ALLe has been released!
DB-All.e is a fast, temporary, on-disk database where meteorological data can be stored, searched, retrieved and updated. To make computation easier, data is stored as physical data, that is, as measures of a variable in a specific point of space and time, rather than as a sequence of report.
These are the main characteristics of DB-ALLe:
  • it is temporary, to be used for a limited time and then be deleted.
  • does not need backup, since it only contains replicated or derived data.
  • write access is enabled for its users.
  • it is fast for both read and for write access.
  • it is based on physical principles, that is, the data it contains are defined in terms of omogeneous and consistent physical data. For example, it is impossible for two incompatible values to exist in the same point in space and time.
  • it can manage fixed station and moving stations such as airplanes or ships.
  • it can manage both observational and forecast data.
  • it can manage data along all three dimensions in space, such as data from soundings and airplanes.
  • it can work based on physical parameters or on report types.
DB-ALLe has been written by me on behalf of ARPA-SIM a public agency which realises that being funded with public money also means letting the public access the result of what they do:
Copyright (C) 2005,2006 ARPA-SIM <urpsim@smr.arpa.emr.it> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License
Oh, and they make an outstanding weather forecast, the best you can find for my region. It's so good that people even started to trust them! :)

7 June 2006

Christoph Berg: Post-DebConf Woes

After getting back from DebConf and the 1-week trip afterwards, it took me a full week to get out of most of the chaos travelling usually leaves behind. I still haven't unpacked all stuff from the suitcase, but at least managed to wash the dirty clothes. Oh, and I've signed all keys from the KSP - including madduck's, he showed me his proper German ID card when I asked what this funny Transnational Republic was. (Oh, and if you were listed at the KSP, didn't show up, but I've signed your key anyway, that's because we met before and you have a new UID, in case you are wondering.) The pictures I took are still scatered over several home dirs on different hosts, I'll try to sort/rotate/rename them over the next days. (Oh, and DebConf was great, the trip afterwards likewise - I'll try to write a separate blog post on that later...) At the moment I'm slowly starting to get into frontdesk work. I have some notes from Neil's and Enrico's AM BoF and the discussion BoF round around my "NM process future" proposal that I still have to write down once I'm finished with answering my own NMs' mails. Both BoFs went pretty well, the major outcome being that we should discuss much more among AMs on -newmaint and IRC, have older AM reports available for reference by other AMs, and have some sort of "AM report template" that lists the points the DAMs want to see in the report. About the propsal, my feeling is that we shouldn't implement any major NM changes (like the DM idea) until we really understand what the problem with the current process is. (It takes too long, but that can be fixed by throwing out the not-ready applicants more aggressively.) Thanks to all the people who provided very valuable feedback during the BoFs and in the private conversations afterwards. So far, I've assigned a few applicants to AMs, added comments to the database on the level of prior contribution of the new applicants, and worked a bit on the web pages. The major visible change is that the NM graphs are now included on nm.d.o. The 'big' thing I'd like to implement next is to let the applicants write some application email where they list what they've done for Debian so far before the AM assignment, so we can match NM-AM better, and also improve our judgement of the level of prior contribution. Also, we will probably require 2 advocates per applicant in the future, to make sure people have worked with more than a single DD before. Of course, all this must not get excessive, we don't want to make joining Debian harder than it already is. Then there's also the usual 2k+ message backlog waiting in the Debian mailbox...

6 June 2006

Steve Kemp: Learning to cry for fun and profit

I saw on Planet Debian that Enrico Zini had some trouble using xen-tools:
Installing the base system.   This will take a while!
	
Copying files from host to image.
Finished
Something went wrong with the debootstrap installation
Aborting
This basically means that the invocation of debootstrap failed to leave the system with a /bin/ls present - meaning it failed for some reason. My immediate mad debugging skillz suggest retrying with either –verbose, or –cache=no. The first will hopefully show the problem, the second will most likely fix the problem. I’ve seen this a few times, but haven’t updated the code to check for it. When creating a new Xen instance of, say 4gb, we copy all the packages from the host systems /var/cache/apt/archives so that debootstrap doesn’t redownload things and use up bandidth. If these cached files are >4gb then the new image is 100% full and debootstrap won’t run successfully! In related news I’m currently working on a system called image-server - this is a distributed xen-create-image script. The idea is that you have a central host which is responsible for creating Xen images of Debian, RedHat, Gentoo, and serving them to clients. This isn’t much use for a home user, but as a hosting company wanting to provide Xen instances of semi-arbitary Linux distributions it should come in handy. In other news I want to work on modularising the Xen tools scripts and moving them onto xen-tools.org.

Enrico Zini: One beer to Steinar

Steinar, you made my day! Here's a fixed version:
#! /bin/sh
WORK=" mktemp "
wget -O- "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=$1&mbox=yes" > "$WORK"
mutt -f "$WORK" # -e 'push D~=\n$'
rm "$WORK"
Now, it would be nice if it integrated with bts cache... abi on #debian-devel suggests to use:
bts show --mbox <bugid>
Wow! I didn't know it existed! And indeed it integrates with bts cache :)

5 June 2006

Enrico Zini: Minimal steps to get Taiwanese input on Gnome

I finally found a minimal, simple, non-intrusive way to get Taiwanese input on Gnome:
apt-get install scim-chewing im-switch
Then, as a user:
im-switch -s scim
Then log out and in again. It should work. If it doesn't, then you need to tell pango to use SCIM: right click wherever you have the cursor, choose "Input method" and then "SCIM". There! It works! ^^d ^^Y

4 June 2006

Enrico Zini: Dapper on XEN (part 1/1, unfinished)

I need to do some work on a Dapper system, so it's time to try out xen:
apt-get install linux-image-2.6-xen-686 xen-hypervisor-3.0-i386 xen-utils-3.0 xen-tools
xen-tools tries to recommend xen, which is old and has been requested to be removed from the archive. The recommends needs to be ignored, which is not that trivial to do with aptitude. The linux-image doesn't happen to have an initrd. The bug has already been reported. One can recreate one using:
mkinitrd -o/boot/initrd-2.6.16-2-xen-686.img  2.6.16-2-xen-686
Then one adds this to /boot/grub/menu.lst:
title Xen
root (hd0,0)
kernel /boot/xen-3.0-i386.gz
module /boot/vmlinuz-2.6.16-2-xen-686 root=/dev/hda1
module /boot/initrd.img-2.6.16-2-xen-smp
And it boots lovely:
# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
Domain-0                           0      939     2 r-----  4677.9
Now xen-tools provides xen-create-image. I'll try to create the Dapper image (deboostrap in my system has already been changed to be able to install dapper):
xen-create-image --size=4G --swap=128M --dhcp --volume=marvin \
                 --hostname=cavazza --dist=dapper --fs=xfs
But I get:
[...]
Creating swapfile : /dev/marvin/cavazza-swap
Done
Creating disk image: /dev/marvin/cavazza-root
Done
Creating xfs filesystem
Done
Installing the base system.   This will take a while!
Copying files from host to image.
Finished
Something went wrong with the debootstrap installation
Aborting
I love detailed error messages. This one is not. So I'll have to do by hand. The documentation says:
Before you can start an additional domain, you must create a configuration file. We provide two example files which you can use as a starting point:
  • /etc/xen/xmexample1 is a simple template configuration file for describing a single VM.
  • /etc/xen/xmexample2 file is a template description that is intended to be reused for multiple virtual machines. Setting the value of the vmid variable on the xm command line fills in parts of this template.
But in Debian there's no trace of the two example files. I've reported to Guido Trotter. Then I googled for the two files and found them. Now, on to adapt Dapper to run under Xen. The good Ubuntu wiki has an HOWTO which crudely makes you install the Tarballed Pre-built installations of Xen 3.0. It's sad that xen-enabled kernels didn't make it into Dapper roper. I can make this:
kernel = "/boot/vmlinuz-xen-domu"
memory = 128
name = "Dapper"
disk = [ 'phy:marvin/dapper,hda1,w' ]
dhcp="dhcp"
root = "/dev/hda1 ro"
I used the pre-built kernel as a domU, but:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
Sigh. I'll try with the Debian Xen-enabled kernels. Installing yaird and linux-image-2.6.16-2-xen-686_2.6.16-14_i386.deb and linux-modules-2.6.16-2-xen-686. It WORKS! Now, that's not Dapper: that's a debootstrap install of it. No user, no root password, no desktop, no shiny Ubuntu custom config. How to finish the installation? No idea. In the past, I could run base-config, but now it doesn't exist anymore. It seems that the best bet is not to use debootstrap, but to install the CD in the LVM partition using QEMU and then chroot into it and then install the debian xen kernel to boot it. A QEMU install will take ages, and I expect some trouble, like getting partman to see LVM. Maybe I better install on a disk image file and then use tar and netcat to bring the ubuntu installation out of the disk image and into the LVM image. For today, I didn't make it. This job slips another day. Frustration. I hope that at least this description of my efforts so far can be helpful to someone trying similar things. One suggestion I got was to boot the Dapper CD and install from there. I can't: this computer has no bootable CD. Update: I found out http://xensource.com/summerofcode.html and it says:
Project Idea 3: Xen Desktop Outside of Domain 0 This project would deliver a Xen desktop to the user of a client system that presents an abstraction of a virtual desktop to the user in which multiple guests share the virtual desktop, each with a subset of the desktop resources (pixels, etc). Smart management of the sound drivers would allow mixing of sound from multiple guests to the single device used for output. Microphone input could be broadcast to all guests. Technologies such as ALSA already emulate playback settings by downsampling for the hardware etc. so its not hard to imagine a xen-snd-front device munging the data to a common format used for the internal sound card. Issues: synchronization of playback.
So, what I'm trying to do has been proposed as a SoC project and (I guess) is something that can't be done overnight. Although I was planning to run a diskless gdm accessed with XDMCMP from domain0's X server, and to just hand out the audio card to the domU using pciback, so my task would have been easier. Thus I give up using Xen for this one. I'll work around the lack-of-bootable-cd limitation of this computer by installing Ubuntu using QEMU. Which I found out requires using the "Alternate install" CD. The desktop install CD is a live CD installing with Ubuntu Expresso, and the live CD doesn't seem to work in QEMU. Or, I'll install in a LVM partition in the laptop and then move it around using the network. This one's probably faster. Could this experience be an interesting use case for Edgy Eft?

Next.

Previous.