Friday, November 13, 2009

VirtualBox










VirtualBox on OpenSuse 11.1

i have windows 7 running as guest using KVM in my opensuse, but i don't like the SVGA emulation.

So i try virtualbox, and i convert the qemu image to vmware image and use it in VirtualBox , but it failed.

opensuse:/kvm-disk # qemu-img convert -O vmdk hp-win7.img hp-win7.vmdk

So i configure a new vdi image for my windows 7 guest and start my vm, but i got an error, and the error advise me to run this:

opensuse:/kvm-disk # /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module done
Recompiling VirtualBox kernel module failed
(Look at /var/log/vbox-install.log to find out what went wrong)

opensuse:/kvm-disk # more /var/log/vbox-install.log
Makefile:174: *** Error: unable to find the include directory for your current L
inux kernel. Specify KERN_INCL= and run Make again. Stop.

opensuse:/kvm-disk # ls -la /dev/vboxdrv
ls: cannot access /dev/vboxdrv: No such file or directory

opensuse:/kvm-disk # uname -a
Linux opensuse 2.6.27.7-9-pae #1 SMP 2008-12-04 18:10:04 +0100 i686 i686 i386 GNU/Linux

so i install the kernel source for 2.6.27-9.1 using Yast although 2.6.27.37 is available...


opensuse:/kvm-disk # /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module done
Recompiling VirtualBox kernel module done
Starting VirtualBox kernel module done
opensuse:/kvm-disk #


seems to work...








Cloning a virtualbox VM

you install virtualbox, and install , say windows 2008, as a guest. then u realise you need to install another windows 2008 guest. do u need to install again? No. u can clone the first one. And there is no need to run NewSID on the cloned vm, yes, it is true, read it here http://blogs.technet.com/markrussinovich/archive/2009/11/03/3291024.aspx.

here is how i did it:



C:\Users\chan\.VirtualBox\HardDisks>"C:\Program Files\Sun\VirtualBox\vboxman
age" clonehd old.vdi new.vdi
VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: 1dfaa26a-2761-4ee4-9cd6-24642f3c8
53e

C:\Users\chan\.VirtualBox\HardDisks>





















Wednesday, November 11, 2009

KVM

KVM - kernel virtual machine

kvm uses QEMU for device emulation. So your guest will only see a VGA graphics card. Don't expect good performance here. I increase the resolution to 1024 and i could get a larger screen, but it will be better when qemu emulate some better graphicscard. Xen-HVM uses QEMU for emulation too. I tried -vga vmware in kvm-qemu, but it is worse than no specifying anything (i.e. using the default).


I run a vncserver (RealVNC) in my Windows 7 guest and connect to it from my Linux host using vncviewer, the performance sucks!! it is slow. So there is no need to use vnc to connect to your guest. But I tried Microsoft remote desktop , mstsc.exe, to connect to my Windows 2008 server guests, the results is great. You won't know you are on a VM.

Qemu allows your guests to use the usb port too.

Monday, November 2, 2009

bridge - linux

http://www.linuxfoundation.org/en/Net:Bridge


qemu

http://qemu-buch.de/cgi-bin/moin.cgi/QemuAndTuntap

Friday, October 23, 2009

hacking

origami is a Ruby framework designed to parse, analyze, edit, manipulate, forge, exploit PDF files. This is NOT a PDF rendering library. It aims at providing a scripting tool to generate and/or analyz...

http://packetstorm.linuxsecurity.com/UNIX/utilities/origami-1.0.0-beta1.tar.gz


Friday, October 9, 2009

printing from opensuse to fuji xerox ApeosPort 450I

opensuse 11.1 detects all the nework printers automatically. impressive!

but there is no driver for this printer and i could not find the ppd file for it. ppd - PostScript Printer Description


i use Xerox DocuPrint 4508 Foomatic/lj4dith, and it works!!!!

i managed to print out a beautiful test page... which says Printed Using CUPS v1.3

www.cups.org


btw i use "windows printer via samba" smb://domain-name/servername/printername

and key in your windows domain id and password.

it works!!

Thursday, October 8, 2009

iso

all about ISO


