<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pkill.info</title>
	<atom:link href="http://pkill.info/b/feed/" rel="self" type="application/rss+xml" />
	<link>http://pkill.info/b</link>
	<description>Tutorials and tips</description>
	<lastBuildDate>Tue, 27 Jul 2010 13:37:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Setting up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0.0</title>
		<link>http://pkill.info/b/2256/setting-up-stable-xen-domu-with-fedora-unmodified-fedora-12-on-top-of-xenified-fedora-12-dom0-with-xen-4-0-0/</link>
		<comments>http://pkill.info/b/2256/setting-up-stable-xen-domu-with-fedora-unmodified-fedora-12-on-top-of-xenified-fedora-12-dom0-with-xen-4-0-0/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:59:29 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2256</guid>
		<description><![CDATA[Creating file-backed virtual block device (VBD) for Xen virtual machines and installing Fedora 12 in Xen DomU via internet will be introduced. Create file-backed VBD: The actual space of VBD will be the amount of disk the virtual machine used. And it will be convenient if the virtual machine will be duplicated since the work [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12'>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1535/setting-up-xen-pvops-dom0-on-fedora-xen-3-4-2-kernel-2-6-31-with-paravirt_ops-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12'>Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1566/setting-up-xen-dom0-on-fedora-xen-3-4-1-with-linux-kernel-2-6-29-on-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12'>Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Creating file-backed virtual block device (VBD) for Xen virtual machines and installing Fedora 12 in Xen DomU via internet will be introduced.</p>
<p><strong>Create file-backed VBD:</strong></p>
<p>The actual space of VBD will be the amount of disk the virtual machine used. And it will be convenient if the virtual machine will be duplicated since the work is just copying the VBD file and changing some configurations. But file-backed VBDs may not be appropriate for I/O-intensive domains because of the I/O handling cost to support file-backed VBDs in dom0.<br />
Create a 20GB sparse file-backed VBD:</p>
<pre># dd if=/dev/zero of=/lhome/xen/f12install/vmdisk0 bs=1k seek=20480k count=1</pre>
<p>Make a ext3 file system in the disk file:</p>
<pre># mkfs -t ext3 vmdisk0</pre>
<p><strong>Install Fedora 12 Linux via Internet:</strong></p>
<p>First download the pxeboot kernel of Fedora 12 for installation via Internet. Download vmlinuz and initrd.img from here:</p>
<pre>http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/</pre>
<p>We assume these two files are stored in /lhome/xen/f12install/.</p>
<p>Create an installation profile f12.install:</p>
<pre>name="F12INSTALL"
vcpus=2
memory=2048
disk = ['tap:aio:/lhome/xen/f12install/vmdisk0,xvda,w' ]
vif = [ 'bridge=eth0' ]
kernel = "/lhome/xen/f12install/vmlinuz"
ramdisk = "/lhome/xen/f12install/initrd.img"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here the blktap2 VBD driver is used for better performance than blkback backed VBD. If the blkback backed driver is used, the disk like should be changed to:</p>
<pre>disk = ['file:/lhome/xen/f12install/vmdisk0,xvda,w' ]</pre>
<p>The virtual machine’s name is “F12INSTALL”, memory is 2G, CPU number is 2, disk, kernel and ramdisk is prepared in the above steps.</p>
<p>Start this virtual machine and connect to this virtual machine’s console and complete the installation:</p>
<pre># xm create -c f12.install</pre>
<p>The console can be released by &#8220;<em>Ctrl+]&#8221;</em>. And it can be reconnected by:</p>
<pre># xm console F12INSTALL</pre>
<p>The installation of Fedora 12 will start. The gateway and DNS server should be set according to the network configuration.</p>
<p>The URL of installation source I used during installation is:</p>
<pre>http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/</pre>
<p>After successfully installation of this virtual machine. It can be shut down by:</p>
<pre># xm shutdown F12INSTALL
</pre>
<p>This virtual machine can be duplicated to get more VMs: <a href="http://pkill.info/b/605/how-to-duplicate-xen-domu-virtual-machines/" target="_blank">How to duplicate Xen DomU virtual machines</a>.</p>
<p><strong>Start DomU:</strong></p>
<p>Create a profile <em>vm-10.0.0.123.run</em> for loading the virtual machine:</p>
<pre>name="10.0.0.123"
vcpus=2
memory=2048
disk = ['tap:aio:/lhome/xen/vm-10.0.0.123/vmdisk0,xvda,w' ]
vif = [ 'bridge=eth0' ]
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here we use the PyGrub (“/usr/bin/pygrub”) as the bootloader. PyGrub starts Linux DomUs with the kernels that lie in the filesystem of the DomU instead of the kernels that lie in the filesystem of the Dom0. That makes the kernel update and management easier.</p>
<p>Then the DomU can be started using this profile:</p>
<pre># xm create vm-10.0.0.123.run</pre>
<p>The console of this DomU can be connected to:</p>
<pre># xm console vm-10.0.0.123</pre>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12'>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1535/setting-up-xen-pvops-dom0-on-fedora-xen-3-4-2-kernel-2-6-31-with-paravirt_ops-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12'>Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1566/setting-up-xen-dom0-on-fedora-xen-3-4-1-with-linux-kernel-2-6-29-on-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12'>Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/2256/setting-up-stable-xen-domu-with-fedora-unmodified-fedora-12-on-top-of-xenified-fedora-12-dom0-with-xen-4-0-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</title>
		<link>http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/</link>
		<comments>http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:39:39 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[server config]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2252</guid>
		<description><![CDATA[How to set up Xen Dom0 with Xenified Linux kernel in Fedora 12 will be introduced in this post. We use Xen 4.0.0 from xen.org and Xenified Linux kernel 2.6.32.13. This solution have been tested quite stable in our cluster. Hardware: Dom0&#8242;s hardware platform: Motherboard: INTEL S5500BC S5500 Quad Core Xeon Server Board CPU: 2 [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/2256/setting-up-stable-xen-domu-with-fedora-unmodified-fedora-12-on-top-of-xenified-fedora-12-dom0-with-xen-4-0-0/' rel='bookmark' title='Permanent Link: Setting up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0.0'>Setting up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0.0</a></li>
<li><a href='http://pkill.info/b/1566/setting-up-xen-dom0-on-fedora-xen-3-4-1-with-linux-kernel-2-6-29-on-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12'>Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12</a></li>
<li><a href='http://pkill.info/b/1535/setting-up-xen-pvops-dom0-on-fedora-xen-3-4-2-kernel-2-6-31-with-paravirt_ops-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12'>Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>How to set up Xen Dom0 with <em>Xenified</em> Linux kernel in Fedora 12 will be introduced in this post. We use Xen 4.0.0 from xen.org and Xenified Linux kernel 2.6.32.13. This solution have been tested quite stable in our cluster.</p>
<h3>Hardware:</h3>
<p>Dom0&#8242;s hardware platform:</p>
<p>Motherboard<em>: INTEL S5500BC S5500 Quad Core Xeon Server Board<br />
</em>CPU<em>: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket  1366)<br />
</em>Memory<em>: 8 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM  w/Parity &amp;  Thermal Sensor<br />
</em>HD<em>: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache</em></p>
<h3>Linux system:</h3>
<p>Fedora 12 x86_64<br />
SELinux is disabled. Please refer here for detail: <a href="../1233/disable-selinux-in-fedora/" target="_blank">Disabled SELinux on Fedora</a>.</p>
<p><em>ext3</em> is recommended for the file system of disk partition for <em>/boot</em>.</p>
<p>Update the system:</p>
<pre class="prettyprint"># yum update</pre>
<p>The Xen and libvirt packages in Fedora should not be installed to avoid conflict.</p>
<pre class="prettyprint"># yum erase xen* libvirt</pre>
<h3>Build and install Xen hypervisor and tools</h3>
<h4>Download Xen 4.0.0</h4>
<pre class="prettyprint">$ wget http://bits.xensource.com/oss-xen/release/4.0.0/xen-4.0.0.tar.gz
$ tar xf xen-4.0.0.tar.gz</pre>
<h4>Build Xen and tools</h4>
<pre class="prettyprint">$ make xen
$ make tools</pre>
<p>You may need to install packages depended by this.</p>
<h4>Install Xen and tools</h4>
<pre class="prettyprint">$ make install-xen
$ make install-tools</pre>
<h3>Build and install xenified Linux kernel</h3>
<h4>Download Linux kernel 2.6.32.13</h4>
<pre class="prettyprint">$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.13.tar.bz2
$ tar xf linux-2.6.32.13.tar.bz2</pre>
<h4>Download 2.6.32 Xen patches v2</h4>
<pre class="prettyprint">$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.32-2.tar.bz2
$ tar xf xen-patches-2.6.32-2.tar.bz2</pre>
<h4>Apply Xen patches</h4>
<p>Apply all the patches downloaded above following the patch number. This patch.sh script can be used (we assume the patch and the kernel are in the same directory):</p>
<p>patch.sh:</p>
<pre class="prettyprint">#!/bin/bash
for P in `ls ../xen-patches-2.6.32-2/6*.patch1 | sort`
do
    patch -p1 -s -i $P
    if [ $? = 0 ]; then
        echo $P applied
    else
        echo "Error processing "$P
        exit 1
    fi
done</pre>
<p>Put this script into Linux source directory and execute:</p>
<pre class="prettyprint">$ sh ./patch.sh</pre>
<h4>Configure Xenified Linux kernel</h4>
<p>A working configuration file that I used can be downloaded directly from here:</p>
<p><a href="https://docs.google.com/leaf?id=0BxXe2zOqYbxmZDMwZGQxMTAtNTVlOS00YTU2LTkyYTEtZmY2MGRhNDc5Nzll&amp;hl=en" target="_blank">config-for-xenified-linux-2.6.32.13</a></p>
<p>Just download this file, put it into the kernel source code file directory and rename it to <em>.config</em> .</p>
<p>Other than use my configuration file, you can also configure it by yourself by using “<em>make menuconfig”</em>.</p>
<p>Make sure you build the kernel with these components enabled:</p>
<pre>Processor type and features  ---&gt;
 [*] Symmetric multi-processing support
 [*] Support sparse irq numbering
<strong> [*] Enable Xen compatible kernel</strong>
<strong> Preemption Model (No Forced Preemption (Server))  ---&gt;</strong>

Device Drivers  ---&gt;
 XEN  ---&gt;
<strong> [*] Privileged Guest (domain 0)</strong>
 &lt;*&gt; Backend driver support (NEW)
 &lt;*&gt;   Block-device backend driver (NEW)
 &lt;*&gt;   Block-device tap backend driver (NEW)
<strong> &lt;*&gt;   Block-device tap backend driver 2 (NEW)</strong>
<strong> &lt;*&gt;   Network-device backend driver (NEW)</strong>
 (8)     Maximum simultaneous transmit requests (as a power of 2) (NEW)
 [ ]     Pipelined transmitter (DANGEROUS) (NEW)
 &lt; &gt;     Network-device loopback driver (NEW)
 &lt;*&gt;   PCI-device backend driver (NEW)
 PCI Backend Mode (Virtual PCI)  ---&gt;
 [ ]     PCI Backend Debugging (NEW)
 &lt; &gt;   TPM-device backend driver (NEW)
 &lt;M&gt;   SCSI backend driver (NEW)
 &lt;M&gt;   USB backend driver (NEW)
 &lt;M&gt; Block-device frontend driver
 &lt;M&gt; Network-device frontend driver
 &lt;M&gt;   Network-device frontend driver acceleration for Solarflare NICs (NEW)
 &lt;M&gt; SCSI frontend driver (NEW)
 &lt;M&gt; USB frontend driver (NEW)
 [*]   Taking the HCD statistics (for debug) (NEW)
 [ ]   HCD suspend/resume support (DO NOT USE) (NEW)
 &lt;*&gt; User-space granted page access driver (NEW)
 &lt;*&gt; Framebuffer-device frontend driver (NEW)
 &lt;*&gt;   Keyboard-device frontend driver (NEW)
 [*] Disable serial port drivers (NEW)
 &lt;*&gt; Export Xen attributes in sysfs (NEW)
 (256) Number of guest devices (NEW)
<strong> Xen version compatibility (no compatibility code)  ---&gt;</strong>
 [*] Place shared vCPU info in per-CPU storage (NEW)</pre>
<h4>Build kernel</h4>
<pre>$ make -j16</pre>
<h4>Install modules and kernel</h4>
<pre class="prettyprint"># make modules_install install</pre>
<h3>Configure grub</h3>
<p>Add one entry for Xen in <em>/boot/grub/grub.conf</em>. This is an example entry:</p>
<pre class="prettyprint">title Xen 4.0.0 - Xenified Linux 2.6.32.13
  root (hd0,0)
  kernel /xen-4.0.0.gz console=vga vga=ask noreboot
  module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
  module /initramfs-2.6.32.13.img</pre>
<p>The root and other parameters may be different depending on the configuration.</p>
<h3>Make Xend and Xendomains services automatically start when system boots</h3>
<pre># cd /etc/init.d/
# chkconfig --add xend
# chkconfig --add xendomains</pre>
<p>Check whether Xend and Xendomains services are automatically started in level 3-5:</p>
<pre class="prettyprint"># chkconfig --list | grep xend</pre>
<p>It should be like this:</p>
<pre class="prettyprint">xend               0:off    1:off    2:off    3:on    4:on    5:on    6:off
xendomains         0:off    1:off    2:off    3:on    4:on    5:on    6:off</pre>
<h3>BIOS configuration</h3>
<p>If xen stops at:</p>
<p>“I/O virtualization disabled.”</p>
<p>We may need to enable VT and I/O virtualization in BIOS.</p>
<p>These options can be enabled in BIOS:</p>
<pre>Intel (R) Virtualization Technology
Intel (R) VT for Directed I/O
Interrupt Remapping
Coherency Support
ATS Support</pre>
<h3>Enjoy the fun now!</h3>
<p>After booting the system, you can try to use <em>xm</em> to check xen info</p>
<pre class="prettyprint"># xm info</pre>
<p>Then <em>xm</em> command can be used to start up DomUs.</p>
<p>This is one working configuration file for one DomU that I use:</p>
<pre class="prettyprint">name="10.0.1.201"
vcpus=2
memory=16384
disk = ['tap:aio:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
# disk = ['file:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
vif = ['bridge=eth0']
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here we use the <em>blktap </em>backed VBD device which has much better performance than Linux blkback backed VBD device.</p>
<h3>Making the performance more stable</h3>
<p>Allocating dedicated CPU core and memory for Dom0 may provide more stable performance for the Xen platform. Please refer to <a href="http://pkill.info/b/2258/managing-xen-dom0s-cpu-and-memory/" target="_blank">Managing Xen Dom0&#8242;s CPU and Memory/</a> for detailed instruction.</p>
<h3>Problems</h3>
<p>Here is a list of problem that may occur during the configuration.</p>
<h4>Limited number of loop devices</h4>
<p>The default number of loop device in this kernel is 8. When we are using blkback backed VBDs and we need to have more than 8 virtual machines, we should <a href="../223/add-more-loop-device-on-linux/" target="_blank">add more loop devices</a>. You need to use the first method (pass parameter max_loop=32 to vmlinuz) if you use my kernel configuration file.</p>
<h4>initramfs related problem</h4>
<p>The <em>initramfs</em> image under /root generated by <em>dracut </em>doesn’t work on some servers. If you have the similiar problem, you can try to use image generated by <em>mkinitrd</em>:</p>
<p>1) Generate initrd-2.6.32.13.img using mkinitrd</p>
<pre>mkinitrd /boot/initrd-2.6.32.13.img 2.6.32.13</pre>
<p>2) Edit entry in <em>/boot/grub/grub.conf</em></p>
<p>Change</p>
<pre class="prettyprint">module /initramfs-2.6.32.13.img</pre>
<p>to</p>
<pre class="prettyprint">module /initrd-2.6.32.13.img</pre>
<h4>drm related problem</h4>
<p>On one of our servers that uses radeon card we have experienced problem related to <em>drm</em>. The system crashes after the kernel printing out information about <em>drm.</em> We can add <em>nomodeset</em> option to kernel command line to bypass this problem.</p>
<p>The kernel command line in <em>/boot/grub.conf</em> will change to:</p>
<pre class="prettyprint">module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root <strong>nomodeset</strong> noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us</pre>
<h4>Build kernel on 32bit platform</h4>
<p>You first need to enable PAE support if you’re building 32 bit version of the kernel. Xen only supports 32 bit PAE kernels nowadays. Xen kernel build options won’t show up if you don’t enable PAE for 32 bit builds.<br />
You can enable PAE in “Processor type and features -&gt; High Memory Support (64GB) -&gt; PAE (Physical Address Extension) Support”</p>
<p>I can find Xen options after enable PAE on my laptop. I have never run Xen Dom0 on a 32bit kernel. I can’t say whether it is stable. Please try it and I will appreciate it if you share your result with me ;)</p>
<h4>Error message about ksm</h4>
<p>If you get lots error messages generated by ksm, you can disable service <em>ksm</em> and <em>ksmtuned</em> to eliminate these error messages:</p>
<pre class="prettyprint"># chkconfig ksm off
# chkconfig ksmtuned off</pre>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/2256/setting-up-stable-xen-domu-with-fedora-unmodified-fedora-12-on-top-of-xenified-fedora-12-dom0-with-xen-4-0-0/' rel='bookmark' title='Permanent Link: Setting up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0.0'>Setting up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen 4.0.0</a></li>
<li><a href='http://pkill.info/b/1566/setting-up-xen-dom0-on-fedora-xen-3-4-1-with-linux-kernel-2-6-29-on-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12'>Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12</a></li>
<li><a href='http://pkill.info/b/1535/setting-up-xen-pvops-dom0-on-fedora-xen-3-4-2-kernel-2-6-31-with-paravirt_ops-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12'>Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Managing Xen Dom0&#8242;s CPU and Memory</title>
		<link>http://pkill.info/b/2258/managing-xen-dom0s-cpu-and-memory/</link>
		<comments>http://pkill.info/b/2258/managing-xen-dom0s-cpu-and-memory/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 15:12:54 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[server config]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2258</guid>
		<description><![CDATA[The performance of Xen&#8217;s Dom0 is important for the overall system. The disk and network drivers are running on Dom0. I/O intensive guests&#8217; workloads may consume lots Dom0&#8242;s CPU cycles. The Linux kernel calculates various network related parameters based on the amount of memory at boot time. The kernel also allocate memory for storing memory [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/615/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/' rel='bookmark' title='Permanent Link: A simple CPU and memory performance test of xen Dom0 and DomU'>A simple CPU and memory performance test of xen Dom0 and DomU</a></li>
<li><a href='http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12'>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1535/setting-up-xen-pvops-dom0-on-fedora-xen-3-4-2-kernel-2-6-31-with-paravirt_ops-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12'>Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>The performance of Xen&#8217;s Dom0 is important for the overall system. The disk and network drivers are running on Dom0. I/O intensive guests&#8217; workloads may consume lots Dom0&#8242;s CPU cycles. The Linux kernel calculates various network related parameters based on the amount of memory at boot time. The kernel also allocate memory for storing memory metadata (per page info structures) is also based on the boot time amount of memory. After ballooning down Dom0&#8242;s memory, the network related parameters will not be correct. Ballooning down busy Dom0&#8242;s memory sometimes cause SSH to die from our observation, which is a nightmare for the administrator since SSH is usually the only way for remote control of the server. Another bed effect is that it&#8217;s a waste of memory with a large memory metadata for a smaller memory amount.</p>
<p>Now let&#8217;s look at how to menage Xen Dom0&#8242;s CPU and memory in a better way.</p>
<h3>Dedicate a CPU core for Dom0</h3>
<p>Dom0 will have free CPU time to process the I/O requests from the DomUs if it has dedicated CPU core(s). Better performance may be achieved by this since there are less CPU context switches to do in Dom0.</p>
<p>We can dedicate CPU core for Dom0 by passing &#8220;<strong><em>dom0_max_vcpus=X dom0_vcpus_pin</em></strong>&#8221; options to Xen hypervisor (<em>xen.gz</em>) in <em>/boot/grub/grub.conf</em>. <em>X</em> is the number of vcpus dedicated to Dom0.</p>
<p>As hyperthreading technology is enabled in most modern CPUs, we need to specify two processors to dedicate one CPU core. So the <em>&#8220;X&#8221;</em> above should usually be <em>2</em> for one CPU core.</p>
<pre>kernel /xen.gz console=vga vga=ask noreboot <strong>dom0_max_vcpus=2 dom0_vpus_pin</strong></pre>
<p>After booting the system, the VCPU list can be got on Dom0 by this command:</p>
<pre># xm vcpu-list</pre>
<p>Even after booting the system, the VCPU number can be configured by <em>xm</em> command. We can set Domain-0 have two VCPUs and processor 0 and 1 to be dedicated to Dom0 by these commands:</p>
<pre># xm vcpu-set Domin-0 2
# xm vcpu-pin Domain-0 0
# xm vcpu-pin Domain-0 1</pre>
<h3>Dedicate memory for Dom0</h3>
<p>We should always dedicate fixed amount of memory for Xen Dom0.</p>
<p>We can set the initial memory size of Dom0 by passing &#8220;<em>dom0_mem=xxx&#8221;</em> (in KB) option to Xen hypervisor (<em>gen.gz</em>) in <em>/boot/grub/grub.conf.</em> &#8220;<em>xxx&#8221; </em>is the amount of memory for Dom0 in KB.</p>
<p>If we set the initial memory size of Dom0 to 2GB, just change the entry in <em>grub.conf</em> to:</p>
<pre>kernel /xen.gz console=vga vga=ask noreboot dom0_max_vcpus=2 dom0_vpus_pin <strong>dom0_mem=2097152</strong></pre>
<h4>Set lowest permissible memory for Dom0</h4>
<p>The option dom0-min-mem in Xend configuration file <em>/etc/xen/xend-config.sxp</em> is used to specify the lowest permissible memory for Dom0.</p>
<p>The value of <em>dom0-min-mem</em> (in MB) is the lowest permissible memory level for Dom0. The default value is 256. If we limit the memory size of Dom0 to 2G, just set:</p>
<pre>(dom0-min-mem 2048)</pre>
<h4>Preventing dom0 memory ballooning</h4>
<p>The &#8220;<em>enable-dom0-ballooning</em>&#8221; option in Xend configuration file is used to specify whether Dom0&#8242;s memory can be ballooned out. Setting<em> &#8220;enable-dom0-ballooning&#8221; </em>to <em>&#8220;no&#8221;</em> will make sure Xend never takes any memory away from Dom0:</p>
<pre>(enable-dom0-ballooning no)</pre>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/615/a-simple-cpu-and-memory-performance-test-of-xen-dom0-and-domu/' rel='bookmark' title='Permanent Link: A simple CPU and memory performance test of xen Dom0 and DomU'>A simple CPU and memory performance test of xen Dom0 and DomU</a></li>
<li><a href='http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12'>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1535/setting-up-xen-pvops-dom0-on-fedora-xen-3-4-2-kernel-2-6-31-with-paravirt_ops-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12'>Setting up Xen pvops Dom0 on Fedora : Xen 3.4.2 + Kernel 2.6.31 with paravirt_ops in Fedora 12</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/2258/managing-xen-dom0s-cpu-and-memory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuration of Linux Kernel Video Mode</title>
		<link>http://pkill.info/b/2218/configuration-of-linux-kernel-video-mode/</link>
		<comments>http://pkill.info/b/2218/configuration-of-linux-kernel-video-mode/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 06:09:38 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[client config]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[server config]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2218</guid>
		<description><![CDATA[The Linux kernel has a generic driver for a graphic framebuffer named vesafb on intel boxes. It provides a nice large console for most of modern displays. Switching VESA modes of Linux kernel at boot time can be done by using the &#8220;vga=&#8230;&#8220; kernel boot parameter. This parameter accept the decimal value of Linux video [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/' rel='bookmark' title='Permanent Link: Sending Email from mailx Command in Linux Using Gmail’s Smtp'>Sending Email from mailx Command in Linux Using Gmail’s Smtp</a></li>
<li><a href='http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12'>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1566/setting-up-xen-dom0-on-fedora-xen-3-4-1-with-linux-kernel-2-6-29-on-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12'>Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>The Linux kernel has a generic driver for a graphic framebuffer named <em>vesafb</em> on intel boxes. It provides a nice large console for most of modern displays.</p>
<p>Switching VESA modes of Linux kernel at boot time can be done by using the <em>&#8220;vga=&#8230;</em><em>&#8220;</em> kernel boot parameter. This parameter accept the <strong>decimal value</strong> of Linux video mode numbers instead of VESA video mode numbers. The Linux video mode number can be easily derived from the VESA number.</p>
<p>The video mode number of the Linux kernel is the VESA mode number plus 0&#215;200.</p>
<pre class="prettyprint">Linux_kernel_mode_number = VESA_mode_number + 0x200</pre>
<p>Here are some of the VESA mode numbers:</p>
<pre class="prettyprint">    | 640x480  800x600  1024x768 1280x1024
----+-------------------------------------
256 |  0x101    0x103    0x105    0x107
32k |  0x110    0x113    0x116    0x119
64k |  0x111    0x114    0x117    0x11A
16M |  0x112    0x115    0x118    0x11B</pre>
<p>So the table for the Kernel mode numbers are:</p>
<pre class="prettyprint">    | 640x480  800x600  1024x768 1280x1024
----+-------------------------------------
256 |  0x301    0x303    0x305    0x307
32k |  0x310    0x313    0x316    0x319
64k |  0x311    0x314    0x317    0x31A
16M |  0x312    0x315    0x318    0x31B</pre>
<p>The decimal value of the Linux kernel video mode number can be passed to the kernel in the form &#8220;<em>vga=XXX</em>&#8220;, where XXX is the decimal value.</p>
<p>Instead of the XXX decimal value, the &#8220;<em>vga</em>&#8221; parameter also accept &#8220;<em>ask&#8221;</em> which will list all the Linux kernel mode numbers and let the user select one. You can used it if you want to be asked every time booting Linux. It can also be used to find the best Linux video mode on your console.</p>
<p>The best way for configuring the &#8220;<em>vga=XXX&#8221;</em> parameter is following these steps.</p>
<p>First, add &#8220;<em>vga=ask&#8221;</em> parameter to the Linux kernel entry in grub configuration file <em>/boot/grub/grub.conf</em>. Like this:</p>
<pre class="prettyprint">kernel /vmlinuz-2.6.32.16-141.fc12.i686 ro root=/dev/mapper/VolGroup-LogVol00 <strong>vga=ask </strong></pre>
<p>Second, reboot Linux and hit return when the kernel ask for the vga mode. Then select one mode from the list and remember the Linux mode number which is a hexdecimal value in the format YYY. You can also get more choice by entering &#8220;<em>scan</em>&#8220;.</p>
<p>Last, calculate the decimal value of the Linux video mode number. This simple python command can be used:</p>
<pre class="prettyprint">python -c "print 0xYYY"</pre>
<p>YYY is the hexdecimal value you got.</p>
<p>Then change &#8220;<em>ask</em>&#8221; in grub configuration file to the decimal value calculated.</p>
<p>Here is a list of usually used Linux mode number and the decimal value if you like to choose one directly:</p>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td><span style="font-size: x-small;"><strong><br />
</strong></span></td>
<td><span style="font-size: x-small;"><strong>320×200</strong></span></td>
<td><span style="font-size: x-small;"><strong>640×400</strong></span></td>
<td><span style="font-size: x-small;"><strong>640×480</strong></span></td>
<td><span style="font-size: x-small;"><strong>800×500</strong></span></td>
<td><span style="font-size: x-small;"><strong>800×600</strong></span></td>
<td><span style="font-size: x-small;"><strong>896×672</strong></span></td>
<td><span style="font-size: x-small;"><strong>1024×640</strong></span></td>
<td><span style="font-size: x-small;"><strong>1024×768</strong></span></td>
<td><span style="font-size: x-small;"><strong>1280×1024</strong></span></td>
</tr>
<tr>
<td><span style="font-size: x-small;"><strong>4 bits</strong></span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;">770 (302)</span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;">774 (306)</span></td>
</tr>
<tr>
<td><span style="font-size: x-small;"><strong>8 bits</strong></span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;">768 (300)</span></td>
<td><span style="font-size: x-small;">769 (301)</span></td>
<td><span style="font-size: x-small;">879 (36F)</span></td>
<td><span style="font-size: x-small;">701 (303)</span></td>
<td><span style="font-size: x-small;">815 (32F)</span></td>
<td><span style="font-size: x-small;">874 (36A)</span></td>
<td><span style="font-size: x-small;">773 (305)</span></td>
<td><span style="font-size: x-small;">775 (307)</span></td>
</tr>
<tr>
<td><span style="font-size: x-small;"><strong>15 bits</strong></span></td>
<td><span style="font-size: x-small;">781 (30D)</span></td>
<td><span style="font-size: x-small;">801 (321)</span></td>
<td><span style="font-size: x-small;">784 (310)</span></td>
<td><span style="font-size: x-small;">880 (370)</span></td>
<td><span style="font-size: x-small;">787 (313)</span></td>
<td><span style="font-size: x-small;">816 (330)</span></td>
<td><span style="font-size: x-small;">875 (36B)</span></td>
<td><span style="font-size: x-small;">790 (316)</span></td>
<td><span style="font-size: x-small;">793 (319)</span></td>
</tr>
<tr>
<td><span style="font-size: x-small;"><strong>16 bits</strong></span></td>
<td><span style="font-size: x-small;">782 (30E)</span></td>
<td><span style="font-size: x-small;">802 (322)</span></td>
<td><span style="font-size: x-small;">785 (311)</span></td>
<td><span style="font-size: x-small;">881 (371)</span></td>
<td><span style="font-size: x-small;">788 (314)</span></td>
<td><span style="font-size: x-small;">817 (331)</span></td>
<td><span style="font-size: x-small;">876 (36C)</span></td>
<td><span style="font-size: x-small;">791 (317)</span></td>
<td><span style="font-size: x-small;">794 (31A)</span></td>
</tr>
<tr>
<td><span style="font-size: x-small;"><strong>24 bits</strong></span></td>
<td><span style="font-size: x-small;">783 (30F)</span></td>
<td><span style="font-size: x-small;">803 (323)</span></td>
<td><span style="font-size: x-small;">786 (312)</span></td>
<td><span style="font-size: x-small;">882 (372)</span></td>
<td><span style="font-size: x-small;">789 (315)</span></td>
<td><span style="font-size: x-small;">818 (332)</span></td>
<td><span style="font-size: x-small;">877 (36D)</span></td>
<td><span style="font-size: x-small;">792 (318)</span></td>
<td><span style="font-size: x-small;">795 (31B)</span></td>
</tr>
<tr>
<td><span style="font-size: x-small;"><strong>32 bits</strong></span></td>
<td><span style="font-size: x-small;"> </span></td>
<td><span style="font-size: x-small;">804 (324)</span></td>
<td><span style="font-size: x-small;">809 (329)</span></td>
<td><span style="font-size: x-small;">883 (373)</span></td>
<td><span style="font-size: x-small;">814 (32E)</span></td>
<td><span style="font-size: x-small;">819 (333)</span></td>
<td><span style="font-size: x-small;">878 (36E)</span></td>
<td><span style="font-size: x-small;">824 (338)</span></td>
<td><span style="font-size: x-small;">829 (33D)</span></td>
</tr>
</tbody>
</table>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/' rel='bookmark' title='Permanent Link: Sending Email from mailx Command in Linux Using Gmail’s Smtp'>Sending Email from mailx Command in Linux Using Gmail’s Smtp</a></li>
<li><a href='http://pkill.info/b/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12'>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</a></li>
<li><a href='http://pkill.info/b/1566/setting-up-xen-dom0-on-fedora-xen-3-4-1-with-linux-kernel-2-6-29-on-fedora-12/' rel='bookmark' title='Permanent Link: Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12'>Setting up Xen Dom0 on Fedora : Xen 3.4.1 with Linux Kernel 2.6.29 on Fedora 12</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/2218/configuration-of-linux-kernel-video-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jailbreaking Apple iPod Touch with Spirit in Linux</title>
		<link>http://pkill.info/b/2199/jailbreaking-apple-ipod-touch-with-spirit-in-linux/</link>
		<comments>http://pkill.info/b/2199/jailbreaking-apple-ipod-touch-with-spirit-in-linux/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 06:04:01 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2199</guid>
		<description><![CDATA[How to jailbreak Apple iPod touch in Linux will be introduced in this article. We use Spirit to jailbreak iPod touch. Spirit[1] is an untethered jailbreak for iPad, iPhone, and iPod touch on certain firmware versions. Please read [1] for requirement when using Spirit. Currently, the version of iTunes used should be iTune 9 earlier [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/1638/setting-up-ecryptfs-in-linux/' rel='bookmark' title='Permanent Link: Setting up eCryptFS in Linux'>Setting up eCryptFS in Linux</a></li>
<li><a href='http://pkill.info/b/1596/speeding-up-firefox-on-linux/' rel='bookmark' title='Permanent Link: Speeding up Firefox on Linux'>Speeding up Firefox on Linux</a></li>
<li><a href='http://pkill.info/b/1760/linux-setting-date-time-and-timezone/' rel='bookmark' title='Permanent Link: Linux Setting Date, Time and Timezone'>Linux Setting Date, Time and Timezone</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>How to jailbreak Apple iPod touch in Linux will be introduced in this article. We use Spirit to jailbreak iPod touch. Spirit[1] is an untethered jailbreak for iPad, iPhone, and iPod touch on certain firmware versions.</p>
<p>Please read [1] for requirement when using Spirit. Currently, the version of iTunes used should be iTune 9 earlier than 9.2. The firmware&#8217;s version should be 3.1.2, 3.1.3 or 3.2.</p>
<p>My iPod which I use in this tutorial is: iPod touch 8G 3.1.3(7E18) Model (MC086ZP). The Linux I used is Fedora 12.</p>
<p>Okay, let&#8217;s go!</p>
<h3>1. Synchronise with iTunes</h3>
<p>As what we usually do. This step is highly recommended by Spirit.</p>
<h3>2. Dowload Spirit jaibreak for Linux and compile it</h3>
<h4>Get the source code</h4>
<pre>$ git clone http://github.com/posixninja/spirit-linux.git</pre>
<h4>Install depended development packages</h4>
<pre>$ sudo yum install libplist-devel libimobiledevice-devel</pre>
<p>You may need to install other development packages such as make, gcc etc.</p>
<h4>Build spirit</h4>
<pre>$ cd spirit-linux
$ make</pre>
<h3>3. Set iPod to not Auto-lock</h3>
<p>In Settings-&gt;General-&gt;Auto-lock, select never.</p>
<h3>4. Connect iPod touch to the Linux box with cable</h3>
<h3>5. jailbreak it</h3>
<p>$ ./spirit</p>
<h3>6. iPod will reboot</h3>
<p>The jailbreak work will start. Wait for a few minutes.</p>
<h3>7. Done</h3>
<p>Congratulations! Now, look for the Cydia icon. My favourite applications are Terminal and OpenSSH. Remember to change the password of <em>root</em> and <em>mobile</em> users for security.</p>
<h3>Reference:</h3>
<p>[1] http://www.spiritjb.com/</p>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/1638/setting-up-ecryptfs-in-linux/' rel='bookmark' title='Permanent Link: Setting up eCryptFS in Linux'>Setting up eCryptFS in Linux</a></li>
<li><a href='http://pkill.info/b/1596/speeding-up-firefox-on-linux/' rel='bookmark' title='Permanent Link: Speeding up Firefox on Linux'>Speeding up Firefox on Linux</a></li>
<li><a href='http://pkill.info/b/1760/linux-setting-date-time-and-timezone/' rel='bookmark' title='Permanent Link: Linux Setting Date, Time and Timezone'>Linux Setting Date, Time and Timezone</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/2199/jailbreaking-apple-ipod-touch-with-spirit-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Mouse Cursor Style for GTK Applications in KDE Desktop</title>
		<link>http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/</link>
		<comments>http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 17:28:41 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[client config]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2186</guid>
		<description><![CDATA[One annoying thing when using KDE desktop is that the theme and style of GTK applications differ from KDE&#8217;s. The gtk-qt-engine can let us select the theme for GTK applications in KDE desktop environment. But the mouse cursors for GTK application and QT applications are different if we set the cursor style in KDE&#8217;s setting [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/150/beautiful-desktop-gnome-of-osx-style-on-linux/' rel='bookmark' title='Permanent Link: Beautiful Desktop &#8211; Gnome of OSX style on Linux'>Beautiful Desktop &#8211; Gnome of OSX style on Linux</a></li>
<li><a href='http://pkill.info/b/1873/mac-osx-like-gnome-theme-style/' rel='bookmark' title='Permanent Link: Mac OSX-like Gnome Theme Style'>Mac OSX-like Gnome Theme Style</a></li>
<li><a href='http://pkill.info/b/1522/gnome-style-shiki-colorsgnome-colors/' rel='bookmark' title='Permanent Link: Gnome Style: Shiki Colors+Gnome Colors'>Gnome Style: Shiki Colors+Gnome Colors</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>One annoying thing when using KDE desktop is that the theme and style of GTK applications differ from KDE&#8217;s. The <em>gtk-qt-engine</em> can let us select the theme for GTK applications in KDE desktop environment. But the mouse cursors for GTK application and QT applications are different if we set the cursor style in KDE&#8217;s setting tools. The cursor for GTK application changes to the default one when moving cursor from the desktop to GTK application such as Firefox. The is quite annoying. In this article, we will introduce a piece of tip to make the cursor the same style in both GTK and QT applications.</p>
<p>First, the <em>gtk-qt-engine</em> should have been installed to configure the theme for GTK application. If not, install it like this:</p>
<pre># yum install gtk-qt-engine</pre>
<p>You can find the cursor icons which you are using in KDE under <em>/usr/share/icons/</em>. Let&#8217;s use &#8220;<em>Oxygen_Blue&#8221; </em>which is my favourite one as the example.</p>
<p>After installing <em>gtk-qt-engine</em>, there is one configuration file for it: <em>~/.gtkrc-2.0-kde4</em>. It may be a little different depending on the package version.</p>
<p>To set the cursor icon theme for GTK application to <em>&#8220;Oxygen_Blue&#8221;</em>, add this like into <em>~/.gtkrc-2.0-kde4</em>:</p>
<pre>gtk-cursor-theme-name="Oxygen_BLUE"</pre>
<p>It can be changed to any icon theme&#8217;s name that we like. We may need to reload the KDE desktop after changing it. After reloading the desktop environment, try to open a GTK application and see whether the icons are the same in both kind of applications.</p>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/150/beautiful-desktop-gnome-of-osx-style-on-linux/' rel='bookmark' title='Permanent Link: Beautiful Desktop &#8211; Gnome of OSX style on Linux'>Beautiful Desktop &#8211; Gnome of OSX style on Linux</a></li>
<li><a href='http://pkill.info/b/1873/mac-osx-like-gnome-theme-style/' rel='bookmark' title='Permanent Link: Mac OSX-like Gnome Theme Style'>Mac OSX-like Gnome Theme Style</a></li>
<li><a href='http://pkill.info/b/1522/gnome-style-shiki-colorsgnome-colors/' rel='bookmark' title='Permanent Link: Gnome Style: Shiki Colors+Gnome Colors'>Gnome Style: Shiki Colors+Gnome Colors</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting KDE from Command Line by startx</title>
		<link>http://pkill.info/b/1896/starting-kde-from-command-line-by-startx/</link>
		<comments>http://pkill.info/b/1896/starting-kde-from-command-line-by-startx/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 15:17:11 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[client config]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Xorg]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=1896</guid>
		<description><![CDATA[I don&#8217;t use xdm, gdm or kdm&#8230; I prefer my Linux booting to init 3. I like logging in to the command-prompt and starting X manually with startx. In my Fedora Linux box, I always get to gnome even both gnome and KDE are installed. Actually the startx script is already written for most of [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/' rel='bookmark' title='Permanent Link: Sending Email from mailx Command in Linux Using Gmail’s Smtp'>Sending Email from mailx Command in Linux Using Gmail’s Smtp</a></li>
<li><a href='http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/' rel='bookmark' title='Permanent Link: Configuring Mouse Cursor Style for GTK Applications in KDE Desktop'>Configuring Mouse Cursor Style for GTK Applications in KDE Desktop</a></li>
<li><a href='http://pkill.info/b/1661/making-yum-not-update-kernel/' rel='bookmark' title='Permanent Link: Making yum not Update Kernel'>Making yum not Update Kernel</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t use <em>xdm</em>, <em>gdm</em> or <em>kdm</em>&#8230; I prefer my Linux booting to <em>init 3</em>. I like logging in to the command-prompt and starting X manually with <em>startx</em>. In my Fedora Linux box, I always get to gnome even both gnome and KDE are installed. Actually the <em>startx</em> script is already written for most of the modern desktop environment. What we need to do is open the &#8220;trigger&#8221;.</p>
<p>The <em>startx</em> script in Fedora will read <em>/etc/sysconfig/desktop </em>for the <em>&#8220;DESKTOP&#8221;</em> variable and starts the desktop environment depending on it. While the default value for <em>&#8220;DESKTOP&#8221;</em> is set to <em>&#8220;GNOME&#8221;</em>, we will get to gnome if we don&#8217;t set the variable. When we want to <em>startx</em> to KDE we just need to add one line to <em>/etc/sysconfig/desktop</em>:</p>
<pre>DESKTOP="KDE"</pre>
<p>If there is already one line that defines <em>&#8220;DESKTOP&#8221;</em>, just change the value of it.</p>
<p>Then we will start KDE when we run <em>startx </em>from console.</p>
<p><strong>Free additional gift</strong></p>
<p>The <em>&#8220;DISPLAYMANAGER&#8221; </em>in the <em>/etc/sysconfig/desktop</em> file is used to specify the default display manager. To make <em>KDM</em> the default display, just add this line:</p>
<pre>DISPLAYMANAGER="KDE"</pre>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/' rel='bookmark' title='Permanent Link: Sending Email from mailx Command in Linux Using Gmail’s Smtp'>Sending Email from mailx Command in Linux Using Gmail’s Smtp</a></li>
<li><a href='http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/' rel='bookmark' title='Permanent Link: Configuring Mouse Cursor Style for GTK Applications in KDE Desktop'>Configuring Mouse Cursor Style for GTK Applications in KDE Desktop</a></li>
<li><a href='http://pkill.info/b/1661/making-yum-not-update-kernel/' rel='bookmark' title='Permanent Link: Making yum not Update Kernel'>Making yum not Update Kernel</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/1896/starting-kde-from-command-line-by-startx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OSX-like Gnome Theme Style</title>
		<link>http://pkill.info/b/1873/mac-osx-like-gnome-theme-style/</link>
		<comments>http://pkill.info/b/1873/mac-osx-like-gnome-theme-style/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 12:08:13 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[client config]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=1873</guid>
		<description><![CDATA[The design of Mac OSX&#8217;s theme is very nice. I am always looking for a good theme for my Linux desktop. There are designs influenced by Mac&#8217;s style which looks pretty good in Gnome. These are screen shoots of my desktop. This theme is a mixture of Mac OS X Bundle 2.1[1], iRaveH20 3 Icon [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/1522/gnome-style-shiki-colorsgnome-colors/' rel='bookmark' title='Permanent Link: Gnome Style: Shiki Colors+Gnome Colors'>Gnome Style: Shiki Colors+Gnome Colors</a></li>
<li><a href='http://pkill.info/b/150/beautiful-desktop-gnome-of-osx-style-on-linux/' rel='bookmark' title='Permanent Link: Beautiful Desktop &#8211; Gnome of OSX style on Linux'>Beautiful Desktop &#8211; Gnome of OSX style on Linux</a></li>
<li><a href='http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/' rel='bookmark' title='Permanent Link: Configuring Mouse Cursor Style for GTK Applications in KDE Desktop'>Configuring Mouse Cursor Style for GTK Applications in KDE Desktop</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>The design of Mac OSX&#8217;s theme is very nice. I am always looking for a good theme for my Linux desktop. There are designs influenced by Mac&#8217;s style which looks pretty good in Gnome.</p>
<p>These are screen shoots of my desktop.</p>
<p><a href="http://picasaweb.google.com/lh/photo/pZp4da8Y-t4yi2yeKAVseQ?feat=embedwebsite"><img src="http://lh5.ggpht.com/_9GCSB4c6Upw/TDSwRq3yAyI/AAAAAAAAA9k/j1kLkkyfLXk/s400/mac-osx-like-gnome-theme-1.png" alt="" /></a><br />
<a href="http://picasaweb.google.com/lh/photo/XrBcvMPkjt7c2W-zIjzXng?feat=embedwebsite"><img src="http://lh5.ggpht.com/_9GCSB4c6Upw/TDSwR-gh97I/AAAAAAAAA9o/XwDrg6opTzA/s400/mac-osx-like-gnome-theme-2.png" alt="" /></a><br />
This theme is a mixture of Mac OS X Bundle 2.1[1], iRaveH20 3 Icon Theme (Full Gnome/XFCE) Lights 3.0 [2] and Oxygen-cursor-themes 4.4.4 which is originally designed for  KDE desktop[3].<br />
<a href="http://picasaweb.google.com/lh/photo/nua_wcBQNKjel8Ueude7zw?feat=embedwebsite"><img src="http://lh6.ggpht.com/_9GCSB4c6Upw/TDSwR6UG2GI/AAAAAAAAA9s/WxBBjEWQQ4I/s400/mac-osx-like-gnome-theme-4.png" alt="" /></a><br />
<a href="http://picasaweb.google.com/lh/photo/GJGlPCSTMTo7djFQnq8TTA?feat=embedwebsite"><img src="http://lh5.ggpht.com/_9GCSB4c6Upw/TDSwSMeI5NI/AAAAAAAAA9w/E99yXEBiOSs/s400/mac-osx-like-gnome-theme-5.png" alt="" /></a><br />
<a href="http://picasaweb.google.com/lh/photo/D6HPa439X1cGdPljtDZU3A?feat=embedwebsite"><img src="http://lh5.ggpht.com/_9GCSB4c6Upw/TDSwmMvIvjI/AAAAAAAAA90/8csNOnL9nEU/s400/mac-osx-like-gnome-theme-3.png" alt="" /></a></p>
<p>The theme controls, the window border and the desktop background comes from Mac OS X Bundle. Download the package from the link in gnome-look.org and unpack it. You can get one picture and two tarballs. Then they can be easily installed by using the &#8220;install&#8221; button in Gnome&#8217;s &#8220;Appearance Preference&#8221; tool. For the background picture, just copy it somewhere.</p>
<p>The iRaveH20 Icon theme can also be installed by the &#8220;install&#8221; button. The Oxygen cursor theme is already in Fedora&#8217;s repository. If you use another Linux distribution that have KDE desktop environment which is the usual case, you can easily install the cursor theme which is a part of KDE. In my box, I can install it by:</p>
<pre># yum install oxygen-cursor-theme</pre>
<p>After installing them, select any theme in the theme window and then click the &#8220;customize&#8221; button. The &#8220;Customize theme&#8221; window will appears. Select &#8220;mac-osx-controls&#8221; in the &#8220;Controls&#8221; tab, select &#8220;mac-osx-window&#8221; in &#8220;Window Border&#8221; tab, select &#8220;iRaveH20 3 Lights Edition&#8221; for icons and choose &#8220;Oxygen_Blue&#8221; for cursor them. The background can be added by clicking &#8220;add&#8221; button and choose the picture stored before.</p>
<p>This the style of mine. It&#8217;s stable and making me happy with my terminal. Of course, there are lots of other combination of these themes or others. Choose the one that you prefer ;) Linux is free and open for everyone.</p>
<p>Links:</p>
<p>[1] Mac OS X Bundle: <a href="http://gnome-look.org/content/show.php?content=28686">http://gnome-look.org/content/show.php?content=28686</a><br />
[2] iRaveH20 3 Icon Theme (Full Gnome/XFCE): <a href="http://gnome-look.org/content/show.php?content=119776">http://gnome-look.org/content/show.php?content=119776</a><br />
[3] KDE desktop: <a href="http://kde.org">http://kde.org</a></p>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/1522/gnome-style-shiki-colorsgnome-colors/' rel='bookmark' title='Permanent Link: Gnome Style: Shiki Colors+Gnome Colors'>Gnome Style: Shiki Colors+Gnome Colors</a></li>
<li><a href='http://pkill.info/b/150/beautiful-desktop-gnome-of-osx-style-on-linux/' rel='bookmark' title='Permanent Link: Beautiful Desktop &#8211; Gnome of OSX style on Linux'>Beautiful Desktop &#8211; Gnome of OSX style on Linux</a></li>
<li><a href='http://pkill.info/b/2186/configuring-mouse-cursor-style-for-gtk-applications-in-kde-desktop/' rel='bookmark' title='Permanent Link: Configuring Mouse Cursor Style for GTK Applications in KDE Desktop'>Configuring Mouse Cursor Style for GTK Applications in KDE Desktop</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/1873/mac-osx-like-gnome-theme-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Port Forwarding Using iptables</title>
		<link>http://pkill.info/b/816/port-forwarding-using-iptables/</link>
		<comments>http://pkill.info/b/816/port-forwarding-using-iptables/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 12:53:18 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[portforwarding]]></category>
		<category><![CDATA[server config]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://zhiqiangma.info/?p=816</guid>
		<description><![CDATA[Port forwarding is simple to do with iptables in a Linux box which may probably already being used as the firewall or part of the gateway operatioin. In Linux kernels, port forwarding is achieved by packet filter rules in iptables. Port forwarding Port forwarding also called &#8220;port mapping&#8221; commonly refers to the network address translator [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/818/port-forwarding-using-ssh-tunnel/' rel='bookmark' title='Permanent Link: Port forwarding using ssh tunnel'>Port forwarding using ssh tunnel</a></li>
<li><a href='http://pkill.info/b/1372/setting-up-gateway-using-iptables-and-route-on-linux/' rel='bookmark' title='Permanent Link: Setting Up Gateway Using iptables and  route on Linux'>Setting Up Gateway Using iptables and  route on Linux</a></li>
<li><a href='http://pkill.info/b/1764/changing-mac-address-in-linux-aka-mac-spoofing/' rel='bookmark' title='Permanent Link: Changing MAC Address in Linux aka. MAC Spoofing'>Changing MAC Address in Linux aka. MAC Spoofing</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Port forwarding is simple to do with <em>iptables</em> in a Linux box which may probably already being used as the firewall or part of the gateway operatioin. In Linux kernels, port forwarding is achieved by packet filter rules in iptables.</p>
<h3>Port forwarding</h3>
<p>Port forwarding also called &#8220;port mapping&#8221; commonly refers to the network address translator gateway changing the destination address and/or port of the packet to reach a host within a masqueraded, typically private, network.</p>
<p>Port forwarding can be used to allow remote computers (e.g., public machines on the Internet) to connect to a specific computer within a private network such as local area network (LAN), sothat xternal hosts can communicate with services provided by hosts within a LAN. For example, running a public HTTP server (port 80) on a host within a private LAN, or permitting secure shell <em>ssh</em> (port 22) access to hosts within the private LAN from the Internet.</p>
<p>In Unix/Linux box where port numbers below 1024 can only be listened by software running as root, port forwarding is also used to redirect incoming traffic from a low numbered port to software listening on a higher port. This software can be running as a normal user, which avoids the security risk caused by running as the root user.</p>
<h3>iptables</h3>
<p>iptables is a very powerfull firewall which handles packets based on the type of packet activity and enqueues the packet in one of its builtin &#8216;tables&#8217;. In Linux box, iptables is implemented in Linux kernel as some kernel modules.</p>
<p>There are three tables in total: mangle, filter and nat. The mangle table is responsible for the alteration of service bits in the TCP header. The filter queue is responsible for packet filtering. The nat table performs Network Address Translation (NAT). Each tables may have some built-in <em>chains</em> in which firewall policy <em>rules</em> can be placed.</p>
<p>The filter table has three built-in chains:<br />
* Forward chain: Filters packets destined for networks protected by the firewall.<br />
* Input chain: Filters packets destined for the firewall.<br />
* Output chain: Filters packets originating from the firewall.</p>
<p>The nat table has two built-in chains:<br />
* Pre-routing chain: NATs packets when the destination address of the packet needs to be changed.<br />
* Post-routing chain: NATs packets when the source address of the packet needs to be changed.</p>
<p>Below is a brief view of how packets are processed by the chains:</p>
<pre>PACKET IN
    |
PREROUTING--[routing]--&gt;--FORWARD--&gt;--POSTROUTING--&gt;--OUT
 - mangle      |           - mangle      - mangle
 - nat (dst)   |           - filter      - nat (src)
               |                            |
               |                            |
              INPUT                       OUTPUT
              - mangle                    - mangle
              - filter                    - nat (dst)
               |                          - filter
               |                            |
               `-----&gt;-----[app]-----&gt;------'</pre>
<p>We only look into the packets that requires port forwarding which is the topic of this post.</p>
<p>The packet entering the firewall is inspected by the rules in the nat table&#8217;s PREROUTING chain to see whether it requires destination modification (DNAT). The packet is then routed by Linux router after leaving the PREROUTING chain. The packet which is destined for a &#8220;protected&#8221; network is filtered by the rules in the FORWARD chain of the filter table. The it will go through the packet undergoes SNAT in the POSTROUTING chain before arriving at the &#8220;protected&#8221; network. When the destination server decides to reply, the packet undergoes the same sequence of steps.</p>
<h3>Port forwarding using iptables</h3>
<p>A port-forwarded packet will pass the PREROUTING chain in nat table, FORWARD chain in filter table, POSTROUTING chain in nat table and other chains. We need to add rules to these chains.</p>
<p>Let&#8217;s use a senario to introduce how to configure iptables to do port forwarding. Suppose our gateway can connect to both the Internet (0.0.0.0/0) and the LAN (192.168.1.0/24). The gateway&#8217;s eth0 interface has a public IP 7.8.9.10 while the eth1 has a LAN IP 192.168.1.1. Now, suppose that we have set up a HTTP server on 192.168.1.2:8080 and we want to provides service to the Internet through the public IP. We need to configure iptables to forward packets coming to port 80 of 7.8.9.10 to 8080 of 192.168.1.2 in LAN.</p>
<p>Below is the network topology:</p>
<pre>Internet---------[router/firewall]-------------LAN
0.0.0.0/0      7.8.9.10    192.168.1.1    192.168.1.0/24</pre>
<p>Normally we deny all incoming connections to a gateway machine by default because opening up all services and ports could be a security risk. We will only open the ports for the services that we will use. In this example, we will open port 80 for HTTP service.</p>
<p>This is the rules to forward connections on port 80 of the gateway to the internal machine:</p>
<pre># iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.1.2:8080
# iptables -A FORWARD -p tcp -d 192.168.1.2 --dport 8080 -j ACCEPT</pre>
<p>These two rules are straight forward. The first one specifies that all incoming tcp connections to port 80 should be sent to port 8080 of the internal machine 192.168.1.2. This rule alone doesn&#8217;t complete the job as described above that we deny all incoming connections by default. Then we accept the incoming connection to port 80 from eth0 which connect to the Internet with the publich IP by the second rule. From the process path in the &#8220;iptables&#8221; part, the packet will also pass the FORWARD chains. We add the second rule in FORWARD chain to allow forwarding the packets to port 8080 of 192.168.1.2.</p>
<p>By now, we have set up the the iptables rules for forwarding the 80 port. For other service, the method is similiar with the HTTP service.</p>
<h3>The conntrack entries</h3>
<p>The &#8220;nf_conntrack_*&#8221; kernel modules enables iptables to examine the status of connections by caching the related information for these connections. A cat of <em>/proc/net/nf_conntrack</em> (in some old Linux kernels, the file is /proc/net/ip_conntrack) will give a list of all the current entries in the conntrack database.</p>
<p>A conntrack entry looks like this:</p>
<pre>ipv4     2 tcp      6 431581 ESTABLISHED \
src=7.8.9.20 dst=7.8.9.10 sport=53867 dport=80 packets=22 bytes=13861 \
src=192.168.1.2 dst=7.8.9.20 sport=8080 dport=53867 packets=14 bytes=3535 \
[ASSURED] mark=0 secmark=0 use=2</pre>
<p>This entry contains all the information that the conntrack module maintains to know the state of a specific connection. We can find the version of ip protocal version and the decimal coding, the protocol and the normal decimal coding. After this, we get how long this conntrack entry should live. Next is the actual state that this entry is in at this present point of time. Then, we get the source IP address, destination IP address, source port and destination port. After that, we get the IPs and ports of both source and destination we expect of return packets.</p>
<p>In this entry we can find that the arriving connection is:</p>
<pre>7.8.9.20:53867 --&gt; 7.8.9.10:80</pre>
<p>while the returning connection is:</p>
<pre>192.168.1.2:8080 --&gt; 7.8.9.20:53867</pre>
<p>which reflects the port forwarding which we have set.</p>
<p><span style="font-size: x-small;"><strong>Update history:</strong><br />
Jun. 30, 2010. Add the rule in FORWARD chain.</span></p>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/818/port-forwarding-using-ssh-tunnel/' rel='bookmark' title='Permanent Link: Port forwarding using ssh tunnel'>Port forwarding using ssh tunnel</a></li>
<li><a href='http://pkill.info/b/1372/setting-up-gateway-using-iptables-and-route-on-linux/' rel='bookmark' title='Permanent Link: Setting Up Gateway Using iptables and  route on Linux'>Setting Up Gateway Using iptables and  route on Linux</a></li>
<li><a href='http://pkill.info/b/1764/changing-mac-address-in-linux-aka-mac-spoofing/' rel='bookmark' title='Permanent Link: Changing MAC Address in Linux aka. MAC Spoofing'>Changing MAC Address in Linux aka. MAC Spoofing</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/816/port-forwarding-using-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NVIDIA Driver in Linux not Displaying Logo During Booting</title>
		<link>http://pkill.info/b/1768/nvidia-driver-in-linux-not-displaying-logo-during-booting/</link>
		<comments>http://pkill.info/b/1768/nvidia-driver-in-linux-not-displaying-logo-during-booting/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 10:37:29 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[client config]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[Xorg. tip]]></category>

		<guid isPermaLink="false">http://pkill.info/blog/?p=1768</guid>
		<description><![CDATA[The NVIDIA video card driver in Linux will display the NVIDIA logo by default during booting the X server after we successfully installed the driver. If we don&#8217;t like to see the logo every time we start X server, we can disable it. We need to edit the Xorg configuration file /etc/X11/xorg.conf with root permission. [...]

<b>Read more:</b><ul><li><a href='http://pkill.info/b/1484/installing-nvidia-driver-on-fedora/' rel='bookmark' title='Permanent Link: Installing Nvidia Driver on Fedora'>Installing Nvidia Driver on Fedora</a></li>
<li><a href='http://pkill.info/b/244/install-nvidia-driver-on-fedora/' rel='bookmark' title='Permanent Link: Install nvidia driver on Fedora'>Install nvidia driver on Fedora</a></li>
<li><a href='http://pkill.info/b/1638/setting-up-ecryptfs-in-linux/' rel='bookmark' title='Permanent Link: Setting up eCryptFS in Linux'>Setting up eCryptFS in Linux</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>The NVIDIA video card driver in Linux will display the NVIDIA logo by default during booting the X server after we successfully installed the driver. If we don&#8217;t like to see the logo every time we start X server, we can disable it.</p>
<p>We need to edit<em> </em>the Xorg configuration file<em> /etc/X11/xorg.conf</em> with root permission. Add a line &#8216; <em>Option &#8220;NoLogo&#8221; </em>&#8216; within the <em>“Device” </em>section which configuring the NVIDIA driver will disable the logo.</p>
<p>This is my xorg.conf file. I use two screen (a big LED and my laptop&#8217;s screen) and the screen of my laptop&#8217;s DPI is 96&#215;96.</p>
<pre># Xorg configuration created by Zhiqiang Ma (http://pkill.info)
# Section "ServerFlags"
# 	Option	    "AIGLX" "on"
# EndSection

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
    ModulePath      "/usr/lib/xorg/modules/extensions/nvidia"
    ModulePath      "/usr/lib/xorg/modules"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us"
    Option         "XkbModel" "pc105"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Philips 170B"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 76.0
    Option         "UseEdidDpi" "false"
    Option         "DPI" "96 x 96"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce G 105M"
<strong>    Option         "NoLogo"
</strong>EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

# Section "Extensions"
#     Option         "Composite" "Enable"
# EndSection
</pre>


<b>Read more:</b><ul><li><a href='http://pkill.info/b/1484/installing-nvidia-driver-on-fedora/' rel='bookmark' title='Permanent Link: Installing Nvidia Driver on Fedora'>Installing Nvidia Driver on Fedora</a></li>
<li><a href='http://pkill.info/b/244/install-nvidia-driver-on-fedora/' rel='bookmark' title='Permanent Link: Install nvidia driver on Fedora'>Install nvidia driver on Fedora</a></li>
<li><a href='http://pkill.info/b/1638/setting-up-ecryptfs-in-linux/' rel='bookmark' title='Permanent Link: Setting up eCryptFS in Linux'>Setting up eCryptFS in Linux</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://pkill.info/b/1768/nvidia-driver-in-linux-not-displaying-logo-during-booting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
