Xen 3.0.3 on Debian 4.0 Etch

Here is the instruction for running XEN on Debian Etch on Core2Duo 6300 with 2GB Ram.

First, install all the packages that related to XEN.

apt-get install  libc6-xen linux-headers-2.6-xen-686
linux-headers-2.6-xen-vserver-686 linux-headers-2.6.18-4-xen
linux-headers-2.6.18-4-xen-686 linux-headers-2.6.18-4-xen-vserver
linux-headers-2.6.18-4-xen-vserver-686 linux-image-2.6-xen-686
linux-image-2.6-xen-vserver-686 linux-image-2.6.18-4-xen-686
linux-image-2.6.18-4-xen-vserver-686 linux-image-xen-686
linux-image-xen-vserver-686 linux-modules-2.6.18-4-xen-686
linux-modules-2.6.18-4-xen-vserver-686 xen-hypervisor-3.0.3-1-i386
xen-hypervisor-3.0.3-1-i386-pae xen-ioemu-3.0.3-1 xen-tools
xen-utils-3.0.3-1 xen-utils-common bridge-utils iproute sysfsutils

Then, boot reboot the machine and choose the pae kernel to boot.

Next, add the following into /etc/network/interface for the Xen Bridge neteork.

auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth0
# optional
bridge_maxwait 0

To build a new debian domain:

Configurature /etc/xen-tools/xen-tools.conf collectly such as kernel version and initrd.

Then, run

xen-create-image --hostname=<name_of_DomU> --dir /home/xen/images/debian

Next, configurature

/etc/xen/<name_of_DomU>.cfg

to make sure all the Tag are correct.

Finally, run

xm create test.cfg -c

to run the VM.

As Core2Duo 6300 support VT, we could run Windows under Xen.

To run Windows in Xen,

first, build an image file for windows.

dd if=/dev/zero of=/home/xen/images/WinXP.img bs=1M count=4096

Next, copy the Windows XP install CD in to an iso format

dd if=/dev/cdrom of=/home/xen/cds/winxp.iso

Then, build a winxp config file in /etc/xen as the following. eg:

vi /etc/xen/winxp
kernel = "hvmloader"
builder='hvm'
memory = 512
name = "winxp"
vif = [ 'type=ioemu, bridge=xenbr0' ]
disk = [ 'file:/home/xen/images/WinXP.img,ioemu:hda,w',
'file:/home/xen/cds/winxp.iso,hdc:cdrom,r' ]
#cdrom = '/dev/hda'
device_model = 'qemu-dm'
boot="dc"
sdl=1
vnc=0
nographic=0
localtime=1

Run

xm create winxp -c

to boot up the VM and install XP.

After finished installing the XP, turn off the VM and

change the

boot="dc"

to

boot="c"

in

/etc/xen/winxp

xen1xen2xen3
xen4xen5

How to generate a self-signed certificate for apache2 in Debian

The source is now on Github: https://github.com/wanleung/self-signed-certificate-generator

While the Debian apache2 package was in Apache version 2.0, there was a tool called “apache2-ssl-certificate” for the users to use that script to gererate their own self-signed cert themselves. However, the script was removed since the apache2 package had been upgraded to Apache v2.2.

I had modified the old script so that it can generate a suitable self-signed cert for the new apache2(Apache v2.2) in Debain.

Here is the code:

 #!/bin/sh -e DAYS="365" CERTPATH="/etc/apache2/ssl" CERTNAME="apache" KEYBIT="1024" FORCE="0"; usage(){ echo "This is a program for the users to gernate their own self-signed certificate." echo echo "Usage: $0 [[OPTION] [VALUE]]..." echo echo "OPTIONS:" echo " -h | -help | --help -- To Show This Help" echo " -f | --force -- Force to generate the cert" echo " -d | -days | --days -- cert to expire after x days, default is 365" echo " -p | -path | --path -- Path of the cert will be stored," echo " default is /etc/apache/ssl" echo " -n | -name | --name -- the name of the cert, default is apache" echo " -b | -bit | --bit -- length of the key, default is 1024" echo } createcert() { if [ "$FORCE" != "1" -a -f $CERTPATH/$CERTNAME.pem ]; then echo "$CERTPATH/$CERTNAME.pem exists! Use \"$0 --force.\"" exit 0 fi echo echo creating selfsigned certificate echo "replace it with one signed by a certification authority (CA)" echo echo enter your ServerName at the Common Name prompt echo echo If you want your certificate to expire after x days call this programm echo with "--days x" mkdir -p "$CERTPATH/" export RANDFILE=/dev/random openssl req [email protected] -new -x509 -days $DAYS -nodes -newkey rsa:$KEYBIT -out $CERTPATH/$CERTNAME.pem -keyout $CERTPATH/$CERTNAME.pem chmod 600 $CERTPATH/$CERTNAME.pem } case $1 in -h|help|--help) usage exit 0 ;; esac until [ -z "$1" ] # Until all parameters used up . . . do case $1 in --force|-f|-force) FORCE="1" shift ;; --days|-d|-days) DAYS=$2 shift shift ;; --path|-p|-path) CERTPATH=$2 shift shift ;; --name|-n|-name) CERTNAME=$2 shift shift ;; --bit|-n|-bit) KEYBIT=$2 shift shift ;; *) usage exit 0 ;; esac done createcert