mount an iso file to a folder

mount -t iso9660 -o loop /home/fs/cd101.iso /mnt

If this don't work...

First of all, you'll have to check whether certain options are included in your kernel. If you're using a standard kernel from one of the major distributions, it's pretty likely that everything necessary is already included so you might want to skip this step. If you have a self-compiled kernel - and I recommend everyone to compile the kernel oneself - you'll have to enable the following options in your kernel:

in Device Drivers > Block Devices
Loopback device support

in File Systems > CD-ROM/DVD Filesystems
ISO 9660 CDROM file system support
[*] Microsoft Joliet CDROM extensions
[*] Transparent decompression extension

http://steinsoft.net/index.php?site=Programming/Articles/linux-mountiso

Monday, October 5, 2009

kvm with opensuse

using kvm on opensuse 11.1 is easy.

http://www.linux-kvm.org/page/HOWTO


my hardware: hp elitebook 6930p

install opensuse 11.1

boot cd with acpi=off

don't use auto configuration during the install process

i disable auto login too and did an internet update and it is so slow... mainly i guess due to my bb connection.. it keep breaking..

so u can skip internet update

to install KVM follow this:

http://en.opensuse.org/KVM


I installed windows 2008 server using a 10gb image file.

create image file
qemu-img create -f qcow2 disk.img 10G

How do I use dd command to create an ISO image?

Put CD into CDROM

Do not mount CD. Verify if cd is mounted or not with mount command:

# mount

If cd was mouted automatically unmout it with umount command:

# umount /dev/cdrom

OR

# umount /mnt/cdrom

Create CD-ROM ISO image with dd command:

# dd if=/dev/cdrom of=/tmp/cdimg1.iso

Where,

  • if=/dev/cdrom: Read from /dev/cdrom (raw format)
  • of=/tmp/cdimg1.iso: write to FILE cdimg1.iso i.e. create an ISO image
src: http://www.cyberciti.biz/tips/linux-creating-cd-rom-iso-image.html


boot the guest from a iso file

qemu-kvm -m 256 -hda disk.img -cdrom winxpsp2.iso -boot d
-boot d instruct qemu to boot from cdrom

what nic are supported?

qemu-kvm -hda vista1.img -net nic,model=?,macaddr=00:16:3e:23:38:45 -net user -cdrom BootMedia.iso -boot d &


opensuse:/kvm-disk # qemu: Supported ISA NICs: ne2k_isa
qemu: Supported PCI NICs: i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio


i82557b is supported by my vista

Insert KVM Modules

Insert the kvm modules as follows (as root)

For Intel processors

opensuse11:~ # modprobe kvm
opensuse11:~ # modprobe kvm-intel

For AMD processors

opensuse11:~ # modprobe kvm
opensuse11:~ # modprobe kvm-amd

To confirm the modules OK,

opensuse11:~ # lsmod | grep kvm
kvm_intel 67824 0
kvm 182936 1 kvm_intel

However, this setting lost on a reboot.

To insert this module at boot time, Click Computer – YaST – System – “/etc/sysconfig editor”. This launches the sysconfig editor.

Click “+” next to “system” and then “+” next to Kernel. Click “MODULES_LOADED_ON_BOOT“, in the right-pane, enter “kvm kvm-intel kqemu” without quotes (”kvm kvm-amd kqemu” for AMD) in the setting box and click finish. Click OK on the confirmation window.

Now, we are all set to configure and run a guest OS on your openSUSE.



Installation of Windows guest paravirtual network drivers

opensuse:/kvm-disk # qemu-kvm -hda AD.img -cdrom /home/fs/Desktop/NETKVM-20081229.iso -net nic,model=virtio
Warning: vlan 0 is not connected to host network

AD.img is the image file where i had installed a windows 2008 to function as the Domain Controller

-cdrom /home/fs/Desktop/NETKVM-20081229.iso

The iso file contained the paravirtualized network drivers that i downloaded; when the Windows 2008 boot up, the cdrom drive will behave as if there is a CD containing the drivers needed for installation.



install tap network interface

install openvpn

create 4 tap - tap0 - 3

