Wednesday, November 11, 2009
KVM
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.
Sunday, November 1, 2009
bridge - linux
qemu
http://qemu-buch.de/cgi-bin/moin.cgi/QemuAndTuntap
Thursday, October 22, 2009
hacking
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
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
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
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
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-***
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
embedding fonts
http://www.netmechanic.com/news/vol3/css_no15.htm
http://www.morovia.com/font/support/embed-font-web.asp