<?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>tolaris.com</title>
	<atom:link href="http://www.tolaris.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tolaris.com</link>
	<description>Back off, man. I'm a scientist.</description>
	<lastBuildDate>Sun, 28 Feb 2010 22:27:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flying without a net: safe techniques for working remotely</title>
		<link>http://www.tolaris.com/2010/02/28/flying-without-a-net/</link>
		<comments>http://www.tolaris.com/2010/02/28/flying-without-a-net/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 22:16:17 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=705</guid>
		<description><![CDATA[I try to post a few times each month, but somehow January (and most of February) fell through the cracks.  Lately I&#8217;ve been busy with operational tasks, which hasn&#8217;t left me much room for engineering.  I haven&#8217;t solved any particularly hard or unusual problems, which is usually what I write about.  Instead, [...]]]></description>
			<content:encoded><![CDATA[<p>I try to post a few times each month, but somehow January (and most of February) fell through the cracks.  Lately I&#8217;ve been busy with operational tasks, which hasn&#8217;t left me much room for engineering.  I haven&#8217;t solved any particularly hard or unusual problems, which is usually what I write about.  Instead, I&#8217;ll write about a routine problem that is nonetheless tricky enough to warrant discussion.</p>
<p>Most of the time I&#8217;m not in the same country as the servers I administer.  Which means I can&#8217;t just drive down and fix something when it goes wrong.  It also means that making changes to the network is particularly dangerous.  So is updating the kernel, initrd, or GRUB configuration.  It is possible to leave a server in a state that requires you to be physically present to fix it.  I call this kind of work &#8220;flying without a net&#8221;.  Here are my techniques for safely working without console access.</p>
<p><span id="more-705"></span>The most useful tool in my bag is <a href="http://www.gnu.org/software/screen/">GNU screen</a>.  Screen acts as a window/terminal manager inside a terminal.  This means you can open one SSH session to a server but start multiple bash logins and multi-task from one terminal window.  What&#8217;s more, screen is persistent.  This means you can disconnect from it and return later, and your programs are still running.  Even if your network access is interrupted, anything running in screen will complete rather than terminating when your login session does.</p>
<p>Screen is the safest way, short of console login, to make network changes.  Want to run &#8220;<code>ifdown eth0 ; ifup eth0</code>&#8220;?  Try it and you&#8217;ll likely find that the first command will interrupt the network and the second command will never run.  Your server is now off the network, and you can&#8217;t fix it without console access.  If you had used screen, you wouldn&#8217;t be ringing the on-call staff and suffering a service outage.</p>
<p>For me, the most common way to lose access to a server is to make a mistake while changing the network configuration.  This could be the firewall, the IP configuration, tunable kernel networking parameters (sysctl), or something as simple as stopping the OpenSSH server.  The first rule is: the server always boots in a known good configuration.  Don&#8217;t write changes to any startup configuration files until they are tested.  When testing, tell the server to restart if the new configuration is bad.</p>
<p>How do you do this?  With <code>shutdown -r +5m</code>.  This will instruct the server to reboot in 5 minutes.  Then, make your changes.  If they work, cancel the shutdown with <code>shutdown -c</code>.  If they don&#8217;t, the server will reboot in 5 minutes on the known, working configuration.  Five minutes of down time may be unpleasant, but it is a lot better than sending an engineer.</p>
<p>This means you must test your configuration changes with temporary files.  Most commands that use configuration files take an argument to read an alternate file.</p>
<p><code>cp /etc/network/interfaces /etc/network/interfaces.new<br />
vi /etc/network/interfaces.new<br />
ifdown eth0<br />
ifup -i /etc/network/interfaces.new eth0</code></p>
<p>Another simple trick is to have a private IP address configured on a virtual interface (eth0:1).  Do this for all your servers.  If you lose access to one server, you can SSH into another on the same LAN, then SSH into the affected server using the private IP.  In rare cases I&#8217;ve set a bad route or default gateway, but found I could reach the server from another on the same IP subnet.</p>
<p>Always keep an active SSH session when making changes to the OpenSSH server.  Don&#8217;t test by logging out of your current shell and then logging in again.  Open a new terminal and test in that one.  The OpenSSH server only controls new SSH sessions, not existing ones.  So you can upgrade or restart the SSH service without losing your open shell.</p>
<p>This applies to firewall changes as well.  A typical firewall config accepts all existing, recognised connections before filtering new ones.  If you firewall port 22/tcp, you may not be able to open a new session, but your existing ones will probably continue to work.</p>
<p>Install <a href="http://www.webmin.com/">webmin</a>.  If you break the OpenSSH server or run afoul of your own firewall, you may be able to login via webmin and fix it.  Webmin has native brute-force protection and uses SSL, so you aren&#8217;t decreasing your security by installing it.  It has saved me more than once.</p>
<p>Be wary of anything that affects the boot process itself.  That means GRUB, the kernel, and the initrd image.  If you use software RAID on the root partition, make sure that initrd image has all the tools you may need to boot:</p>
<p><code>apt-get install mdadm evms dmsetup lvm2</code></p>
<p>In general, it is safe to upgrade or reboot if you use your distribution&#8217;s standard software repositories and don&#8217;t change the default configurations.  If you compile your own kernel or do anything fancy with GRUB, ensure you have console access.</p>
<p>If you have the resources, model changes to a server in a virtual machine first.  Today, &#8220;resources&#8221; only means a mid-range laptop and <a href="http://www.virtualbox.org/">Virtualbox</a>.  Create a virtual network environment that is identical to the real one, using the same IP addresses but only accessible to you.  Test your changes, then apply them to the real server only if they work.</p>
<p>These techniques are <strong>no substitute</strong> for professional server administration.  Standard policy at my company is that all servers are installed on <a href="http://www.apc.com/products/family/index.cfm?id=70">network-aware PDUs</a> and connected to <a href="http://www.adder.com/uk/kvm-over-ip-switches.aspx">IP-capable KVM units</a>.  This means I can remotely reboot a server by the power switch, or login as if I were on a local keyboard and monitor.  This means I have access to BIOS, bootable network/RAID cards, the GRUB boot menu, a minimal recovery shell (such as when <code>fsck</code> fails), or the regular console.  You can&#8217;t get any of that with GNU screen or any tool that runs on the server itself.</p>
<p>If you have more than four physical servers, installing a network PDU and KVM will cost less than 15% of the servers themselves and will save you a lot of trouble in on-site support fees and lost time.  And they will allow your engineers to do scheduled maintenance at late hours from home.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2010/02/28/flying-without-a-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VLANs, bridges, and virtual machines</title>
		<link>http://www.tolaris.com/2010/02/20/vlans-bridges-and-virtual-machines/</link>
		<comments>http://www.tolaris.com/2010/02/20/vlans-bridges-and-virtual-machines/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 12:44:38 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardy]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=686</guid>
		<description><![CDATA[We run several virtual machine host servers on a network with multiple VLANs.  The virtual machines are members of different VLANs, but are not themselves aware of the VLAN.  This is how we did it.
We use KVM for virtualisation, but I&#8217;m not going to discuss the details here.  Like any virtualisation solution, [...]]]></description>
			<content:encoded><![CDATA[<p>We run several virtual machine host servers on a network with multiple VLANs.  The virtual machines are members of different VLANs, but are not themselves aware of the VLAN.  This is how we did it.</p>
<p><span id="more-686"></span>We use <a href="http://www.linux-kvm.org">KVM</a> for virtualisation, but I&#8217;m not going to discuss the details here.  Like any virtualisation solution, KVM starts a virtual machine and attaches its virtual network hardware to a network interface on the host OS.  What I want to discuss is how to implement the networking layer.</p>
<p>I <a href="http://www.tolaris.com/2009/03/05/using-host-networking-and-nat-with-virtualbox/">previously wrote</a> about creating a network bridge for Virtualbox virtual machines, and we&#8217;re going to do something similar here.  However, we want to implement VLAN support and native 802.1q VLAN tagging at the same time.</p>
<p>The design:</p>
<ul>
<li>The physical server is connected to the Ethernet switch via a 802.1q VLAN tagged trunk port</li>
<li>The host OS is aware of the trunk port, and implements several virtual network interfaces.  Each virtual  interface is associated with one VLAN.  Any traffic on that virtual interface exits the physical network interface as tagged VLAN packets.</li>
<li>The host OS provides a network bridge for each VLAN, and adds the virtual VLAN interface to the bridge.</li>
<li>The guest OSes (virtual machines) are not VLAN-aware.  They have a normal ethernet interface which requires no special configuration.</li>
<li>The virtualisation software (KVM, in this case) attaches the network interface of the guest OS to the VLAN-specific network bridge.</li>
</ul>
<p>Warning: changing the Ethernet setup to your server can cause you to lose access to it.  At all times during this process, ensure you have console access to the server, and network or console access to the switch.</p>
<p>That said, we&#8217;ll try to time the network interruption such that we don&#8217;t lose access.  First, configure your server for VLAN networking.  This guide assumes the server runs Ubuntu 8.04 &#8220;Hardy Heron&#8221;, but the steps are similar for any recent Ubuntu release.  I have no idea how Red Hat handles VLANs and bridging, but I invite you to provide the steps in comments.</p>
<p>This guide also assumes the server is connected to a VLAN unaware (access) port, on VLAN 100, with an existing /etc/network/interfaces like so:</p>
<pre># The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
	address 192.168.0.2
	netmask 255.255.255.0
	gateway 192.168.0.1</pre>
<p>Finally, we assume that virtual machines will be attached to either VLAN 100 (the same as the host OS&#8217;s own traffic) or VLAN 200.  So we&#8217;ll prepare support for both.</p>
<p>Install vlan and bridge support.<br />
<code>apt-get install vlan bridge-utils</code></p>
<p>Then edit /etc/network/interfaces.  Modify the existing network setup to be aware of VLAN 100, and to create a bridge on it.</p>
<pre>
# The loopback network interface
auto lo
iface lo inet loopback          

# LAN uses VLAN trunking, so set any IP addresses on appropriate bridge
auto eth0
iface eth0 inet manual
	up ifconfig eth0 up

# VLAN 100
auto eth0.100
iface eth0.100 inet manual
	up ifconfig eth0.100 up

# KVM bridge, VLAN 100, via eth0
auto br100
iface br100 inet static
	address 192.168.0.2
	netmask 255.255.255.0
	gateway 192.168.0.1
	bridge_ports eth0.100
	bridge_maxwait 5
	bridge_fd 1
	bridge_stp on</pre>
<p>We must bring eth0 up before we can create eth0.100, and we must bring eth0.100 up before we can attach it to the bridge interface.  Finally, we must configure the host OS&#8217;s IP address on the bridge.  If you don&#8217;t want to attach virtual machines to VLAN 100, you could configure the IP directly on eth0.100 and leave out the stanza for br100.</p>
<p>Now, apply changes.  Because we&#8217;re going to move the existing IP from eth0 to br100, the easiest way is to reboot.  Alternatively, you may try <code>/etc/init.d/networking restart</code>, but make sure you run this from console so you can fix any problems.</p>
<p>Network interruption begins as soon as you run the above command, or reboot.  To restore access to the host OS, we must now configure the Ethernet port on the switch.  For Cisco, this is easy.  Assuming the server is connected to gigabit Ethernet port 1, run:</p>
<pre>configure terminal
interface GigabitEthernet0/1
 switchport mode trunk</pre>
<p>You should now be able to ping your server.  Once you verify that works, add the configuration for VLAN 200 to /etc/network/interfaces.</p>
<pre># VLAN 200
auto eth0.200
iface eth0.200 inet manual
	up ifconfig eth0.200 up

# KVM bridge, VLAN 200, via eth0
auto br200
iface br200 inet manual
	bridge_ports eth0.200
	bridge_maxwait 5
	bridge_fd 1
	bridge_stp on</pre>
<p>VLAN 200 doesn&#8217;t need an IP on the host OS, so it lacks the static IP configuration.  Configure any additional VLANs the same way.</p>
<p>Now we are ready to attach virtual machines to the new bridges.  For KVM, use virt-install to create a machine with 20 GB hard disk, 1 GB of RAM, booting the hardy iso, and attached to VLAN 100.</p>
<p><code>virt-install --connect qemu:///system -n guestname -r 1024 -f /path/to/virtual/disks/guestname.qcow2 -s 20 -c /path/to/isos/ubuntu-8.04.3-server-i386.iso --vnc --os-type linux --os-variant ubuntuHardy --accelerate --network=bridge:br100</code></p>
<p>Now use virt-manager to connect to the guest and configure it.</p>
<p>The last step can be replaced with any other virtualisation solution.  For instance, with Virtualbox, you can create a VM and then attach it to the bridged interface br100.</p>
<p><a href="http://www.tolaris.com/blog/wp-content/uploads/2010/02/virtualbox-br100.png"><img src="http://www.tolaris.com/blog/wp-content/uploads/2010/02/virtualbox-br100.png" alt="" title="virtualbox-br100" width="672" height="506" class="alignnone size-full wp-image-703" /></a></p>
<p>Unlike the Virtualbox <a href="http://www.tolaris.com/2009/03/05/using-host-networking-and-nat-with-virtualbox/">NAT/routing setup</a>, we don&#8217;t need to enable IP forwarding (<code>sysctl -w net.ipv4.ip_forward=1</code>).  This method uses layer 2 switching only.  However, if you use an iptables firewall, make sure the FORWARD chain of the filter table defaults to &#8220;ACCEPT&#8221;, or use an equivalent rule matching traffic to/from the virtual bridges.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2010/02/20/vlans-bridges-and-virtual-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merry Christmas!</title>
		<link>http://www.tolaris.com/2009/12/14/merry-christmas/</link>
		<comments>http://www.tolaris.com/2009/12/14/merry-christmas/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 19:35:56 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xmas]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=669</guid>
		<description><![CDATA[Merry Christmas, everyone!  We have a special card just for you:
http://www.tolaris.com/xmas
(In case you miss it the first time, try reloading or clicking the button.)
Read on if you&#8217;d like to know more about how our awesome card works.
We started the Christmas card in 2005, as a simple way to do a card online.  My [...]]]></description>
			<content:encoded><![CDATA[<p>Merry Christmas, everyone!  We have a special card just for you:</p>
<p><a href="http://www.tolaris.com/xmas">http://www.tolaris.com/xmas</a></p>
<p>(In case you miss it the first time, try reloading or clicking the button.)</p>
<p>Read on if you&#8217;d like to know more about how our awesome card works.</p>
<p><span id="more-669"></span>We started the Christmas card in 2005, as a simple way to do a card online.  My wife Jamie and I had several reasons for doing our card this way.</p>
<ol>
<li>We didn&#8217;t want to waste paper or fuel to deliver physical objects half-way around the world.</li>
<li>We didn&#8217;t want to use an online card service, which offer all kind of funny/animated/religious/specialised cards but exist solely to get you to give up personal information about your friends.  The fastest way to lose me as a friend is to sell me out to spammers and marketing droids.</li>
<li>We wanted to create something, both for our own pleasure and as a way to give back to our friends.</li>
</ol>
<p>So I wrote the first card in plain HTML, and made customised messages for certain people using differently-named files, and hand-sent all the emails that year.</p>
<p>This was a quick hack but it worked well.  The next year we upgraded to PHP.  Then each successive year we added more features, improved the code base, and found various ways to foil our hacker friends (who wasted no time testing the security of the card &#8211; guessing URLs, testing PHP arguments, and so on).  The full details are now in the <a href="/xmas/changelog.php">changelog</a>, which is new this year.</p>
<p>The big hit was in 2008, when we created the &#8220;madlib&#8221; greeting.  The madlib card uses PHP to generate a random greeting from a template and a series of variables.  Judging from server logs this was tremendously popular with my friends, who clicked the reload button many times until they&#8217;d exhausted enough combinations to be satisfied.  Others didn&#8217;t immediately realise what was happening, and probably just assumed Tyler wrote a really weird card and closed the browser.  I figure I was accurately represented either way.</p>
<p>The PHP code is simple.  Here is the basic idea:</p>
<p><code>&lt;?<br />
$happy_list = array("merry", "happy", "wonderful", "drunken", "special");<br />
$holiday_list = array("Christmas", "Hannukah", "Kwanza", "Festivus");<br />
$happy = "$happy_list[array_rand($happy_list)];<br />
$holiday = "$holiday_list[array_rand($holiday_list)];<br />
echo "&lt;p&gt;$happy $holiday, everyone!&lt;/p&gt;";<br />
?&gt;<br />
</code></p>
<p>$happy $holiday, everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/12/14/merry-christmas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>virt-manager now in repo</title>
		<link>http://www.tolaris.com/2009/12/08/virt-manager-now-in-repo/</link>
		<comments>http://www.tolaris.com/2009/12/08/virt-manager-now-in-repo/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 17:23:46 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[repo]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=665</guid>
		<description><![CDATA[The latest virt-manager package in Ubuntu karmic is broken.  We use virt-manager to manage KVM/QEMU virtual machines over an ssh tunnel.  This worked fine in hardy and jaunty.  But it is partially broken in karmic.
The bug appears as:

Start virt-manager.
Connect to a KVM host server using connection &#8220;Remote tunnel over SSH&#8221; with hypervisor [...]]]></description>
			<content:encoded><![CDATA[<p>The latest virt-manager package in Ubuntu karmic is broken.  We use virt-manager to manage <a href="http://www.linux-kvm.org">KVM</a>/QEMU virtual machines over an ssh tunnel.  This worked fine in hardy and jaunty.  But it is partially broken in karmic.</p>
<p><span id="more-665"></span>The bug appears as:</p>
<ol>
<li>Start virt-manager.</li>
<li>Connect to a KVM host server using connection &#8220;Remote tunnel over SSH&#8221; with hypervisor &#8220;QEMU/KVM&#8221;.</li>
<li>Double-click on a VM to open a VNC connection to console.</li>
<li>The error message &#8220;Error bringing up domain details: invalid argument in virDomainGetXMLDesc&#8221; appears, and no VNC session opens.</li>
</ol>
<p>The problem is with the latest version of virt-manager, 0.7.0.  To work around it I&#8217;ve repackaged virt-manager 0.6.1 from jaunty with the fake version &#8220;0.7.1~really0.6.1-1ubuntu4&#8243;.  Packages for i386 and amd64 are now in my <a href="/apt-repository/">APT repository</a>.</p>
<p>Also, KPackageKit ignores my &#8220;<code>dpkg --set-selections</code>&#8220;, forcing me to do this.  Thanks, KPackageKit, for ignoring the standard!  Otherwise I could install the jaunty package and mark it on hold.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/12/08/virt-manager-now-in-repo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>kregexpeditor, grip now in repo for karmic</title>
		<link>http://www.tolaris.com/2009/11/23/kregexpeditor-grip-now-in-repo-for-karmic/</link>
		<comments>http://www.tolaris.com/2009/11/23/kregexpeditor-grip-now-in-repo-for-karmic/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 19:56:01 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=653</guid>
		<description><![CDATA[Both kregexpeditor (removed since the KDE 4 upgrade) and grip (unmaintained since 2005, relies on old libraries) are missing from Ubuntu karmic.  I expect to find alternatives to grip, but for now I&#8217;d like to keep using it.  And I&#8217;ll give up kregexpeditor when they pry it from my cold, dead hands.
The hardy [...]]]></description>
			<content:encoded><![CDATA[<p>Both kregexpeditor (removed since the KDE 4 upgrade) and grip (unmaintained since 2005, relies on old libraries) are missing from Ubuntu karmic.  I expect to find <a href="http://www.dwasifar.com/?p=836">alternatives</a> to grip, but for now I&#8217;d like to keep using it.  And I&#8217;ll give up kregexpeditor when they pry it from my cold, dead hands.</p>
<p>The hardy version of kregexpeditor still works on karmic, and I&#8217;ve used pbuilder to port the jaunty package of grip to karmic.  Both are now in the <a href="http://www.tolaris.com/apt-repository/">repo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/11/23/kregexpeditor-grip-now-in-repo-for-karmic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Securing laptops with ecryptfs, cryptsetup, and tmpfs</title>
		<link>http://www.tolaris.com/2009/11/14/securing-laptops-with-ecryptfs-cryptsetup-and-tmpfs/</link>
		<comments>http://www.tolaris.com/2009/11/14/securing-laptops-with-ecryptfs-cryptsetup-and-tmpfs/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 00:17:03 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=618</guid>
		<description><![CDATA[One of the awesome features of the last several Ubuntu releases is support for ecryptfs, an encrypted filesystem.  At Talia we depend heavily on GPG, OTR, SSH keys and other forms of encryption and secure identification.  Loss of those keys and other confidential data to laptop theft, corporate espionage, or the US Customs [...]]]></description>
			<content:encoded><![CDATA[<p>One of the awesome features of the last several Ubuntu releases is support for <a href="http://www.linuxjournal.com/article/9400">ecryptfs</a>, an <a href="http://ecryptfs.sourceforge.net/ecryptfs-faq.html">encrypted</a> filesystem.  At Talia we depend heavily on GPG, OTR, SSH keys and other forms of encryption and secure identification.  Loss of those keys and other confidential data to laptop theft, corporate espionage, or the <a href="http://www.boingboing.net/2008/02/07/tsa-confiscating-lap.html">US Customs Service</a> is a big concern for us.  This week I secured my laptop, as a prototype of our new corporate laptop setup.  Here is how I did it.</p>
<p><span id="more-618"></span>Nothing in this process is specific to KDE, so Ubuntu or Xubuntu users can use this as well.  Steps:</p>
<ol>
<li>Choose a strong password</li>
<li>Create an encrypted ~/Private directory</li>
<li>Copy home directory files into ~/Private</li>
<li>Move ~/Private to $HOME</li>
<li>Encrypt swap</li>
<li>Make /tmp a tmpfs</li>
</ol>
<p>Caveat emptor: If you encrypt your home directory, then later forget your password and fail to write down the mount passphrase, you are screwed.  There is no practical chance that you will recover your files.  As always, make a backup.</p>
<p><strong>Step 1: Choose a strong password</strong></p>
<p>If you aren&#8217;t already doing this, you&#8217;re not likely to use this guide.  Security is a mindset, not a tool.  Get used to keeping strong passwords in your head.  Ubuntu makes using encryption <em>really</em> easy, but it is only as effective as the strength of the password you choose.</p>
<p>My recommendation is to use <a href="http://sourceforge.net/projects/pwgen/">pwgen</a> with -B or even -By:</p>
<p><code>pwgen -By</code></p>
<pre>
Ohz:ah7s aiT7gex% AhNae)Z3 Ohph*i9e va9eZuo[ Mei7ieZ~ Ohb7Za]o Piek+ai3
fa!m3Sho ua~ch7Wa tom?oh9U do{i4Aep tuF4oof} Na#a4eiH epe\G3oh aR3ahp^i
...
Aip$aim9 Eph%a3pu gae7aY`a Ie^cah4t sha+uY3v ove3aeZ= Wie4yei| Oc\aeb9e
</pre>
<p>The -B option tends to generate passwords that are balanced between hands and at least partly pronouncible, so this isn&#8217;t as hard as you think.  If you do use -y (special characters like +), consider the keyboards you might have to use.  If you use both British and American keyboards, don&#8217;t use £, @, &#8220;, `, #, ~, \, or |, as all of these are in different locations.</p>
<p>Pick one and and make a mnemonic to help you remember it.  Write it on a piece of paper, put it in your wallet, and burn it once you memorise it.  Write it on your belly with a sharpie; whatever it takes.  Change your password now:</p>
<p><code>passwd</code></p>
<p>Your password will later become the passphrase that protects the encryption keys to your home directory.  ecryptfs includes excellent PAM support, so if you change your password later it will update the key too.</p>
<p><strong>Step 2: Create an encrypted ~/Private directory</strong></p>
<p>Since I upgraded from an earlier install without an encrypted home or ~/Private directory, I had to create one.  If you are about to install 9.10 from a CD, the installer has an option to encrypt your home directory.  Just use that.  Or create a new user:</p>
<p><code>adduser --encrypt-home username</code></p>
<p>If you&#8217;ve already got an encrypted home, congratulations!  The hardest part is done.  Skip to step 5.</p>
<p>If not, let&#8217;s get started.  Linux Mag&#8217;s Dustin Kirkland has written an <a href="http://www.linux-mag.com/id/7568/2/">excellent guide</a> to this process.  Much of my process is based on his, but I include a few corrections.  For most of this you can remain logged in to your Desktop, but the process is simpler from the Linux console.  The initial copy process will make you want to get up and do something else while it finishes anyway.</p>
<p>Logout from the Desktop, which should return you to the login screen.  If your login screen is configured to log you in automatically, cancel it.  Then press Ctrl+Alt+F1 to go to the first Linux virtual console.</p>
<p>Login at the prompt, and create an encrypted $HOME/Private directory:</p>
<p><code>ecryptfs-setup-private</code></p>
<pre>Enter your login passphrase:
Enter your mount passphrase [leave blank to generate one]:</pre>
<p>At the first prompt enter your user password.  At the second, press Enter.  Now record the mount passphrase which was just generated:</p>
<p><code>ecryptfs-unwrap-passphrase $HOME/.ecryptfs/wrapped-passphrase</code></p>
<p>Print it out and put it with your birth certificate in your fire-proof document safe.  You do have one, right?  If something goes wrong you will need this later.</p>
<p>Log out, and log in again.</p>
<p><strong>Step 3: Copy home directory files into ~/Private</strong></p>
<p>Make sure you have at least 50% free on /home, or this may fail.</p>
<p><code>rsync -aP --exclude=.Private --exclude=Private --exclude=.ecryptfs $HOME/ $HOME/Private/</code></p>
<p>If you don&#8217;t have 50% free, first move some files from $HOME to $HOME/Private, and rsync the rest.</p>
<p><code>cd<br />
mv -v Videos Music Pictures DirectoryOfBigFiles $HOME/Private/<br />
rsync -aP --exclude=.Private --exclude=Private --exclude=.ecryptfs $HOME/ $HOME/Private/</code></p>
<p>This will take a long time to complete.  Every file is being encrypted as it is copied or moved.  If you have a lot of files and an under-powered CPU (such as on a netbook), it will take even longer.  I moved 178 GB of data on my Dell Vostro 1500 (Intel Core2 Duo 2 GHz, 4GB RAM) in about 5 hours.  Get a coffee, walk the plants, shave the cat, come back later.</p>
<p>When done, logout to sync any remaining changes to disk.</p>
<p><strong>Step 4: Move ~/Private to $HOME</strong></p>
<p>Now we need to do some things with sudo.    Still on console, login again.   Unmount $HOME/Private:</p>
<p><code>ecryptfs-umount-private<br />
cd /<br />
sudo mkdir -p /home/.ecryptfs/$USER<br />
sudo mv $HOME/.ecryptfs /home/.ecryptfs/$USER/</code></p>
<p>Create a new home and populate it with the ecryptfs files:</p>
<p><code>sudo mkdir -p -m 700 /home/$USER.new<br />
sudo chown $USER:$USER /home/$USER.new<br />
sudo mv $HOME/.Private /home/.ecryptfs/$USER/<br />
sudo ln -s /home/.ecryptfs/$USER/.ecryptfs /home/$USER.new/.ecryptfs<br />
sudo ln -s /home/.ecryptfs/$USER/.Private /home/$USER.new/.Private<br />
sudo ln -s /usr/share/ecryptfs-utils/ecryptfs-mount-private.txt /home/$USER.new/README.txt<br />
</code></p>
<p>Switch to the new home, tell ecryptfs that we&#8217;ll mount it at login, and make it read-only (until it is mounted):</p>
<p><code>sudo mv $HOME $HOME.old<br />
sudo mv $HOME.new $HOME<br />
echo $HOME > $HOME/.ecryptfs/Private.mnt<br />
sudo chmod 500 $HOME</code></p>
<p>Now for the moment of truth.  Still on console, logout, and login again.  Your home directory should mount:</p>
<p><code>mount | grep ecryptfs</code></p>
<pre>/home/username/.Private on /home/username type ecryptfs (ecryptfs_sig=9cec4d81c9bcb6e0,ecryptfs_fnek_sig=c735e6facb299611,ecryptfs_cipher=aes,ecryptfs_key_bytes=16)</pre>
<p>Create some convenient links:</p>
<p><code>ln -s /home/.ecryptfs/$USER/.ecryptfs $HOME/.ecryptfs<br />
ln -s /home/.ecryptfs/$USER/.Private $HOME/.Private</code></p>
<p>Once you verify that all your user data is there, securely wipe any files that have important data, and then remove the old home.</p>
<p><code>cd $HOME.old<br />
find .kde .gnupg .ssh PathsToDirectoriesOfImportantFiles -print -exec shred -u {} \;<br />
rm -rf $HOME.old</code></p>
<p><strong>Step 5: Encrypt swap</strong></p>
<p>Your home directory isn&#8217;t the only place your private data may be written to disk.  When your computer doesn&#8217;t have enough RAM for everything it wants to have open, it swaps.  This means some RAM is written to disk to be read back later.  Thus, swap can contain anything you have ever have open.  Swap does not need normally to survive reboots *, so we&#8217;ll encrypt this with a random key every time we boot up.</p>
<p>* The one exception to this is hibernate mode (suspend to disk).  If you want to use hibernate, don&#8217;t encrypt swap, or use a (less secure) <a href="http://sysphere.org/~anrxc/j/articles/ecryptfs/index.html#top-5">static key</a>.  Encrypting swap has no impact on sleep mode (suspend to RAM).  I never use hibernate.</p>
<p>Thankfully, this is a very easy process with Ubuntu.  Despite the misleading name, this uses cryptsetup, not ecryptfs:</p>
<p><code>sudo apt-get install cryptsetup<br />
sudo ecryptfs-setup-swap</code></p>
<p><strong>Step 6: Make /tmp a tmpfs</strong></p>
<p>The last place your private data is commonly written is the temp directory, /tmp.  The contents of this directory don&#8217;t need to survive reboot either, and are commonly cleared at bootup.  It is possible to encrypt it using cryptsetup just as with swap, but we don&#8217;t need to.  Instead we&#8217;ll make this a <a href="http://en.wikipedia.org/wiki/Tmpfs">tmpfs</a>.  This means /tmp will be an auto-resizing virtual RAM disk.  By default it is allowed to grow to up to 50% of RAM.</p>
<p>Don&#8217;t worry about this consuming your RAM.  If the contents of RAM is swapped to disk, static content like /tmp will be the first to go.  And it isn&#8217;t much data anyway; my /tmp <a href="http://osdir.com/ml/kde-bugs-dist/2009-09/msg15164.html">rarely</a> grows beyond 200 MB.  Plus, using a tmpfs will save power when in battery mode.</p>
<p>Add one line to your /etc/fstab:</p>
<p><code>echo "tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0" >> /etc/fstab</code></p>
<p>If you are logged in to the desktop, log out completely.  Then login on console one last time, and run:</p>
<p><code>sudo rm -rf /tmp/*<br />
reboot</code></p>
<p>That&#8217;s it!  You are now running a cryptographically secure laptop, protected against all but the <a href="http://xkcd.com/538/">rubber-hose attack</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/11/14/securing-laptops-with-ecryptfs-cryptsetup-and-tmpfs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Enabling the Sleep button on a Dell laptop in Kubuntu Karmic</title>
		<link>http://www.tolaris.com/2009/11/10/enabling-the-sleep-button-on-a-dell-laptop-in-kubuntu-karmic/</link>
		<comments>http://www.tolaris.com/2009/11/10/enabling-the-sleep-button-on-a-dell-laptop-in-kubuntu-karmic/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 19:35:40 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=609</guid>
		<description><![CDATA[I read an article in the Dec 2009 issue of Linux Magazine, one of several Linux-focused magazines we get at the office.  I&#8217;d like to link directly to it, but it the magazine&#8217;s own website doesn&#8217;t offer the article or even a reliable permanent link to the issue number.  Hint: hey guys, sort [...]]]></description>
			<content:encoded><![CDATA[<p>I read an article in the Dec 2009 issue of <a href="http://www.linux-magazine.com">Linux Magazine</a>, one of several Linux-focused magazines we get at the office.  I&#8217;d like to link directly to it, but it the magazine&#8217;s own website doesn&#8217;t offer the article or even a reliable permanent link to the issue number.  Hint: hey guys, sort that out.</p>
<p>The article was about configuring ACPI hotkeys to support your specific laptop.  IE, the buttons for &#8220;sleep&#8221;, &#8220;brightness up&#8221;, etc.  For most laptops this already works on Ubuntu.  On my Dell Vostro 1500, every button except for &#8220;sleep&#8221; worked right after install.  This is Linux, so there is always some way to fix that.</p>
<p><span id="more-609"></span>Unfortunately, ACPI cannot even detect my keypress.  The instructions in the article suggest starting acpid with -d for debug mode, which will print any keypresses that reach it.  Pressing Fn+F1, the sleep button, prints nothing.  So we&#8217;re going to use KDE&#8217;s hotkey support instead.  Gnome users can use a similar method; only the menu instructions differ.</p>
<p>First, create a script somewhere your user can run.  I have $HOME/bin in my $PATH, so I created a file there:</p>
<p><code>touch ~/bin/sleep-kde-screen<br />
chmod 755 ~/bin/sleep-kde-screen</code></p>
<p>Then I edited it to contain the following:</p>
<pre>#!/bin/sh
qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock
sudo /usr/sbin/pm-suspend</pre>
<p>This calls DBUS to lock the screensaver, then asks power-manager to suspend.  This way you will be prompted for your password when you resume from suspend.  If you prefer to hibernate, change &#8220;pm-suspend&#8221; to &#8220;pm-hibernate&#8221;.</p>
<p>Second, you need to tell sudo to allow your user to run this /usr/bin/pm-suspend without prompting for a password.  Run <code>sudo visudo</code> to edit /etc/sudoers, and add this line at the bottom:</p>
<pre>%admin ALL=NOPASSWD: /usr/sbin/pm-suspend</pre>
<p>Finally, add this script to your K menu with a hotkey.  Right-click on the K menu and select &#8220;Menu Editor&#8221;.  Add a new item to the &#8220;System&#8221; menu, give it a name (I like &#8220;Sleep!&#8221; *), and tell it to call sleep-kde-screen (wherever you&#8217;ve put it).  On the Advanced tab, select &#8220;Current shortcut key&#8221; and press the sleep button.  Now save and close the menu editor.</p>
<p><small>*  I imagine saying &#8220;Sleeeeeep!&#8221; like a hypnotist bad guy from an old movie on <a href="http://en.wikipedia.org/wiki/Mystery_Science_Theater_3000">MST3K</a>.</small></p>
<p>Press the sleep button, and you&#8217;ll suspend!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/11/10/enabling-the-sleep-button-on-a-dell-laptop-in-kubuntu-karmic/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Poor VirtualBox guest performance with Intel VT-X on Ubuntu 9.10</title>
		<link>http://www.tolaris.com/2009/11/04/poor-virtualbox-guest-performance-with-intel-vt-x/</link>
		<comments>http://www.tolaris.com/2009/11/04/poor-virtualbox-guest-performance-with-intel-vt-x/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 21:36:42 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=590</guid>
		<description><![CDATA[Since upgrading to Ubuntu 9.10 I&#8217;ve noticed poor performance of VirtualBox guests with Intel VT-X hardware virtualisation enabled.  This has been noted in a few places, but I didn&#8217;t enable VT-x until recently so I can&#8217;t be sure that the problem began with Karmic.  I can be sure that it is happening to [...]]]></description>
			<content:encoded><![CDATA[<p>Since upgrading to Ubuntu 9.10 I&#8217;ve noticed poor performance of VirtualBox guests with Intel VT-X hardware virtualisation enabled.  This has been noted in a <a href="http://ubuntuforums.org/showthread.php?t=1294826">few</a> <a href="http://www.mail-archive.com/universe-bugs@lists.ubuntu.com/msg144983.html">places</a>, but I didn&#8217;t enable VT-x until recently so I can&#8217;t be sure that the problem began with Karmic.  I can be sure that it is happening to me now.</p>
<p><span id="more-590"></span>At the time of this writing, my host OS is Ubuntu 9.10 Karmic 64-bit (actually an Intel Core 2 Duo 2.0 MHZ), with <a href="http://www.virtualbox.org/">VirtualBox</a> 3.0.10 <a href="http://www.virtualbox.org/wiki/Editions">PUEL</a> edition.  I run several 32-bit clients: Ubuntu 6.06 LTS (just in case, we still encounter them at some customer sites), Ubuntu 8.04 LTS, Xubuntu 9.10, and Windows XP SP3 (my actual legal copy that came with the laptop).</p>
<p>I left the Windows XP VM running but idle, and noticed that my keyboard and mouse occasionally skipped, and my CPU worked harder than expected.  So I ran a few tests with top in batch mode:</p>
<p><code>top -b -d 10 -n 10</code></p>
<p>I then redirected that to a file, waited the 10*10 seconds to finish, and grepped the results.  This is with VT-x enabled, and shows only the relevant VM (not the GUI or other VMs):</p>
<pre>  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
30763 tyler     20   0 1020m 609m  73m S   10 15.4   0:28.05 VirtualBox
30763 tyler     20   0 1020m 609m  73m S    9 15.4   0:28.98 VirtualBox
30763 tyler     20   0 1020m 609m  73m S    5 15.4   0:29.52 VirtualBox
30763 tyler     20   0 1020m 609m  73m S    6 15.4   0:30.10 VirtualBox
30763 tyler     20   0 1020m 609m  73m S   20 15.4   0:32.06 VirtualBox
30763 tyler     20   0 1020m 609m  73m S    6 15.4   0:32.63 VirtualBox
30763 tyler     20   0 1020m 609m  73m S   10 15.4   0:33.60 VirtualBox
30763 tyler     20   0 1020m 609m  73m S   16 15.4   0:35.18 VirtualBox
30763 tyler     20   0 1020m 609m  73m S    6 15.4   0:35.78 VirtualBox
30763 tyler     20   0 1020m 609m  73m S    4 15.4   0:36.20 VirtualBox</pre>
<p>Here is the same data, after rebooting the guest and disabling VT-x:</p>
<pre>  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
30217 tyler     20   0 1027m 625m  73m S    4 15.8   2:21.32 VirtualBox
30217 tyler     20   0 1027m 625m  73m R    5 15.8   2:21.79 VirtualBox
30217 tyler     20   0 1027m 625m  73m S    1 15.8   2:21.89 VirtualBox
30217 tyler     20   0 1027m 625m  73m S   11 15.8   2:23.04 VirtualBox
30217 tyler     20   0 1027m 625m  73m S   11 15.8   2:24.17 VirtualBox
30217 tyler     20   0 1027m 625m  73m S    5 15.8   2:24.69 VirtualBox
30217 tyler     20   0 1027m 625m  73m S    2 15.8   2:24.94 VirtualBox
30217 tyler     20   0 1027m 625m  73m S   10 15.8   2:25.94 VirtualBox
30217 tyler     20   0 1027m 625m  73m S    5 15.8   2:26.44 VirtualBox
30217 tyler     20   0 1027m 625m  73m S   13 15.8   2:27.72 VirtualBox</pre>
<p>Two conclusions:</p>
<ol>
<li>Software virtualisation uses more RAM.  The guest is configured with 1 GB of RAM.  With VT-x, this uses 1020 M.  Without, it uses 1027 M.  Whether that represents a memory overhead of 7M per VM or 0.7% of total RAM per VM, I don&#8217;t care.  It&#8217;s small enough.</li>
<li>Software virtualisation, under these conditions, is more efficient than using VT-x.  The average CPU usage with VT-x was 9.2%.  Without, it was 6.7%.</li>
</ol>
<p>Engineering and science students will recall that all experimenters must note potential flaws and sources of error.</p>
<ol>
<li>This tests only a guest which is completely idle.  However, my general impression when doing actual work in the guest VM supports the idle observation.</li>
<li>top isn&#8217;t the best measure of performance, but it is indicative.</li>
<li>I only tested a 64-bit Intel host with a 32-bit Windows guest.  As always, more data is better.</li>
</ol>
<p>I also note that my keyboard and mouse no longer skip when the guest OS is busy.  Clearly something is up with VT-x and Ubuntu 9.10 hosts.  The right thing to do is to perform more tests confirm the initial observations, but I&#8217;m not going to spend any more time on this.  Software virtualisation, so far, has been plenty fast for me.  I&#8217;ll just disable VT-x on all guests, and test again after the next upgrade for VirtualBox or the host kernel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/11/04/poor-virtualbox-guest-performance-with-intel-vt-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running root apps on a user&#8217;s desktop with qtcurve</title>
		<link>http://www.tolaris.com/2009/11/02/running-root-apps-on-a-users-desktop-with-qtcurve/</link>
		<comments>http://www.tolaris.com/2009/11/02/running-root-apps-on-a-users-desktop-with-qtcurve/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:05:31 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=580</guid>
		<description><![CDATA[I previously wrote about running apps as root on a normal user&#8217;s desktop.  I still recommend that you follow those steps, but one thing has changed with the release of karmic and the inclusion of the qtcurve widget style.
Unlike the now deprecated gtk-qt widget style, qtcurve doesn&#8217;t let you configure anything.  It directly [...]]]></description>
			<content:encoded><![CDATA[<p>I previously wrote about <a href="http://www.tolaris.com/2008/10/02/running-root-apps-with-user-gui-preferences/">running apps as root on a normal user&#8217;s desktop</a>.  I still recommend that you follow those steps, but one thing has changed with the release of karmic and the inclusion of the <a href="http://www.kde-look.org/content/show.php?content=40492">qtcurve</a> widget style.</p>
<p><span id="more-580"></span>Unlike the now deprecated gtk-qt widget style, qtcurve doesn&#8217;t let you configure anything.  It directly reads your preferences from KDE and uses those.  In particular, it uses your &#8220;General&#8221; font setting from KDE Control Centre -> Appearance -> Fonts.</p>
<p>There is a bug with qtcurve which causes it to have big fonts by default.  A fix can be found in my <a href="http://www.tolaris.com/2009/11/01/upgrading-from-kubuntu-9-04-to-9-10/">last post</a>.</p>
<p>If you use qtcurve, the GUI style won&#8217;t apply to your applications running as root.  This is because qtcurve doesn&#8217;t respect the contents of ~/.gtkrc-2.0 (normally where GTK engines look for customisations).  It instead reads your ~/.kde/share/config/kdeglobals file.</p>
<p>So if you want your root applications to look like your normal applications, first fix qtcurve as above.  Then copy your kdeglobals to root:</p>
<p><code>sudo cp ~/.kde/share/config/kdeglobals /root/.kde/share/config/kdeglobals</code></p>
<p>You&#8217;ll have to repeat this if you change your &#8220;General&#8221; font setting.  Don&#8217;t symlink to your file, as this may cause it to be owned by root next time you run an application as root.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/11/02/running-root-apps-on-a-users-desktop-with-qtcurve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading from Kubuntu 9.04 to 9.10</title>
		<link>http://www.tolaris.com/2009/11/01/upgrading-from-kubuntu-9-04-to-9-10/</link>
		<comments>http://www.tolaris.com/2009/11/01/upgrading-from-kubuntu-9-04-to-9-10/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 14:40:36 +0000</pubDate>
		<dc:creator>tyler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tolaris.com/?p=561</guid>
		<description><![CDATA[Friday I upgraded from Kubuntu 9.04 &#8220;Jaunty Jackalope&#8221; to Kubuntu 9.10 &#8220;Karmic Koala&#8221;.  Here are my notes on the upgrade.
Jaunty has been my Windows Vista.  I wish I had never upgraded, and waited instead for Karmic.  For anyone using Intel video (I use a Dell Vostro 1500 with an onboard Intel GM965/GL960), [...]]]></description>
			<content:encoded><![CDATA[<p>Friday I upgraded from Kubuntu 9.04 &#8220;Jaunty Jackalope&#8221; to Kubuntu 9.10 &#8220;Karmic Koala&#8221;.  Here are my notes on the upgrade.</p>
<p><span id="more-561"></span>Jaunty has been my Windows Vista.  I wish I had never upgraded, and waited instead for Karmic.  For anyone using Intel video (I use a Dell Vostro 1500 with an onboard Intel GM965/GL960), Jaunty and KDE4 was a terrible experience.  Compared to Hardy and KDE3, video performance was dramatically worse.  When playing videos frames would drop, 3D acceleration was slower, everything showed more tearing effects, and most KDE4 apps showed graphics corruption in various rarely-updated areas such as the icon toolbar in Kontact.</p>
<p>I had already discovered the video issues when I  wrote my <a href="/2009/08/18/upgrading-from-kubuntu-8-04-to-9-04/">last upgrade post</a>, but hadn&#8217;t yet realised the extend of the wireless issues.  I have two cards in my laptop:</p>
<pre>tyler@baal:~$ lspci | grep -i network
0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
0d:00.0 Ethernet controller: Atheros Communications Inc. AR5001 Wireless Network Adapter (rev 01)</pre>
<p>Under Jaunty, the Intel card caused kernel panics on shutdown.  So I blacklisted the driver and used the Atheros card, only to discover problems with both the ath_pci  and ath5k drivers.  The former doesn&#8217;t work with network manager, and with the latter the card would sometimes fail in a state requiring full hardware reset, meaning powering the laptop off and on again.  This would happen on bootup too, causing me to sometimes reboot several times to make wireless work.  It is not good to begin the workday filled with frustration and rage.</p>
<p>I did my best to mitigate the issues under Jaunty, including using the latest KDE backports from the <a href="https://launchpad.net/~kubuntu-ppa">Kubuntu PPA</a>.  But the only real solution to my video problems was to upgrade to the latest kernel, X, and intel video drivers.  I use Ubuntu because I want reasonably recent packages but without the headache of running true alpha / bleeding-edge releases.  Replacing all the critical parts of the distro seemed like the wrong way to go.  So I suffered and waited for the day Karmic came out.</p>
<p>The <a href="http://www.ubuntu.com/getubuntu/releasenotes/910">9.10 release notes</a> cover a number of known issues.  What strikes me about the known issues is how few of them affect me.  Many are related to the netbook remix, or specific to recent netbooks with proprietary hardware.  Support for the general case of mostly Intel hardware released 1-2 years ago is all there.</p>
<p>Upgrading from Jaunty to Karmic was just a matter of doing what the GUI prompted me to do.  This wasn&#8217;t like jumping from KDE 3 to 4, so I didn&#8217;t remove any dotfiles or reformat.  I just made my usual backup and then did the upgrade.  I had a problem and had to stop the upgrade during the post-download, configuration part, so I ran <code>dpkg --configure -a</code> in a terminal and everything finished just fine.</p>
<p>What went wrong:</p>
<p><strong>Synaptics touchpad tap suppression</strong> (syndaemon) stopped working.  This is an artifact of upgrading from Jaunty, where to use syndaemon you have to enable SHMConfig in xorg.conf and then run syndaemon as <code>syndaemon -S -d -t -i 1</code>.  On upgrading to karmic, set SHMConfig to false, restart X, and call syndaemon without -S (the switch doesn&#8217;t exist anymore anyway).  I just removed my xorg.conf altogether, since X doesn&#8217;t seem to need it.</p>
<p><strong>ath_pci</strong>, the madwifi Atheros wireless driver, is gone.  I use this for aircrack and kismet.  It is likely that I can either compile it or use the ath or ath5k drivers for the same thing, but I haven&#8217;t had time to test this.</p>
<p><strong>openvpn with knetworkmanager</strong> still doesn&#8217;t work, at least with certificates that don&#8217;t have a passphrase.  So far, openvpn doesn&#8217;t even start.  From syslog:</p>
<pre>Nov  1 13:51:32 baal NetworkManager: <WARN>  nm_vpn_connection_connect_cb(): VPN connection 'company vpn' failed to connect: 'No VPN secrets!'.</pre>
<p>Even if it did work, the dialog doesn&#8217;t even have a tab for manually setting up routes.  Since when is the equivalent Gnome app <em>more</em> configurable than its KDE counterpart?</p>
<p><strong>Ozone</strong>, the default KDE window theme, doesn&#8217;t use colour to denote the active window.  Instead it uses stripes to the right of the text in the title bar.  Some people say that compositing window managers and transparency are supposed to make this a non-issue, but they are wrong.  I expect my active window to have a blue window border, and the others to be grey.  To fix this, open the Control Centre.  Go to &#8220;Appearance&#8221;, then the &#8220;Windows&#8221; side bar.  Under the &#8220;Window Decoration&#8221; tab, choose &#8220;Ozone&#8221;.  Under the &#8220;Decoration Options&#8221; area, uncheck &#8220;Blend title bar colours with window contents&#8221;.</p>
<p>What went right:</p>
<p><strong>kernel mode setting</strong> is awesome!  This currently works only for those of us that use Intel video, which is perhaps a small reward for suffering through Jaunty.  Switching between X and virtual terminals is fast and seamless.  The console has a gorgeous high-res mode at boot-time.  I haven&#8217;t seen the screen flicker once since GRUB booted the kernel, from X startup to the KDM greeter to Plasma startup.</p>
<p><strong>Booting</strong> is very fast.  On my laptop I see KDM within 15 seconds of the kernel loading.  I have a usable desktop 15 seconds after that.  I&#8217;m sure more things are starting in the background, but they don&#8217;t seem to slow down my login process.</p>
<p><strong>Xorg</strong> just figures everything out.  I no longer have an xorg.conf and all my hardware works. Plus xrandr now has a <a href="/2009/04/14/enabling-1080p-video-on-the-shuttle-x27d-htpc">large virtual area</a> by default:</p>
<pre>tyler@baal:~$ xrandr
Screen 0: minimum 320 x 200, current 1680 x 1050, maximum 8192 x 8192</pre>
<p>This should work just fine with multi-monitor setups.</p>
<p><strong>Google Earth</strong> and <strong>Kwin</strong> with compositing work at the same time.  So far I&#8217;ve had no issue with any 3D apps running together, and they are all about 3 times as fast as they were under Jaunty.</p>
<p><strong>qtcurve</strong>, the new KDE/GTK appearance integration engine.  This replaced the deprecated gtk-qt engine which had all kinds of drawing errors especially with firefox.  Qtcurve uses your &#8220;general&#8221; font setting from KDE in GTK apps, and generally makes GTK apps look like KDE ones.  Unfortunately it is <a href="https://bugs.launchpad.net/ubuntu/+bug/414711">broken out of the box</a>.  The solution is to install the &#8220;kcm-gtk&#8221; package, and then use Control Centre to edit your &#8220;general&#8221; font setting.  Set it to something else and then back again, or put this in ~/.kde/share/config/kdeglobals:</p>
<pre>[General]
XftHintStyle=hintmedium
font=DejaVu Sans,8,-1,5,50,0,0,0,0,0</pre>
<p>Wireshark never looked so pretty.</p>
<p><strong>Firefox 3.5</strong>, which really is as fast as you&#8217;ve heard.  KDE users, give up and use the default theme.  All the &#8220;hack it to look like KDE&#8221; themes just don&#8217;t work as well as the one the developers themselves test against.</p>
<p><strong>Plasma</strong> is stable.  This isn&#8217;t a surprise as I&#8217;ve been running 4.3.2 from the PPA under Jaunty.  Since Karmic is stable I&#8217;m not going to use the PPA for bleeding edge KDE releases anymore (until another juicy feature gets released, no doubt).</p>
<p><strong>fish</strong>, the Kioslave for file transfer over SSH, is fast once again.  It no longer generates notifications for normal browsing activity, either, which was extremely irritating under Jaunty.</p>
<p><strong>knetworkmanager</strong> works once again.  It was more than a little annoying to use Gnome&#8217;s network manager.</p>
<p>They finally got it right with <strong>Amarok 2.2</strong>.  iPod support seems complete, the GUI is configurable (why does the playlist default to the right pane?), the collection scanner is much faster than Amarok 1.4, and it hasn&#8217;t crashed yet.</p>
<p>Karmic has been added to the <a href="/apt-repository/">repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tolaris.com/2009/11/01/upgrading-from-kubuntu-9-04-to-9-10/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