opensuse:/etc # openvpn --mktun --dev tap0
Mon Oct 5 23:33:23 2009 TUN/TAP device tap0 opened
Mon Oct 5 23:33:23 2009 Persist state set to: ON
opensuse:/etc # openvpn --mktun --dev tap1
Mon Oct 5 23:43:39 2009 TUN/TAP device tap1 opened
Mon Oct 5 23:43:39 2009 Persist state set to: ON
opensuse:/etc # openvpn --mktun --dev tap2
Mon Oct 5 23:43:42 2009 TUN/TAP device tap2 opened
Mon Oct 5 23:43:42 2009 Persist state set to: ON
opensuse:/etc # openvpn --mktun --dev tap3
Mon Oct 5 23:43:46 2009 TUN/TAP device tap3 opened
Mon Oct 5 23:43:46 2009 Persist state set to: ON
opensuse:/etc #

ifconfig tap0 up

brigde network
opensuse:/etc # brctl addbr br0
opensuse:/etc # brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no

opensuse:/etc # brctl addif br0 eth0
opensuse:/etc # brctl addif br0 tap0
opensuse:/etc # brctl addif br0 tap1
opensuse:/etc #

opensuse:/etc # brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0025b32ead04 no eth0
tap0
tap1
opensuse:/etc #


opensuse:/etc # vi /etc/sysconfig/network/scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes

opensuse:/etc # vi /etc/sysconfig/network/scripts/ifcfg-eth0
DEVICE=eth0
BRIDGE=br0
BOOTPROTO=dhcp
HWADDR=00:19:b9:7e:c8:63
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NM_CONTROLLED=no


opensuse:/etc # vi /etc/sysconfig/network/scripts/qemu-ifup
#!/bin/sh
switch=$(/sbin/ip route list | awk '/^default / { print $NF }')
/sbin/ifconfig $1 0.0.0.0 up
/usr/sbin/brctl addif ${switch} $1


opensuse:/etc/sysconfig/network/scripts # chmod o+x qemu-ifup
opensuse:/etc/sysconfig/network/scripts # chmod o+x ifcfg-br0
opensuse:/etc/sysconfig/network/scripts # chmod o+x ifcfg-eth0



opensuse:/etc # /etc/rc.d/network restart
Shutting down the NetworkManager done
Shutting down network interfaces:
br0
No configuration found for br0
Nevertheless the interface will be shut down. done
eth0 device: Intel Corporation 82567LM Gigabit Network Connection (rev 03) done
tap0
No configuration found for tap0
Nevertheless the interface will be shut down.
could not find configuration file ifcfg-tap0
tap0 tunctl not available -- install tunctl or uml-utilitiesdone
tap1
No configuration found for tap1
Nevertheless the interface will be shut down.
could not find configuration file ifcfg-tap1
tap1 tunctl not available -- install tunctl or uml-utilitiesdone
tap2
No configuration found for tap2
Nevertheless the interface will be shut down.
could not find configuration file ifcfg-tap2
tap2 tunctl not available -- install tunctl or uml-utilitiesdone
tap3
No configuration found for tap3
Nevertheless the interface will be shut down.
could not find configuration file ifcfg-tap3
tap3 tunctl not available -- install tunctl or uml-utilitiesdone
wlan0 device: Intel Corporation Wireless WiFi Link 5100 done
Shutting down service network . . . . . . . . . done
Starting the NetworkManager done
opensuse:/etc #


http://www.linux-kvm.com/content/tip-how-get-maximum-network-performance-using-paravirtual-drivers-and-bridged-networking

adding tap devices using YaST

u must disable network manager from managing the network and use if-up, if-down...

persistent tunnel

no tunnel group , no tunnel owner

must install tunctl package

for me, i need to add my proxy server in YaST control centre->network services->proxy

opensuse:/kvm-disk # ifup br0
br0
br0 Ports: [eth0] [tap0] [tap1] [tap2] [tap3]
br0 forwarddelay (see man ifcfg-bridge) ... ready
Starting DHCP4 client on br0.
br0 IP address: 192.168.0.248/24
opensuse:/kvm-disk # ifconfig
br0 Link encap:Ethernet HWaddr 00:25:B3:2E:AD:04
inet addr:192.168.0.248 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:367 errors:0 dropped:0 overruns:0 frame:0
TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:77192 (75.3 Kb) TX bytes:20045 (19.5 Kb)

