Thursday, January 29, 2009

shrink vmware disk file by cloning harddisk

Ref:
shrink disk:
http://kegel.com/linux/jeos-vmware-player/jeos-vmware-player-howto.html
install grub:
http://ubuntuforums.org/showpost.php?p=117829&postcount=2

In summary:
1. install everything on VM1. Then remove unnecessary files.
2. add a second virtual disk.
3. boot from a liveCD,such as Ubuntu desktop 8.0.4
4. partition the second hard disk and copy files to it. (/mnt is the second hard disk)
fdisk /dev/sda (and type 'p' to print the partition table)
fdisk /dev/sdb (and use the n, t, and w commands to recreate the same table)
mkfs.ext3 /dev/sdb1
mount /dev/sdb1 /mnt
cd / (target)
ls egrep -v 'procsyslost.found' > /files.txt
cp -a `cat /files.txt` /mnt
5. Install grub (mbr) to be bootable:
1) Type "grub" in a console
2) Type "root (hd1,0)", or whatever your harddisk + boot partition numbers are (my /boot is at /dev/sdb1, which translates to hd1,0 for grub).
3) Type "setup (hd1)", or whatever your harddisk No. is.
4) Quit grub by typing "quit".
6. shutdown VM. remove the first hard disk.
7. boot.

Tuesday, January 27, 2009

debug Xen

1. debug dom0 and dom u
http://lists.xensource.com/archives/html/xen-devel/2008-10/msg00195.html

2. build option :

Xen provides a number of build-time options which should be set as environment variables or passed on make's command-line.

verbose=y
Enable debugging messages when Xen detects an unexpected condition. Also enables console output from all domains.
debug=y
Enable debug assertions. Implies verbose=y. (Primarily useful for tracing bugs in Xen).
debugger=y
Enable the in-Xen debugger. This can be used to debug Xen, guest OSes, and applications.
perfc=y
Enable performance counters for significant events within Xen. The counts can be reset or displayed on Xen's console via console control keys.
3. use serial cable
http://en.opensuse.org/How_to_Capture_Xen_Hypervisor_and_Kernel_Messages_using_a_Serial_Cable

4. KDB
http://lists.xensource.com/archives/html/xen-devel/2008-11/msg00165.html

qemu usage

1. qemu-img create -f qcow2 win.qcow 4G
2. qemu -boot d -cdrom /dev/cdrom -hda win.qcow

http://www.debian-administration.org/articles/40
http://wiki.archlinux.org/index.php/Qemu

Tuesday, January 20, 2009

Install Flash player on Ubuntu 8.04 server

1. apt-get install libcurl3
2. download xx-flash.deb from adobe website.
3. dpkg -i xx-flash.deb (if not installed libcurl3, this cmd will show the error).

done