Here is the file.
apache2-ssl-certificate.tar.gz

MD5SUM: 6fb69eb0d63a683e73461f4f682e13e5

You could get the project from github.

The source is now on Github: https://github.com/wanleung/self-signed-certificate-generator

Debian 香港聚會

為慶祝DEBIAN 4.0 released,Debian HK今日下午3時在又一城辦了一個聚會,

本人今日有幸能抽空出席。在聚會中,認識了不少LINUX的愛好者,

大家彼此交流了不少LINUX的經驗和知識, 是一個很好的聚會。

上邪

漢樂府 上邪

上邪,

我欲與君相知.長命無絕衰.

山無陵,江水為竭,

冬雷震震夏雨雪,

天地合,乃敢與君絕.

Debian GNU/Linux 4.0 released

Debian Etch finally released on 8th April, 2007.
Here is the notice from [email protected]

Debian GNU/Linux 4.0 released

The Debian Project is pleased to announce the official release of Debian
GNU/Linux version 4.0, codenamed "etch", after 21 months of constant
development.  Debian GNU/Linux is a free operating system which supports
a total of eleven processor architectures and includes the KDE, GNOME
and Xfce desktop environments.  It also features cryptographic software
and compatibility with the FHS v2.3 and software developed for version
3.1 of the LSB.

Using a now fully integrated installation process, Debian GNU/Linux 4.0
comes with out-of-the-box support for encrypted partitions.  This
release introduces a newly developed graphical frontend to the
installation system supporting scripts using composed characters and
complex languages; the installation system for Debian GNU/Linux has now
been translated to 58 languages.

Also beginning with Debian GNU/Linux 4.0, the package management system
has been improved regarding security and efficiency.  Secure APT allows
the verification of the integrity of packages downloaded from a mirror.
Updated package indices won't be downloaded in their entirety, but
instead patched with smaller files containing only differences from
earlier versions.

Debian GNU/Linux runs on computers ranging from palmtops and handheld
systems to supercomputers, and on nearly everything in between.  A total
of eleven architectures are supported including:  Sun SPARC (sparc), HP
Alpha (alpha), Motorola/IBM PowerPC (powerpc), Intel IA-32 (i386) and
IA-64 (ia64), HP PA-RISC (hppa), MIPS (mips, mipsel), ARM (arm), IBM
S/390 (s390) and -- newly introduced with Debian GNU/Linux 4.0 -- AMD64
and Intel EM64T (amd64).

Debian GNU/Linux can be installed from various installation media such
as DVDs, CDs, USB sticks and floppies, or from the network.  GNOME is
the default desktop environment and is contained on the first CD.  The K
Desktop Environment (KDE) and the Xfce desktop can be installed through
two new alternative CD images.  Also newly available with Debian
GNU/Linux 4.0 are multi-arch CDs and DVDs supporting installation of
multiple architectures from a single disc.

Debian GNU/Linux can be downloaded right now via bittorent (the
recommended way), jigdo or HTTP;  see <http://www.debian.org/CD/> for
further information.  It will soon be available on DVD and CD-ROM from
numerous vendors <http://www.debian.org/CD/vendors/>, too.

This release includes a number of updated software packages, such as the
K Desktop Environment 3.5 (KDE), an updated version of the GNOME desktop
environment 2.14, the Xfce 4.4 desktop environment, the GNUstep desktop
5.2, X.Org 7.1, OpenOffice.org 2.0.4a, GIMP 2.2.13, Iceweasel (an
unbranded version of Mozilla Firefox 2.0.0.3), Icedove (an unbranded
version of Mozilla Thunderbird 1.5), Iceape (an unbranded version of
Mozilla Seamonkey 1.0.8), PostgreSQL 8.1.8, MySQL 5.0.32, GNU Compiler
Collection 4.1.1, Linux kernel version 2.6.18, Apache 2.2.3, Samba
3.0.24, Python 2.4.4 and 2.5, Perl 5.8.8, PHP 4.4.4 and 5.2.0, Asterisk
1.2.13, and more than 18,000 other ready to use software packages.

Upgrades to Debian GNU/Linux 4.0 from the previous release, Debian
GNU/Linux 3.1 codenamed "sarge", are automatically handled by the
aptitude package management tool for most configurations, and to a
certain degree also by the apt-get package management tool.  As always,
Debian GNU/Linux systems can be upgraded quite painlessly, in place,
without any forced downtime, but it is strongly recommended to read the
release notes for possible issues.  For detailed instructions about
installing and upgrading Debian GNU/Linux, please see the release notes
<http://www.debian.org/releases/etch/releasenotes>.  Please note that
the release notes will be further improved and translated to additional
languages in the coming weeks.

About Debian
------------

Debian GNU/Linux is a free operating system, developed by more than
a thousand volunteers from all over the world who collaborate via the
Internet.  Debian's dedication to Free Software, its non-profit nature,
and its open development model make it unique among GNU/Linux
distributions.

The Debian project's key strengths are its volunteer base, its dedication
to the Debian Social Contract, and its commitment to provide the best
operating system possible.  Debian 4.0 is another important step in that
direction.

Contact Information
-------------------

For further information, please visit the Debian web pages at
<http://www.debian.org/> or send mail to <[email protected]>.