eth0 Link encap:Ethernet HWaddr 00:25:B3:2E:AD:04
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26093 errors:0 dropped:0 overruns:0 frame:0
TX packets:10256 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:19994866 (19.0 Mb) TX bytes:1176611 (1.1 Mb)
Memory:90400000-90420000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:172 errors:0 dropped:0 overruns:0 frame:0
TX packets:172 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14060 (13.7 Kb) TX bytes:14060 (13.7 Kb)

tap0 Link encap:Ethernet HWaddr C2:14:C7:5D:74:40
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:401 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap1 Link encap:Ethernet HWaddr 32:54:9D:9C:03:88
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:401 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap2 Link encap:Ethernet HWaddr 3E:11:FD:E3:87:A8
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:401 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap3 Link encap:Ethernet HWaddr F6:6B:17:54:E3:4D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:401 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

wlan0 Link encap:Ethernet HWaddr 00:21:6A:3B:EF:06
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2034 (1.9 Kb) TX bytes:5060 (4.9 Kb)

wmaster0 Link encap:UNSPEC HWaddr 00-21-6A-3B-EF-06-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

opensuse:/kvm-disk #


opensuse:/kvm-disk # qemu-kvm -hda AD.img -net nic,model=virtio,macaddr=00:11:22:33:44:55:00 -net tap invalid syntax for ethernet address

opensuse:/kvm-disk # qemu-kvm -hda AD.img -net nic,model=virtio,macaddr=00:11:22:33:44:55:00 -net tap
invalid syntax for ethernet address

opensuse:/kvm-disk # qemu-kvm -hda AD.img -net nic,model=virtio,macaddr=00:16:3e:23:38:43 -net tap
/etc/qemu-ifup: could not launch network script
Could not initialize device 'tap'

opensuse:/kvm-disk # qemu-kvm -hda AD.img -net nic,model=virtio,macaddr=00:16:3e:23:38:43 -net tap0 Unknown network device: tap0

opensuse:/kvm-disk # qemu-kvm -hda AD.img -net nic,model=virtio,macaddr=00:16:3e:23:38:43 -net tap,script=/etc/sysconfig/network/scripts/qemu-ifup
/etc/sysconfig/network/scripts/qemu-ifup: line 4: /usr/sbin/brctl: No such file or directory
/etc/sysconfig/network/scripts/qemu-ifup: could not launch network script
Could not initialize device 'tap'

opensuse:/kvm-disk # which brctl
/sbin/brctl


opensuse:/kvm-disk # vi /etc/sysconfig/network/scripts/qemu-ifup

opensuse:/kvm-disk # qemu-kvm -hda AD.img -net nic,model=virtio,macaddr=00:16:3e:23:38:43 -net tap,script=/etc/sysconfig/network/scripts/qemu-ifup

i use static ip within the Windows 2008 guest.


qemu-kvm and qemu-***

from http://wiki.archlinux.org/index.php/QEMU:
For versions of QEMU prior to 0.10.2-1 use the qemu-kvm executable. For 0.10.2-1 and later, use qemu --enable-kvm.

my qemu is

opensuse:/kvm-disk # qemu|grep version
QEMU PC emulator version 0.9.1, Copyright (c) 2003-2008 Fabrice Bellard


Windows Guest Drivers
network drivers - NetKVM - http://people.redhat.com/~yvugenfi/24.09.2009/NetKVM.zip
Storage drivers - viostor - http://people.redhat.com/~yvugenfi/24.09.2009/viostor.zip

http://www.linux-kvm.com/content/latest-release-windows-virtio-network-drivers
http://www.linux-kvm.com/content/upgrading-windows-paravirtual-network-drivers
http://www.linux-kvm.com/content/tip-how-setup-windows-guest-paravirtual-network-drivers



http://www.linux-kvm.com/content/using-windows-installer-paravirtual-network-drivers

change cdrom in QEMU

