<?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>细柳营</title>
	<atom:link href="http://huang.yunsong.net/feed" rel="self" type="application/rss+xml" />
	<link>http://huang.yunsong.net</link>
	<description>前尘往昔逝如烟 曾忆风云舞九天</description>
	<lastBuildDate>Mon, 02 Jan 2012 17:49:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Customize CyanogenMod ROM</title>
		<link>http://huang.yunsong.net/2012/customize-cm-android-rom.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=customize-cm-android-rom</link>
		<comments>http://huang.yunsong.net/2012/customize-cm-android-rom.html#comments</comments>
		<pubDate>Mon, 02 Jan 2012 09:43:40 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=423</guid>
		<description><![CDATA[不知道还有多少人在坚持使用早期的 Android 设备，比如 HTC Dream (G1)、Magic (G2) 等。上个月某天午饭时，一个同事说她最近入手了 Sensation (G14)，因为原先的那台 Hero (G3) 实在太慢了。嗯，想起了 Richard Jones 说的——Android is the new Windows. 多数情况下，用户不会去管操作系统，于是太多的硬件资源被不必要地占用了，而且还带来不稳定性。但 Android 的开放性使得用户可以对其进行裁减/定制，最原始的做法是直接从源码开始，不过这太麻烦了，另一种做法是修改已经存在的 ROM 安装包。 我依然在使用 G2，已经两年半了，机器里跑的是基于 CM 6.1.0 裁减之后的版本，速度和稳定性都是能接受的。下表（Table 1）列出了修改细节： Table 1. CyanogenMod ROM 程序包 用途 改变 AccountAndSyncSettings.apk 账户同步设置 &#8230; <a href="http://huang.yunsong.net/2012/customize-cm-android-rom.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>不知道还有多少人在坚持使用早期的 Android 设备，比如 HTC Dream (G1)、Magic (G2) 等。上个月某天午饭时，一个同事说她最近入手了 Sensation (G14)，因为原先的那台 Hero (G3) 实在太慢了。嗯，想起了 Richard Jones 说的——<a href="http://rwmj.wordpress.com/2011/12/20/android-is-the-new-windows/">Android is the new Windows</a>. 多数情况下，用户不会去管操作系统，于是太多的硬件资源被不必要地占用了，而且还带来不稳定性。但 Android 的开放性使得用户可以对其进行裁减/定制，最原始的做法是<a href="http://wiki.cyanogenmod.com/wiki/HTC_Dream_%26_Magic:_Compile_CyanogenMod_(Linux)" title="HTC Dream &amp; Magic: Compile CyanogenMod (Linux)">直接从源码开始</a>，不过这太麻烦了，另一种做法是修改已经存在的 ROM 安装包。</p>
<p>我依然在使用 G2，<a href="http://huang.yunsong.net/2009/my-must-have-android-apps.html">已经两年半了</a>，机器里跑的是基于 <a href="http://goo-inside.me/cm/dream_sapphire/stable/update-cm-6.1.0-DS-signed.zip" title="CyanogenMod 6.1.0 DS 原版">CM 6.1.0</a> 裁减之后的版本，速度和稳定性都是能接受的。下表（Table 1）列出了修改细节：</p>
<p><strong>Table 1.</strong> CyanogenMod ROM</p>
<table>
<tr>
<td><b>程序包</b></td>
<td><b>用途</b></td>
<td><b>改变</b></td>
</tr>
<tr>
<td>AccountAndSyncSettings.apk</td>
<td>账户同步设置</td>
<td>保留</td>
</tr>
<tr>
<td>ADWLauncher.apk</td>
<td>ADW 桌面起动器</td>
<td>保留</td>
</tr>
<tr>
<td>AndroidTerm.apk</td>
<td>终端模拟器</td>
<td>删除</td>
</tr>
<tr>
<td>ApplicationsProvider.apk</td>
<td>应用程序信息存储器</td>
<td>保留</td>
</tr>
<tr>
<td>Bluetooth.apk</td>
<td>蓝牙服务</td>
<td>保留</td>
</tr>
<tr>
<td>Browser.apk</td>
<td>浏览器</td>
<td>保留</td>
</tr>
<tr>
<td>Calculator.apk</td>
<td>计算器</td>
<td>删除</td>
</tr>
<tr>
<td>Calendar.apk</td>
<td>日历</td>
<td>保留</td>
</tr>
<tr>
<td>CalendarProvider.apk</td>
<td>日历存储器</td>
<td>保留</td>
</tr>
<tr>
<td>Camera.apk</td>
<td>照相机</td>
<td>保留</td>
</tr>
<tr>
<td>CertInstaller.apk</td>
<td>证书安装器</td>
<td>保留</td>
</tr>
<tr>
<td>CMParts.apk</td>
<td>CM 高级设置</td>
<td>保留</td>
</tr>
<tr>
<td>CMPartsHelper.apk</td>
<td>CM 提示</td>
<td>保留</td>
</tr>
<tr>
<td>CMStats.apk</td>
<td>CM 统计</td>
<td>删除</td>
</tr>
<tr>
<td>CMWallpapers.apk</td>
<td>CM 壁纸</td>
<td>删除</td>
</tr>
<tr>
<td>Contacts.apk</td>
<td>联系人</td>
<td>保留</td>
</tr>
<tr>
<td>ContactsProvider.apk</td>
<td>联系人存储器</td>
<td>保留</td>
</tr>
<tr>
<td>DefaultContainerService.apk</td>
<td>默认通讯录服务</td>
<td>保留</td>
</tr>
<tr>
<td>DeskClock.apk</td>
<td>闹钟时钟</td>
<td>保留</td>
</tr>
<tr>
<td>Development.apk</td>
<td>开发者调试工具</td>
<td>删除</td>
</tr>
<tr>
<td>DownloadProvider.apk</td>
<td>下载支持服务</td>
<td>保留</td>
</tr>
<tr>
<td>DrmProvider.apk</td>
<td>DRM受保护数据存储服务</td>
<td>保留</td>
</tr>
<tr>
<td>DSPManager.apk</td>
<td>DSP音频特效管理器</td>
<td>删除</td>
</tr>
<tr>
<td>Email.apk</td>
<td>电子邮箱</td>
<td>删除</td>
</tr>
<tr>
<td>FileManager.apk</td>
<td>文件管理器</td>
<td>保留</td>
</tr>
<tr>
<td>Gallery3D.apk</td>
<td>3D 图库</td>
<td>删除</td>
</tr>
<tr>
<td>HTMLViewer.apk</td>
<td>HTML查看器</td>
<td>保留</td>
</tr>
<tr>
<td>LatinIME.apk</td>
<td>拉丁输入法</td>
<td>保留</td>
</tr>
<tr>
<td>LiveWallpapersPicker.apk</td>
<td>动态壁纸查看器</td>
<td>删除</td>
</tr>
<tr>
<td>MediaProvider.apk</td>
<td>媒体支持</td>
<td>保留</td>
</tr>
<tr>
<td>Mms.apk</td>
<td>短信彩信</td>
<td>保留</td>
</tr>
<tr>
<td>Music.apk</td>
<td>音乐播放器</td>
<td>删除</td>
</tr>
<tr>
<td>PackageInstaller.apk</td>
<td>应用安装程序</td>
<td>保留</td>
</tr>
<tr>
<td>Phone.apk</td>
<td>电话</td>
<td>保留</td>
</tr>
<tr>
<td>PicoTts.apk</td>
<td>语音朗读引擎</td>
<td>删除</td>
</tr>
<tr>
<td>Protips.apk</td>
<td>桌面帮助提示小插件</td>
<td>删除</td>
</tr>
<tr>
<td>Provision.apk</td>
<td>设置向导</td>
<td>保留</td>
</tr>
<tr>
<td>QuickSearchBox.apk</td>
<td>快速搜索框</td>
<td>删除</td>
</tr>
<tr>
<td>RomManager.apk</td>
<td>ROM 管理器</td>
<td>删除</td>
</tr>
<tr>
<td><a href="http://huang.yunsong.net/data/RootExplorer.apk">RootExplorer.apk</a></td>
<td>ROOT 文件管理器</td>
<td>新增</td>
</tr>
<tr>
<td>Settings.apk</td>
<td>系统设置</td>
<td>保留</td>
</tr>
<tr>
<td>SettingsProvider.apk</td>
<td>系统设置存储器</td>
<td>保留</td>
</tr>
<tr>
<td>SoundRecorder.apk</td>
<td>录音机</td>
<td>删除</td>
</tr>
<tr>
<td>SpareParts.apk</td>
<td>附加选项</td>
<td>保留</td>
</tr>
<tr>
<td>Stk.apk</td>
<td>SIM卡工具包</td>
<td>保留</td>
</tr>
<tr>
<td>Superuser.apk</td>
<td>超级用户</td>
<td>保留</td>
</tr>
<tr>
<td>TelephonyProvider.apk</td>
<td>拨号器储存</td>
<td>保留</td>
</tr>
<tr>
<td>TtsService.apk</td>
<td>语音服务</td>
<td>删除</td>
</tr>
<tr>
<td>UserDictionaryProvider.apk</td>
<td>用户字典存储服务</td>
<td>保留</td>
</tr>
<tr>
<td>VoicDialer.apk</td>
<td>语音拨号</td>
<td>删除</td>
</tr>
<tr>
<td>VpnServices.apk</td>
<td>VPN 服务</td>
<td>保留</td>
</tr>
</table>
<p>你可以下载以上裁减之后的包：<a href="http://huang.yunsong.net/data/update-cm-6.1.0-DS-lite-signed.zip" title="CyanogenMod 6.1.0 DS 精简版 by R.H.">update-cm-6.1.0-DS-lite-signed.zip</a> (48M)<br />
如果你的手机是 G1 或者 G2 32B，直接刷这个包就行了。如果你的手机是 G2 32A (EBL1)，还需要刷一个 <a href="http://briancrook.ca/android/cm-ports/bc-6.1.0-ebi1-signed.zip" title="EBL1 port">port 包</a>。</p>
<p><font style="color: #ff0000"><strong>（OPTIONAL）</strong></font>注意，以上 ROM 是不包含 Google Addons 的，如果你需要 Google 提供的一些功能，比如 Gtalk、电子市场等的，需要刷 gapps 包。当然，我们也可以做一些裁减。以下表格（Table 2）所列是对 <a href="http://goo-inside.me/gapps/gapps-mdpi-20110501-signed.zip" title="gapps mdpi 20110501 原版">gapps-mdpi-20110501</a> 的修改：</p>
<p><strong>Table 2.</strong> gapps</p>
<table>
<tr>
<td><b>程序包</b></td>
<td><b>用途</b></td>
<td><b>改变</b></td>
</tr>
<tr>
<td>CarHomeGoogle.apk</td>
<td>车载模式主程序</td>
<td>删除</td>
</tr>
<tr>
<td>CarHomeLauncher.apk</td>
<td>车载模式主屏幕</td>
<td>删除</td>
</tr>
<tr>
<td>Facebook.apk</td>
<td>Facebook</td>
<td>删除</td>
</tr>
<tr>
<td>GenieWidget.apk</td>
<td>天气和资讯挂件</td>
<td>删除</td>
</tr>
<tr>
<td>Gmail.apk</td>
<td>Gmail</td>
<td>删除</td>
</tr>
<tr>
<td>GoogleBackupTransport.apk</td>
<td>Google 备份传输</td>
<td>删除</td>
</tr>
<tr>
<td>GoogleCalendarSyncAdapter.apk</td>
<td>Google 日历同步</td>
<td>保留</td>
</tr>
<tr>
<td>GoogleContactsSyncAdapter.apk</td>
<td>Google 联系人同步</td>
<td>保留</td>
</tr>
<tr>
<td>GoogleFeedback.apk</td>
<td>Google 反馈</td>
<td>删除</td>
</tr>
<tr>
<td>GooglePartnerSetup.apk</td>
<td>Google 伙伴设置</td>
<td>保留</td>
</tr>
<tr>
<td>GoogleQuickSearchBox.apk</td>
<td>Google 快速搜索框</td>
<td>删除</td>
</tr>
<tr>
<td>GoogleServicesFramework.apk</td>
<td>Google 服务框架</td>
<td>保留</td>
</tr>
<tr>
<td>googlevoice.apk</td>
<td>Google 语音</td>
<td>删除</td>
</tr>
<tr>
<td>HtcCopyright.apk</td>
<td>HTC 版权</td>
<td>删除</td>
</tr>
<tr>
<td>HtcEmailPolicy.apk</td>
<td>HTC 电邮政策</td>
<td>删除</td>
</tr>
<tr>
<td>HtcSettings.apk</td>
<td>HTC 设置</td>
<td>删除</td>
</tr>
<tr>
<td>kickback.apk</td>
<td>操作振动回馈</td>
<td>删除</td>
</tr>
<tr>
<td>LatinImeTutorial.apk</td>
<td>拉丁输入法教程</td>
<td>删除</td>
</tr>
<tr>
<td>Maps.apk</td>
<td>Google 地图</td>
<td>删除</td>
</tr>
<tr>
<td>MarketUpdater.apk</td>
<td>电子市场升级程序</td>
<td>保留</td>
</tr>
<tr>
<td>MediaUploader.apk</td>
<td>媒体上载</td>
<td>保留</td>
</tr>
<tr>
<td>NetworkLocation.apk</td>
<td>网络位置</td>
<td>保留</td>
</tr>
<tr>
<td>OneTimeInitializer.apk</td>
<td>首次初始化工具</td>
<td>保留</td>
</tr>
<tr>
<td>PassionQuickOffice.apk</td>
<td>办公工具</td>
<td>删除</td>
</tr>
<tr>
<td>SetupWizard.apk</td>
<td>设置向导</td>
<td>保留</td>
</tr>
<tr>
<td>soundback.apk</td>
<td>操作声音回馈</td>
<td>删除</td>
</tr>
<tr>
<td>Street.apk</td>
<td>街景</td>
<td>删除</td>
</tr>
<tr>
<td>Talk.apk</td>
<td>Gtalk</td>
<td>保留</td>
</tr>
<tr>
<td>talkback.apk</td>
<td>辅助功能</td>
<td>删除</td>
</tr>
<tr>
<td>Twitter.apk</td>
<td>Twitter</td>
<td>删除</td>
</tr>
<tr>
<td>Vending.apk</td>
<td>电子市场</td>
<td>保留</td>
</tr>
<tr>
<td>VoiceSearch.apk</td>
<td>语音搜索</td>
<td>删除</td>
</tr>
<tr>
<td>YouTube.apk</td>
<td>YouTube</td>
<td>删除</td>
</tr>
</table>
<p>你可以下载以上裁减之后的 Google Addons 包：<a href="http://huang.yunsong.net/data/gapps-mdpi-20110501-lite-signed.zip" title="gapps mdpi 20110501 精简版 by R.H.">gapps-mdpi-20110501-lite-signed.zip</a> (3M)</p>
<p><font style="color: #ff0000"><strong>注：</strong></font>如果你自行修改了 ROM，一定要对新包进行签名，否则无法刷。android.com 上有指南：<a href="http://developer.android.com/guide/publishing/app-signing.html">Signing Your Applications</a>，就是使用 keytool、jarsigner 两个工具。</p>
<p>如此精简之后，你的“老旧”安卓手机应该也不会表现的太差，have fune ^o^</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2012/customize-cm-android-rom.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Debian from USB Stick</title>
		<link>http://huang.yunsong.net/2011/install-debian-usb.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=install-debian-usb</link>
		<comments>http://huang.yunsong.net/2011/install-debian-usb.html#comments</comments>
		<pubDate>Mon, 26 Dec 2011 08:07:30 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=415</guid>
		<description><![CDATA[This post describes how to install Debian Testing (current Testing is Wheezy). The procedure for installing Debian Stable (current Stable is Squeeze) is same, only the download links are different. 1. Install the necessary tools on your computer which runs &#8230; <a href="http://huang.yunsong.net/2011/install-debian-usb.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post describes how to install Debian Testing (current Testing is Wheezy). The procedure for installing Debian Stable (current Stable is Squeeze) is same, only the download links are different.</p>
<p>1. Install the necessary tools on your computer which runs a Linux as operating system. My ThinkPad runs Ubuntu 10.10:<br />
<code>$ sudo apt-get install mtools syslinux</code></p>
<p>2. Insert a USB stick into your computer, in most cases, your Linux should mount the USB disk automatically. If so, umount if firstly:<br />
<code>$ sudo umount /path/to/mount/point</code></p>
<p>3. Check the partitions information of the USB disk (assume the device is /dev/sdb):<br />
<code>$ sudo fdisk -l /dev/sdb</code></p>
<p>If the USB disk is never initialized and has no partition table, you need to create at least one partition on it.</p>
<p>4. Format (one partition is enough):<br />
<code>$ sudo mkdosfs /dev/sdb1</code></p>
<p>5. Install syslinux:<br />
<code>$ sudo syslinux /dev/sdb1</code></p>
<p>6. Mount the USB disk, and put necessary files into it:<br />
<code>$ sudo mount /dev/sdb1 /mnt<br />
$ cd /mnt<br />
$ sudo wget http://d-i.debian.org/daily-images/amd64/daily/hd-media/vmlinuz<br />
$ sudo wget http://d-i.debian.org/daily-images/amd64/daily/hd-media/initrd.gz<br />
$ sudo wget http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/amd64/iso-cd/debian-testing-amd64-netinst.iso</code></p>
<p><em>Notes:</em> Of course, since downloading images is time-consuming, you can download them separately and copy into the USB disk.</p>
<p>7. Create configuration file syslinux.cfg<br />
<code>$ cd /mnt<br />
$ sudo vi syslinux.cfg</code></p>
<pre>default vmlinuz
append initrd=initrd.gz</pre>
<p>Umount the USB disk, it&#8217;s ready for use then.</p>
<p>No CD/DVD, more green <img src='http://huang.yunsong.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/install-debian-usb.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a Xen Virtual Machine</title>
		<link>http://huang.yunsong.net/2011/create-xen-vm.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=create-xen-vm</link>
		<comments>http://huang.yunsong.net/2011/create-xen-vm.html#comments</comments>
		<pubDate>Wed, 07 Dec 2011 06:40:01 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=408</guid>
		<description><![CDATA[This tutorial shows how to create a VM (virtual machine) on Xen and install CentOS 6.0. 1. Prepare Virtual Disk Image Xen supports to run VM on physical device or virtual disk image. Here I am going to use virtual &#8230; <a href="http://huang.yunsong.net/2011/create-xen-vm.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This tutorial shows how to create a VM (virtual machine) on Xen and install CentOS 6.0.</p>
<p><strong>1. Prepare Virtual Disk Image</strong></p>
<p>Xen supports to run VM on physical device or virtual disk image. Here I am going to use virtual disk image in raw format. The below creates a 8G virtual disk for root partition, and a 512M virtual disk for swap:</p>
<p><code># dd if=/dev/zero of=centos6.img bs=4K count=0 seek=2048K<br />
# dd if=/dev/zero of=centos6.swp bs=4K count=0 seek=128K</code></p>
<p>Or, you can use <code>qemu-img</code> utility to replace <code>dd</code>:</p>
<p><code># qemu-img create -f raw centos6.img 8G<br />
# qemu-img create -f raw centos6.swp 512M</code></p>
<p><strong>2. Prepare Configuration for Xen VM installation</strong></p>
<p>Xen needs three files to install a VM: kernel, ramdisk, and a configuration file.</p>
<p>You can always find appropriate kernel and ramdisk from your Linux distribution&#8217;s website, for example, CentOS 6.0:</p>
<p><code># wget http://mirror.centos.org/centos/6.0/os/x86_64/isolinux/vmlinuz<br />
# wget http://mirror.centos.org/centos/6.0/os/x86_64/isolinux/initrd.img</code></p>
<p>And create a Xen configuration file:</p>
<p><code># vi centos6-x64-domu</code></p>

<div class="wp_syntax"><div class="code"><pre class="properties" style="font-family:monospace;"><span style="color: #000080; font-weight:bold;">kernel</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;/data/vm/vmlinuz&quot;</span>
<span style="color: #000080; font-weight:bold;">ramdisk</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;/data/vm/initrd.img&quot;</span>
<span style="color: #000080; font-weight:bold;">name</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;xc6&quot;</span>
<span style="color: #000080; font-weight:bold;">memory</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;512&quot;</span>
<span style="color: #000080; font-weight:bold;">disk</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> <span style="">&#91;</span> </span><span style="color: #933;">&quot;file:/data/vm/centos6.img,xvda,w&quot;</span>,<span style="color: #933;">&quot;file:/data/vm/centos6.swp,xvdb,w&quot;</span> <span style="">&#93;</span>
<span style="color: #000080; font-weight:bold;">vif</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> <span style="">&#91;</span> </span><span style="color: #933;">&quot;bridge=br0&quot;</span> <span style="">&#93;</span>
<span style="color: #000080; font-weight:bold;">vcpus</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> 1</span>
<span style="color: #000080; font-weight:bold;">on_reboot</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;destroy&quot;</span>
<span style="color: #000080; font-weight:bold;">on_crash</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;destroy&quot;</span></pre></div></div>

<p><em>Notes:</em></p>
<p>file: uses dom0 kernel page cache, and thus might give better performance than phy: or tap:aio:, but it&#8217;s also more insecure because of caching. tap:aio: uses direct IO, so it bypasses dom0 kernel cache, and works like phy: in that sense. Refer to <a href="http://wiki.xen.org/wiki/Blktap">blktap</a> on Xen&#8217;s wiki to understand more.</p>
<p>Please be aware:<br />
1, your dom0 must have loaded blktap modules before you can use tap:aio:. Not every Linux distribution has built everything in.<br />
2, if your blktap is version 2 (i.e., <a href="http://wiki.xen.org/wiki/Blktap2">blktap2</a>), for example, Debian Wheezy, you need to use tap2:tapdisk:aio: etc.</p>
<p><strong>3. Start Installing</strong></p>
<p>Now it&#8217;s time to create the VM and start installing CentOS 6.0 in it:</p>
<p><code># xm create centos6-x64-domu</code></p>
<p>Then you can connect to the virtual console, and do regular OS installation:</p>
<p><code># xm console xc6</code></p>
<p><strong>4. Change Configuration for Xen VM Normal Operation</strong></p>
<p>After the OS is installed, the VM is destroyed. You need to edit the configuration from Xen VM installation to normal operation.</p>
<p><code># vi centos6-x64-domu</code></p>

<div class="wp_syntax"><div class="code"><pre class="properties" style="font-family:monospace;"><span style="color: #000080; font-weight:bold;">name</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;xc6&quot;</span>
<span style="color: #000080; font-weight:bold;">memory</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;512&quot;</span>
<span style="color: #000080; font-weight:bold;">disk</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> <span style="">&#91;</span> </span><span style="color: #933;">&quot;file:/data/vm/centos6.img,xvda,w&quot;</span>,<span style="color: #933;">&quot;file:/data/vm/centos6.swp,xvdb,w&quot;</span> <span style="">&#93;</span>
<span style="color: #000080; font-weight:bold;">vif</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> <span style="">&#91;</span> </span><span style="color: #933;">&quot;bridge=br0&quot;</span> <span style="">&#93;</span>
<span style="color: #000080; font-weight:bold;">bootloader</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;/usr/lib/xen-4.1/bin/pygrub&quot;</span>
<span style="color: #000080; font-weight:bold;">vcpus</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> 1</span>
<span style="color: #000080; font-weight:bold;">on_reboot</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;restart&quot;</span>
<span style="color: #000080; font-weight:bold;">on_crash</span> <span style="color: #000000;">=</span> <span style="color: #933;">&quot;destroy&quot;</span></pre></div></div>

<p>The new configuration uses <code>pygrub</code> as a bootloader that acts grub and uses <code>grub.conf</code> from inside the VM. Of course, you can continue using the separated kernel and ramdisk, but this means you need to maitain them by yourselves.</p>
<p>Then you can start your VM by typing:</p>
<p><code># xm create centos6-x64-domu</code></p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/create-xen-vm.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QEMU-KVM with SPICE Support on Ubuntu 11.10 64-bit</title>
		<link>http://huang.yunsong.net/2011/ubuntu-oneiric-qemu-kvm-spice.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-oneiric-qemu-kvm-spice</link>
		<comments>http://huang.yunsong.net/2011/ubuntu-oneiric-qemu-kvm-spice.html#comments</comments>
		<pubDate>Sun, 16 Oct 2011 09:08:40 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[spice]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=401</guid>
		<description><![CDATA[SPICE server requires 64-bit system. Make sure you are running Oneiric x86_64. 1. Remove AppArmor $ sudo invoke-rc.d apparmor stop $ sudo update-rc.d -f apparmor remove $ sudo apt-get autoremove --purge apparmor $ sudo reboot After the machine is rebooted, &#8230; <a href="http://huang.yunsong.net/2011/ubuntu-oneiric-qemu-kvm-spice.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>SPICE server requires 64-bit system. Make sure you are running Oneiric x86_64.</p>
<p><strong>1. Remove <a href="https://wiki.ubuntu.com/AppArmor">AppArmor</a></strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> invoke-rc.d apparmor stop
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> apparmor remove
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> autoremove <span style="color: #660033;">--purge</span> apparmor
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> reboot</pre></div></div>

<p>After the machine is rebooted, you can check if there are configurations or data folders not deleted automatically, if yes, you can delete them safely, for example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-fr</span> apparmor<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p><strong>2. Configure Bridge</strong> (optional)</p>
<p>This step is only required when you want to provide ethernet bridging for VMs.</p>
<p>First of all, bridging tool needs to be installed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> bridge-utils</pre></div></div>

<p>By default, Ubuntu uses <a href="http://projects.gnome.org/NetworkManager/">NetworkManager</a> to configure network devices automatically. But here we need to edit the configuration file manually to add bridging settings:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>interfaces</pre></div></div>

<blockquote><p>auto lo<br />
iface lo inet loopback</p>
<p>auto eth0<br />
iface eth0 inet manual</p>
<p>auto br0<br />
iface br0 inet static<br />
address 192.168.96.88<br />
netmask 255.255.255.0<br />
network 192.168.96.0<br />
broadcast 192.168.96.255<br />
gateway 192.168.96.1<br />
bridge_ports eth0<br />
bridge_stp off<br />
bridge_fd 0<br />
bridge_maxwait 0</p></blockquote>
<p>If your machine is using DHCP for IP configuration, change the third section (device br0) to:</p>
<blockquote><p>auto br0<br />
iface br0 inet dhcp<br />
bridge_ports eth0<br />
bridge_stp off<br />
bridge_fd 0<br />
bridge_maxwait 0</p></blockquote>
<p>Save your configuration file, and restart network to take effect:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> invoke-rc.d networking stop
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> invoke-rc.d networking start</pre></div></div>

<p>Or, if you are working remotely, stopping network will disconnect you to the machine, just do reboot machine alternatively.</p>
<p>After restarted network or rebooted machine, use <code>ifconfig</code> and <code>brctl show</code> to check if ethernet briding works as expected.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ brctl show
bridge name	bridge <span style="color: #c20cb9; font-weight: bold;">id</span>		STP enabled	interfaces
br0		8000.5c63bf86e499	no		eth0</pre></div></div>

<p><strong>3. Install KVM and SPICE packages</strong></p>
<p>The <code>qemu-kvm</code> version in Oneiric is 0.14, but Ubuntu&#8217;s compilation does not include SPICE support. We have to use another repository which has compiled <code>qemu-kvm</code> with SPICE support.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-add-repository ppa:bderzhavets<span style="color: #000000; font-weight: bold;">/</span>qemu-git
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update</pre></div></div>

<p>I don&#8217;t know if there are the other repositories better than the above found in <a href="https://wiki.ubuntu.com/spice">Ubuntu wiki</a>. But at least it works.</p>
<p>Install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> qemu-kvm virt-manager spice libspice-server</pre></div></div>

<p>After installed the packages, your Oneiric is ready to run VM with SPICE support. Refer to <a href="http://huang.yunsong.net/2011/spice-windows-guest.html" title="Install a Windows Guest with SPICE">another post</a> to learn how to install guest with SPICE support.</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/ubuntu-oneiric-qemu-kvm-spice.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>iptables in Ubuntu</title>
		<link>http://huang.yunsong.net/2011/ubuntu-iptables.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-iptables</link>
		<comments>http://huang.yunsong.net/2011/ubuntu-iptables.html#comments</comments>
		<pubDate>Wed, 12 Oct 2011 17:08:55 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=394</guid>
		<description><![CDATA[Since 7.10, Ubuntu uses UFW to manage firewall. Well, UFW is easier than iptables, but I prefer to use iptables directly. Keep it less layers. Stop and remove UFW: $ sudo invoke-rc.d ufw remove $ sudo update-rc.d -f ufw remove &#8230; <a href="http://huang.yunsong.net/2011/ubuntu-iptables.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since 7.10, Ubuntu uses <a href="https://help.ubuntu.com/community/UFW">UFW</a> to manage firewall. Well, UFW is easier than iptables, but I prefer to use iptables directly. Keep it less layers.</p>
<p>Stop and remove UFW:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> invoke-rc.d ufw remove
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> ufw remove
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> autoremove <span style="color: #660033;">--purge</span> ufw</pre></div></div>

<p>Then install a utility for loading iptables rules at boot-time:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> iptables-persistent</pre></div></div>

<p>By default the iptables rules are stored in <code>/etc/iptables/rules.v4</code>.</p>
<p><strong>Sample 1:</strong> configure a dual-NIC Linux box as a NAT gateway. Let&#8217;s assume <code>eth0</code> be connected with external network, <code>eth1</code> be connected with internal network, and the internal network is 192.168.96.0/24.</p>
<p>Use editor to open the above file, and add the following line under <code>POSTROUTING ACCEPT</code> chain of <code>nat</code> table:</p>
<blockquote><p>-A POSTROUTING -s 192.168.96.0/24 ! -d 192.168.96.0/24 -o eth0 -j MASQUERADE</p></blockquote>
<p><strong>Sample 2:</strong> Open ports. Assume needs to open TCP ports 22, 53, 80, and 5900-5920.</p>
<p>Adding the below line under <code>INPUT ACCEPT</code> chain of <code>filter</code> table:</p>
<blockquote><p>-A INPUT -p tcp -m multiport &dash;-dports 5900:5920 -j ACCEPT<br />
-A INPUT -p tcp -m multiport &dash;-dports 22,53,80 -j ACCEPT</p></blockquote>
<p>&lt;EOF&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/ubuntu-iptables.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install a Windows Guest with SPICE</title>
		<link>http://huang.yunsong.net/2011/spice-windows-guest.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spice-windows-guest</link>
		<comments>http://huang.yunsong.net/2011/spice-windows-guest.html#comments</comments>
		<pubDate>Sun, 09 Oct 2011 10:34:24 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[spice]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=386</guid>
		<description><![CDATA[There are many choices for desktop virtualization (sometimes called desktop cloud): ICA &#8211; Citrix XenDesktop supports it PCoIP &#8211; VMWare View supports it RDP &#8211; Microsoft supports it SPICE &#8211; Red Hat (RHEV) supports it &#8230; &#8230; The last one, &#8230; <a href="http://huang.yunsong.net/2011/spice-windows-guest.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are many choices for desktop virtualization (sometimes called desktop cloud):</p>
<ul>
<li>ICA &#8211; Citrix XenDesktop supports it</li>
<li>PCoIP &#8211; VMWare View supports it</li>
<li>RDP &#8211; Microsoft supports it</li>
<li>SPICE &#8211; Red Hat (RHEV) supports it</li>
<li>&#8230; &#8230;</li>
</ul>
<p>The last one, <a href="http://spice-space.org/">SPICE</a>, really rocks, especially in multimedia and WAN! The user experience is really great.</p>
<p>SPICE (Simple Protocol for Independent Computing Environments) is an open standard. Red Hat got SPICE and <a href="http://www.linux-kvm.com/">KVM</a> when it <a href="http://www.redhat.com/promo/qumranet/">acquired Qumranet</a> in 2008, and opened them. SPICE support was added to upstream <a href="http://qemu.org/">Qemu</a> in April 2010, that means, if your Qemu is released after April 2010, you can play with SPICE easily with the following steps.</p>
<p>This experiment uses <a href="http://fedoraproject.org/">Fedora</a> 15 x86_64 as the host machine OS, SPICE server doesn&#8217;t support 32-bit system due to its reliance to 64-bit atomic operation, and uses Windows XP as the guest machine OS, because Windows still dominates the personal desktop area.</p>
<p><strong>1.</strong> Create a VM and install Windows XP:</p>
<p>Prepare a virtual disk:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> qemu-img create <span style="color: #660033;">-f</span> raw winxp.img 10G</pre></div></div>

<p>Install VM:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> virt-install <span style="color: #660033;">--connect</span>=qemu:<span style="color: #000000; font-weight: bold;">///</span>system \
                    <span style="color: #660033;">--name</span>=richdesk <span style="color: #660033;">--ram</span>=<span style="color: #000000;">1024</span> <span style="color: #660033;">--vcpus</span>=<span style="color: #000000;">1</span> \
                    <span style="color: #660033;">--os-type</span>=windows <span style="color: #660033;">--os-variant</span>=winxp \
                    <span style="color: #660033;">--hvm</span> <span style="color: #660033;">--virt-type</span> kvm \
                    <span style="color: #660033;">--cdrom</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>winxp_install.iso \
                    <span style="color: #660033;">--disk</span> <span style="color: #007800;">path</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>winxp.img \
                    <span style="color: #660033;">-w</span> <span style="color: #007800;">network</span>=default \
                    <span style="color: #660033;">--graphics</span> spice,<span style="color: #007800;">port</span>=<span style="color: #000000;">5901</span>,<span style="color: #007800;">listen</span>=0.0.0.0 \
                    <span style="color: #660033;">--video</span> qxl <span style="color: #660033;">--channel</span> spicevmc \
                    <span style="color: #660033;">--soundhw</span> default \
                    <span style="color: #660033;">--accelerate</span></pre></div></div>

<p>Notes:</p>
<ul>
<li>The above command uses NAT for network, if you prefer bridge mode, change network option to <code>--network bridge=br0</code>. Of course, you need to configure a bridge device <code>br0</code> firstly.</li>
<li>The above command uses 5901 as SPICE server port, you can change it to any valid port. Please make sure the port is opened on the host machine if it has firewall enabled.</li>
</ul>
<p>After installed the basic Windows XP, shutdown the VM.</p>
<p><strong>2.</strong> Install SPICE guest packages for Windows</p>
<p>Download the latest Windows binaries packages from SPICE website:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>spice-space.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>binaries<span style="color: #000000; font-weight: bold;">/</span>qxl-win-<span style="color: #000000;">0.1010</span>-<span style="color: #000000;">20110308</span>-d9eb3203bd.zip
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>spice-space.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>binaries<span style="color: #000000; font-weight: bold;">/</span>virtio-serial_20110725.zip
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>spice-space.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>binaries<span style="color: #000000; font-weight: bold;">/</span>vdagent-win32_20110801.zip</pre></div></div>

<p>Copy qxl, virtio-serial, vdagent packages into the images:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> virt-copy-in <span style="color: #660033;">-a</span> winxp.img <span style="color: #000000; font-weight: bold;">*</span>.zip <span style="color: #ff0000;">'win:c:\'</span></pre></div></div>

<p>Then start VM, and install the drivers qxl and virtio-serial.</p>
<p>Unzip vdagent package to any place, for example, <code>C:\opt</code>, and register it as a Windows service:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">C:\opt\vdagent-win-x86<span style="color: #000000; font-weight: bold;">&gt;</span> vdservice <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Reboot this Windows VM.</p>
<p><strong>3.</strong> Connect to VM via SPICE protocol</p>
<p>There are several client tools which support SPICE protocol, for example, <a href="http://projects.gnome.org/vinagre/">Vinagre</a>, spicec, <a href="http://virt-manager.org/">virt-manager</a>, etc. My favourite is Vinagre. Also you can buy a thin client hardware whose firmware supports SPICE protocol.</p>
<p>By default the SPICE plugin of Vinagre is disabled, you can enable it through <code>Edit -> Plugins</code>. Then you can connect to host:5901.</p>
<p>Now you have gotten a Windows guest with SPICE support, then enjoy the great quanlity and smooth operation experience brought to you by SPICE! Is it all? Yes if you mean SPICE. But if you want to improve the performance of your virtual desktop more, recommend to use <a href="http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/">virtio</a> drivers for hard disk and network card. I&#8217;m not going to cover virtio in this post.</p>
<p>Have fun ^o^</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/spice-windows-guest.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Compile and Install SPICE Client on Ubuntu</title>
		<link>http://huang.yunsong.net/2011/spice-client-ubuntu-maverick.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spice-client-ubuntu-maverick</link>
		<comments>http://huang.yunsong.net/2011/spice-client-ubuntu-maverick.html#comments</comments>
		<pubDate>Sat, 08 Oct 2011 16:46:58 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[spice]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=379</guid>
		<description><![CDATA[Since 11.10 (Oneiric), Ubuntu includes SPICE client in its official repository. But how can we get SPICE client if we still use the old Ubuntu releases prior to Oneiric? The following describes how to compile and install a SPICE client &#8230; <a href="http://huang.yunsong.net/2011/spice-client-ubuntu-maverick.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since 11.10 (Oneiric), Ubuntu includes <a href="http://spice-space.org">SPICE</a> client in its official repository. But how can we get SPICE client if we still use the old Ubuntu releases prior to Oneiric?</p>
<p>The following describes how to compile and install a SPICE client from source code on Ubuntu 10.10 (Maverick) 32bit. The procedure for the other Ubuntu releases or Debian distributions should be similar.</p>
<p><strong>1.</strong> Install the standard tools for compilation<br />
<code>$ sudo apt-get install build-essential autoconf git-core libtool</code></p>
<p><strong>2.</strong> Install dependencies existing in repository<br />
<code>$ sudo apt-get install libavcodec-dev libssl-dev libasound-dev libpng12-dev libfreetype6-dev libogg-dev libxrandr-dev libgcrypt-dev libsdl-dev libnss3-dev libpixman-1-dev libxfixes-dev libjpeg8-dev libsasl2-dev</code></p>
<p><strong>3.</strong> Install dependencies not existing in repository</p>
<p>3.1. libcacard</p>
<p>This library is what SPICE uses to emulate smart cards and smart card readers.</p>
<p><code>$ git clone git://anongit.freedesktop.org/~alon/libcacard<br />
$ cd libcacard<br />
$ ./autogen.sh<br />
$ make<br />
$ sudo make install</code></p>
<p>3.2. celt051</p>
<p>There is newer celt packages in Maverick&#8217;s repository, the version is 0.7.1. But SPICE client requires a specific version &#8211; 0.5.1, so we have to install this required version manually.</p>
<p>Get the below two packages from <a href="https://launchpad.net/~dev-zero/+archive/spice/+packages">launchpad</a> then install:</p>
<p><code>$ sudo dpkg -i libcelt051_0.5.1.3-2_i386.deb<br />
$ sudo dpkg -i libcelt051-dev_0.5.1.3-2_i386.deb</code></p>
<p>3.3. SPICE protocol</p>
<p><code>$ wget http://spice-space.org/download/releases/spice-protocol-0.8.1.tar.bz2<br />
$ tar jxvf spice-protocol-0.8.1.tar.bz2<br />
$ cd spice-protocol-0.8.1<br />
$ ./configure --prefix=/usr<br />
$ make<br />
$ sudo make install<br />
$ cd /usr/include<br />
$ sudo ln -s spice-1/spice .</code></p>
<p><strong>4.</strong> Finally we are ready to compile and install SPICE client</p>
<p><code>$ wget http://spice-space.org/download/releases/spice-0.8.2.tar.bz2<br />
$ tar jxvf spice-0.8.2.tar.bz2<br />
$ cd spice-0.8.2<br />
$ ./configure --enable-smartcard<br />
$ make<br />
$ sudo make install</code></p>
<p>That&#8217;s it. Now you can connect to your VM with <code>spicec</code>, for example:</p>
<p><code>$ spicec --host SPICE_SERVER --port 5300</code></p>
<p>Enjoy the speed and performance of SPICE!</p>
<p>&lt;EOF&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/spice-client-ubuntu-maverick.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Must-Have PPAs</title>
		<link>http://huang.yunsong.net/2011/my-must-have-ppas.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-must-have-ppas</link>
		<comments>http://huang.yunsong.net/2011/my-must-have-ppas.html#comments</comments>
		<pubDate>Tue, 04 Oct 2011 09:42:15 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=376</guid>
		<description><![CDATA[Within a release life cycle, Ubuntu only maintains the minor upgrades of the applications installed in the release. If you want to keep your applications up-to-date and catch their major upgrades, you have to do the upgrades by yourselves, or &#8230; <a href="http://huang.yunsong.net/2011/my-must-have-ppas.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Within a release life cycle, Ubuntu only maintains the minor upgrades of the applications installed in the release. If you want to keep your applications up-to-date and catch their major upgrades, you have to do the upgrades by yourselves, or use PPAs which are maintained actively by someone or a community team. The following PPAs are my recommendations:</p>
<p>ppa:libreoffice/ppa<br />
ppa:chromium-daily/stable<br />
ppa:mozillateam/firefox-stable<br />
ppa:pidgin-developers/ppa</p>
<p>If you need QQ support in Pidgin, you can install a protocol plugin: <a href="http://code.google.com/p/libqq-pidgin/">libqq-pidgin</a>. You can compile its source code and install it, of course, there is a PPA usable:</p>
<p>ppa:lainme/libqq</p>
<p>&lt;EOF&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/my-must-have-ppas.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN 客户端配置之 GNOME Network Manager 篇</title>
		<link>http://huang.yunsong.net/2011/openvpn-client-gnome.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=openvpn-client-gnome</link>
		<comments>http://huang.yunsong.net/2011/openvpn-client-gnome.html#comments</comments>
		<pubDate>Thu, 15 Sep 2011 17:00:31 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gfw]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=366</guid>
		<description><![CDATA[主流 Linux 桌面系统之一的 GNOME 默认携带的 Network Manager 支持 OpenVPN。安装非常简单： Fedora: $ sudo yum install NetworkManager-openvpn Debian/Ubuntu: $ sudo apt-get install network-manager-openvpn 以下步骤是在 Fedora 15 中配置 GNOME Network Manager 连接至 HLYY OpenVPN 服务，其他 Linux 分发版应该都是一样一样滴： 1. 下载 HLYY OpenVPN CA 证书： &#8230; <a href="http://huang.yunsong.net/2011/openvpn-client-gnome.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>主流 Linux 桌面系统之一的 GNOME 默认携带的 <a href="http://projects.gnome.org/NetworkManager/" title="GNOME Network Manager">Network Manager</a> 支持 OpenVPN。安装非常简单：</p>
<p>Fedora:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> NetworkManager-openvpn</pre></div></div>

<p>Debian/Ubuntu:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> network-manager-openvpn</pre></div></div>

<p>以下步骤是在 Fedora 15 中配置 GNOME Network Manager 连接至 HLYY OpenVPN 服务，其他 Linux 分发版应该都是一样一样滴：</p>
<p>1. 下载 HLYY OpenVPN CA 证书：<br />
$ wget http://vpn.yunsong.net/hlyy-ca.crt</p>
<p>2. 打开 系统设置 -> 网络，点击左下角的加号（图1），在出现的对话框中选择创建一个 VPN 连接、并选择 OpenVPN 类型。</p>
<p><img src="http://vpn.yunsong.net/images/gnome-nm-openvpn1.png" alt="" /><br />
图1</p>
<p>3. 如下图2配置 OpenVPN 客户端</p>
<p><img src="http://vpn.yunsong.net/images/gnome-nm-openvpn2.png" alt="" /><br />
图2</p>
<p>网关：vpn.yunsong.net<br />
认证类型：密码<br />
用户名：your_username<br />
密码：your_password<br />
CA 证书：选择在第一步中下载的 hlyy-ca.crt 文件</p>
<p>并点击“高级&#8230;”按钮，在弹出的新对话框（图3）中做如下配置：</p>
<p><img src="http://vpn.yunsong.net/images/gnome-nm-openvpn3.png" alt="" /><br />
图3</p>
<p>选中“使用自定义网关端口”，并指定端口为 11194<br />
选中“使用 LZO 压缩”</p>
<p>OK，这就完成了配置。</p>
<p>需要注意的是，当你在 Network Manager 中启用了这个 OpenVPN 连接后，所有你的计算机的网络流量都得经过这个 VPN 线路，这对于访问那些墙内资源就不合适了。这时你需要考虑分流，即只有墙外资源走 VPN 线路，Google Code 上有一个很好的项目 <a href="http://code.google.com/p/chnroutes/">chnroutes</a> 可以帮助你。</p>
<p><EOF></p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/openvpn-client-gnome.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Lotus Notes 8.5.3 on Fedora 15 64bit</title>
		<link>http://huang.yunsong.net/2011/lotus-notes-fedora-64bit.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lotus-notes-fedora-64bit</link>
		<comments>http://huang.yunsong.net/2011/lotus-notes-fedora-64bit.html#comments</comments>
		<pubDate>Thu, 01 Sep 2011 08:48:40 +0000</pubDate>
		<dc:creator>Richard Huang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[ibm]]></category>

		<guid isPermaLink="false">http://huang.yunsong.net/?p=354</guid>
		<description><![CDATA[Lotus Notes still has no native support for 64bit Linux, but we can have workaround. $ cd /etc/yum.repo.d $ sudo wget http://pokgsa.ibm.com/projects/o/openclient/lotus/notes/beta/8.5.3/notes-8.5.3-ea.repo $ sudo yum clean all $ sudo yum update $ sudo yum install ibm_lotus_notes This is going to &#8230; <a href="http://huang.yunsong.net/2011/lotus-notes-fedora-64bit.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lotus Notes still has no native support for 64bit Linux, but we can have workaround.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>yum.repo.d
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>pokgsa.ibm.com<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>o<span style="color: #000000; font-weight: bold;">/</span>openclient<span style="color: #000000; font-weight: bold;">/</span>lotus<span style="color: #000000; font-weight: bold;">/</span>notes<span style="color: #000000; font-weight: bold;">/</span>beta<span style="color: #000000; font-weight: bold;">/</span>8.5.3<span style="color: #000000; font-weight: bold;">/</span>notes-8.5.3-ea.repo
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> yum clean all
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> yum update
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> ibm_lotus_notes</pre></div></div>

<p>This is going to install Lotus Notes 8.5.3 and dependencies in your Linux. After installed, you can launch Lotus Notes to configure it, then you can see Lotus Notes launched with a blank main frame. Well, that&#8217;s a bug, don&#8217;t worry, shutdown Notes, and do the following workaround:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ibm<span style="color: #000000; font-weight: bold;">/</span>lotus<span style="color: #000000; font-weight: bold;">/</span>notes
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>linux-aha.de<span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2009</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span>notes_libs_karmic.tgz</pre></div></div>

<p>There are 4 .so files in the package, extract it, and make sure they are owned by root and executable.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root.root libg?k<span style="color: #000000; font-weight: bold;">*</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> libg?k<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>OK now, you can start Lotus Notes again, the blank is gone.</p>
]]></content:encoded>
			<wfw:commentRss>http://huang.yunsong.net/2011/lotus-notes-fedora-64bit.html/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>