ctr - alt - 2 to go to console (lef control - left alternate and 1 )
type info block to view device status
type change ide1-cd0 /path/soemthing.iso OR change ide1-cd0 /dev/cdrom
info block



to go back , control - alternate - 1


Ref
http://qemu-buch.de/cgi-bin/moin.cgi/QemuAndTuntap


http://www.susegeek.com/virtualization/howto-install-configure-kvm-virtualization-run-guest-oses-in-opensuse/

http://qemu-buch.de/cgi-bin/moin.cgi/QemuAndTuntap

Saturday, October 3, 2009

fonts

http://www.microsoft.com/typography/default.mspx

embedding fonts

http://www.netmechanic.com/news/vol3/css_no15.htm

http://www.morovia.com/font/support/embed-font-web.asp

Monday, September 21, 2009

windows server 2008 - different versions

go here http://www.microsoft.com/windowsserver2008/en/us/r2-editions-overview.aspx to find the differences between the different versions...


to run certificate services, u will need the Enterprise version...

if you run it under XenServer, you will be forced to use a harddisk image of 24GB, even though the XenServer manual state that 10GB is the minimum for server 2008.

Sunday, September 20, 2009

xen live cd - adding windows guests

download xen live cd image and burn it to a cd and boot the cd in your computer

it took ten min to boot in my case.

i have a 160 GB harddisk, with one 1GB NetBSD partition; the rest are not partitioned.

i want to install windows on Xen.

add a partition
after you have boot the Xen live CD, cretate a partition by running fdisk.

fdisk /dev/sda (sd means SCSI but i am sure my harddisk is not SCSI)

n
p

i added a primary parition of 50GB

create a filesystem for the partition
mkfs -t ext3 /dev/sda2

mount it
mount /dev/sda2 /mnt

to be continued....

Saturday, September 19, 2009

netbsd

managed to install netbsd on my hp laptop EliteBok 6930p.

sometimes this laptop gives problem with ACPI.

netbsd will boot normal with ACPI enabled.. and the timeout is very fast... not enough for u to select to boot "boot netbsd -2" to disable ACPI

so what u can do here is :

edit /boot.cfg

and consult http://netbsd.gw.com/cgi-bin/man-cgi?boot.cfg++NetBSD-current the web man page on the boot.cfg

for me, i have to change default=1 to default=3

Xen using netbsd

need to install multiple Window servers on my laptop for some testing... one domain controller, one offering certificate service (pki), one as file server, and one Vista as client...


i can't imagine using type 1 hypervisor for this task... i only have 2G RAM on my laptop.. so virtualbox and vmware server is out..

i am left with Xen and VMware ESX Server , but the latest ESX server only runs on 64bit hardware and it don't support intel cpu with emt64 extension... while at least this is what i found, i maybe wrong as i don't have much time ...

so i move on to using Xen... either ubuntu and debian... ubuntu does not offer dom0 kernel now and i saw many criticism on running Xen with Ubuntu..

i did tried it out but it is some troublesome and time is running short

so i went to debian... but debian didn't install on my HP EliteBook... oh ...

i will try netbsd now... i always prefer *bsd more...

Saturday, September 12, 2009

Xen

Ganeti
Ganeti is a cluster virtual server management software tool built on top of existing virtualization technologies such as
Xen or KVM and other Open Source software.
http://code.google.com/p/ganeti/


http://www.serverwatch.com/news/article.php/3770221/Hypervisor-Face-Off-KVM-vs-Xen-vs-VMware.htm

"KVM benchmarking is extremely selective," Crosby commented. "Where it does benefit in performance, it does so by sacrificing what we view as fundamental security concerns for enterprise virtualization deployments. Xen's deep separation of trust domains costs a bit in performance but provides the hard-line separation required for any secure deployment of virtualization."


Bruce also noted KVM relies on strong CPU performance with very limited support for para-virtualization. As such, Bruce argued it is difficult to achieve top performance in a KVM virtualized environment without powerful hardware underneath. Conversely, in his view, Xen offers strong support for para-virtualization for modified Windows guests and modified Linux guests to achieve near-native performance.


http://virt.kernelnewbies.org/TechComparison - features and performance of the various virtualization technologies available for Linux


Diff between para virtualization and hardware assisted virtualization


To run OS unmodified on Xen , u need a cpu that support hardware virtualization. You need to use HVM in Xen to run Windows.

http://www.virtuatopia.com/index.php/An_Overview_of_Virtualization_Techniques

xen live cd

http://wiki.xensource.com/xenwiki/LiveCD
Xenoppix http://unit.aist.go.jp/itri/knoppix/xen/index-en.html

installing Windows on Xen
http://www.virtuatopia.com/index.php/Virtualizing_Windows_Server_2008_with_Xen
http://mediakey.dk/~cc/howto-install-windows-xp-vista-on-xen/

wifi
http://wiki.xensource.com/xenwiki/XenWifi - sharing a wireless nic between dom0 and domU.

You might need http://ebtables.sourceforge.net/ if your wireless NIC does not allow packets with a MAC that is different from its own.




Xen setup docs that i found:

http://www.virtuatopia.com/index.php/Xen_Virtualization_Essentials

Xen on OpenSuse
http://en.opensuse.org/Installing_Xen3

Xen on Debian 5
http://www.howtoforge.com/virtualization-with-xen-on-debian-lenny-amd64

xen tools http://www.debian-administration.org/articles/533

http://wiki.xensource.com/xenwiki/HowTos
http://www.howtoforge.com/perfect_setup_xen3_debian
http://www.packtpub.com/files/Xen-Virtualisation-Sample-Chapter-Chapter-2-Running-Xen.pdf
http://www.howtoforge.com/xen_gui_fedora_7_desktop

Saturday, September 5, 2009

How to Add JARs to Project Build Paths in Eclipse (Java)

see http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-%28Java%29

Friday, September 4, 2009

Google App Engine

Deploying app engine to your own domain

http://code.google.com/appengine/articles/domains.html

basically you need to use Google Apps to manage your domains and point it to your App Engine application.

i have to wait for 15 minutes before my domain points to my app engine.

i register my domain with godaddy through google, and the cname records are added automatically when you add them in Google Apps.




Using Google Account to authenticate users

making use of Google Account has the advantage of offloading the user authentication to Google. You are left with more time to develop your web application.

There are several ways to force users to authenticate.

servlet

http://code.google.com/appengine/docs/java/users/overview.html go to "Using Google Accounts in Java" section


web.xml

please see http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication


jsp

http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/users/package-summary.html

Package com.google.appengine.api.users
The UserService provides facilities to check whether a user has authenticated using their Google Account, retrieve their email address, and check whether they are an administrator for this application.

See:
Description

Interface Summary
UserService The UserService provides information useful for forcing a user to log in or out, and retrieving information about the user who is currently logged-in.


Class Summary
User User represents a specific user, represented by the combination of an email address and a specific Google Apps domain (which we call an authDomain).
UserServiceFactory Creates a UserService.


Exception Summary
UserServiceFailureException UserServiceFailureException is thrown when any unknown error occurs while communicating with the user service.


Package com.google.appengine.api.users Description

The UserService provides facilities to check whether a user has authenticated using their Google Account, retrieve their email address, and check whether they are an administrator for this application. It can also be used to construct a URL for users to login or logout. More information is available in the on-line documentation.

As an example, your application might, in a JSP file, have code like this:

<%
UserService userService = UserServiceFactory.getUserService();
if (!userService.isUserLoggedIn()) {
%>
Please %>">log in>
<% } else { %>
Welcome, <%= userService.currentUser().getNickname(); %>!
( %>">log out>)
<%
}
%>

Tuesday, September 1, 2009

about master boot record - mbr

just got a task that involves mbr, so i manage to find some good links on mbr...


Assembly code on how to read boot sector
http://bootmaster.filerecovery.biz/appnote4.html

backing up mbr using the dd command, but only for Unix*
http://www.freesoftwaremagazine.com/columns/backing_up_your_master_boot_record
dd if=/dev/hda of=/home/richmondg/mbr_backup bs=512 count=1

dd if=/dev/sda of=mbr.bin bs=512 count=1

http://www.ntfs.com/mbr.htm say the mbr is always at track (cylinder) 0, side (head) 0, and sector 1.

Wednesday, August 19, 2009

NAT mode and port forwarding

I am runnig Debian as guest in my VirtualBox in Windows and i want to ssh to Debian.

How ?

run debian in NAT mode and do port forwarding

go to C:\Program Files\Sun\xVM VirtualBox and run


VBoxManage setextradata "debian 5 Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "debian 5 Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "debian 5 Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 22

restart your guest

run the below to see what u have done:
VBoxManage getextradata "debian 5 Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol"
VBoxManage getextradata "debian 5 Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort"
VBoxManage getextradata "debian 5 Lenny" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort"

The info is actually stored in C:\Users\who am i\.VirtualBox\Machines\debian 5 Lenny\debian 5 Lenny.xml

here is part of the xml file:



name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" value="22"/>

name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" value="22"/>




debian 5 Lenny is the name of your guest, it is case sensitive.


from the Help:

The above example assumes a PCNet virtual network card; if you have configured the guest to use the Intel PRO/1000, replace

"pcnet" with "e1000" in the above commands. Similarly, if you want to configure a different interface instance replace the /0/

with the appropriate index. pcnet and e1000 are counted separately in this respect, and counting starts at 0 for both types.

The name guestssh is an arbitrary one chosen for this particular forwarding configuration. With that configuration in place, all

TCP connections to port 2222 on the host will be forwarded to port 22 on the guest. Protocol can be either of TCP or UDP (these

are case insensitive). To remove a mapping again, use the same commands, but leaving out the values (in this case TCP, 22 and

2222).

It is not possible to configure incoming NAT connections while the VM is running. However you can change the settings for a VM

which is currently saved (or powered off at a snapshot).


remember u need to restart your guest...


from windows: ssh to 127.0.0.1:22

Monday, August 17, 2009

hacking cisco network

Polyphemus - Polyphemus is an SNMP-based explorer and visualizer of OSPF networks

http://www.dia.uniroma3.it/~compunet/www/view/tool.php?id=polyphemus

using aptitude on Debian 5 (Lenny)

To me, using Linux is always difficult, having get used to FreeBSD...

I just don't undertstand why all those man pages could not be written with more examples...

anyway, i installed Debian 5 and wanted to install IPRAS.

aptitude could not find the package, but a search on google shows that the package exists..

http://packages.debian.org/lenny/irpas

This page advise adding "deb http://ftp.de.debian.org/debian lenny main non-free
" to /etc/apt/sources.list

but I think they miss out something.

This is what I added in my /etc/apt/sources.list :

deb http://ftp.de.debian.org/debian lenny main non-free
deb-src http://ftp.de.debian.org/debian lenny main non-free

I run "aptitude install ipras" and again it complained package not found

more googling for aptitude tutorial and found this

http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch01s01s05.html

so i must run aptitude and type u to do an update.

after the update, "aptitude install ipras" runs and ipras was installed!!!

Monday, July 27, 2009

Singtel Broadband on mobile with Ubuntu

It is easy.

Just plug in the modem and Ubuntu will ask you to choose your provider from among M1, Singtel and StarHub...

then edit /etc/network/interfaces and add these lines

auto wlan0
iface wlan0 inet dhcp

and click on the network icon on the top right, and select SingTel and you are done!



my setup:


root@fs-laptop:~# uname -a
Linux fs-laptop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

Friday, July 17, 2009

installing linux from usb

UNetbootin allows you to create bootable Live USB drives for a variety of Linux distributions from Windows or Linux, without requiring you to burn a CD. You can either let it download one of the many distributions supported out-of-the-box for you, or supply your own Linux .iso file if you've already downloaded one or your preferred distribution isn't on the list.


See


also

fook sheng

Wednesday, July 8, 2009

solution for using SSL on virtual host - SNI

http://en.wikipedia.org/wiki/Server_Name_Indication

Google may support it i their App Engine... I am looking forward to it...

Friday, June 19, 2009

bridge network in virtualbox with tap-win32

This is a follow up on my previous blog at http://fooksheng.blogspot.com/2009/06/using-bridge-networking-on-virtualbox.html

In case you need a network interface that is always up, not like your Ethernet card on Windows that depends on whether a cable is plugged in or your wireless network interface, which you might sometimes switch it off.

Thanks to tap-win 32, this can be achieved easily.

1) Install tap-win 32, see http://colinux.wikia.com/wiki/TAP-Win32_Adapter_V8_(coLinux)

2) Go to the Properties of the Tap-win 32 network interface, then click on the Configure button and then click the Advance tab, change the Media Status to Always Connected.




3) Now the network interface is always connected, and you can follow the steps in http://fooksheng.blogspot.com/2009/06/using-bridge-networking-on-virtualbox.html to configure your bridge network.

Tuesday, June 9, 2009

using bridge networking on VirtualBox

I wanted to run Ubuntu as a guest on my Windows and I need to access ubuntu's web server (LAMP) from my Windows...

NAT does not work, and surprisingly Host-only mode does not either... i don't know why.. it should be simple a bug or something wrong on my side..

anyway it is a long and tedious process.... with lots of reboots of my ubuntu


now the steps to do it:

1) select Bridge adapter and choose an ACTIVE network card, and for my case it is my wireless nic

Note: This simple step is the cause of my frustrations... I choose my Ethernet nic but it is not active because Windows does not detect a cable - one of the many limitations of windows - and I go on to install TAP-Win32, after reading articles like http://samiux.wordpress.com/2007/07/11/bridge-network-interface-on-virtualbox/




2) take note of the ip setting of the active nic that u have chosen, and let's say it is 192.168.100.1/24

3) Boot Ubuntu and edit /etc/network/interface to be:

fs@ubuntu:~$ more /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.100.4
netmask 255.255.255.0
gateway 192.168.100.1


Here I choose 192.168.100.4, it can be anything, as long as it does not conflict with the active nic in step 1 or other ip in the network... u must be careful if your network is big with many machines.



That's it, reboot Ubuntu and u should be able to ping to it from Windows.


fook sheng

free ssh client (windows) - Bitwise from http://www.bitvise.com/index

This free ssh client offer nice gui

download it and try it

http://www.bitvise.com/

fook sheng

Monday, June 8, 2009

speed test for your internet connection

i did a speed test when i install µTorrent (http://www.utorrent.com) and here is it:

another test:




Perhaps Singtel should use this data when they advertise their broadband packages....

Free alternative to Partition Magic

There are quite a few... but I'm attracted to GParted from GNU (http://sourceforge.net/projects/gparted/) as it is GNU you know :) They also provide a Live CD (http://gparted.sourceforge.net/livecd.php) too.

I choose to boot GPartedLive from a thumbdrive instead and I follow Choice 1 from http://gparted.sourceforge.net/liveusb.php

It didn't work 100% and so I try Choice 2 from the same page and I was able to delete my Linux partitions created by Debian and create one NTFS partition and a smaller ext3 partition for my Ubuntu (ya I chose Ubuntu for WPA support... ) ... but all is well until I realise it is better for me to combine the 2 NTFS partitions together and GParted just couldn't do that...

more googling.... and came EASEUS Partition Master Home Edition (http://www.partition-tool.com/personal.htm)

installation is easy and the user interface is nice..

but it don't seem to recognise what type of partition u have except for NTFS and FAT... so I think it is best to use both GParted and EASEUS together...

fook sheng

Free alternative to Norton Ghost

I reinstall my laptop again due to various reasons, mainly because my laptop lacks Intel-VT and I can't run Xen. Hence I have to fall back to dual boot in order to have Ubuntu running on my hardware (no VMWare or VirtualBox does not help, I need wireless support for my Ubuntu to try some wireless security stuff).

But then Norton Ghost came to my mind, and along with it, I managed to find several free alternatives to Ghost. They are Clonezilla (http://clonezilla.org/) , FOG (http://sourceforge.net/projects/freeghost/) and partimage http://www.partimage.org).

It seems to me that Clonezilla is the best, but i need to first get my first a spare and big harddisk to try it out first.

Free software is great!!!