> F30.me

My personal place to publish… stuff.


Virtio consoles on Debian

libvirt with QEMU/KVM supports Virtio consoles, which are paravirtualized serial consoles. This is natively supported by Linux (for the guest system) and unlike with serial emulation, you don’t have to care about stuff like baud rate and bit parameters.

When using virt-install, a Virtio console can be added using --console pty,target_type=virtio. In the libvirt XML format, the result will look something like this:

<console type='pty' tty='/dev/pts/4'>
  <source path='/dev/pts/4'/>
  <target type='virtio' port='0'/>
  <alias name='console0'/>

The console will be available inside the guest at /dev/hvc0. To be able to actually use it, a TTY has to be spawned on it, i.e. getty has to be started. However, this is not the case by default on Debian (as of Stretch, with systemd).

The Quick Fix

Common wisdom is to manually enable getty, i.e. run systemctl enable serial-getty@hvc0.

This will work, but should actually not be necessary: systemd-getty-generator is supposed to automatically spawn getty for virtualization consoles. Looking at its source code, you see that this includes /dev/hvc0.

Freezing the Boot

After reading this article by Lennart Poettering, one might be tempted to activate the console using a kernel parameter, i.e. adding “console=hvc0” to “GRUB_CMDLINE_LINUX” in /etc/default/grub. However, this will not work and actually freeze the boot process since the kernel apparently cannot find the “hvc0” device.

This is because the Virtio console driver only gets loaded later in the boot process, which means it is not available at kernel start.

The Proper Solution

As it turns out, the reason for systemd-getty-generator not spawning getty is actually the same: systemd generators run pretty early during the boot process; apparently also before the Virtio console driver has been loaded.

The fix for this is to add the Virtio console kernel module to the guest’s initrd. On Debian, this can be done by putting “virtio_console” into /etc/initramfs-tools/modules and running update-initramfs -u afterwards.

After rebooting, you should be able to get a TTY using virsh console. If you want to get boot messages on the Virtio console, you may now also add the “console=hvc0” kernel parameter without freezing the boot (use “console=tty0 console=hvc0” to keep the messages on the graphical console as well).

No Responses

Installing LaTeX Winfonts on Linux or OS X

The Windows default fonts like Georgia or Verdana aren’t completely bad and still mark today’s standard for lots of applications. Sometimes, one might have the crazy idea of wanting to use them in LaTeX – be it because style rules dictate it, or because one just likes their look.

For this purpose, the “Winfonts” package exists, but it only provides installation instructions for Windows and is not installable through TeX Live. So this guide will walk you through the necessary steps to use Winfonts with TeX Live on Linux or OS X. Read on…

1 Response

Some graphics on Git

While preparing a beginner course on Git for my job at noris network, I was looking for graphics to point out some tough topics: The relationships between working copy, index and repository and between local and remote branches. Unfortunately, I couldn’t find anything satisfying – this here seemed to be the closest it would get to me imaginations.

So I fired up Inkscape and created some images myself. They of course simplify things and I’m not a great graphic designer, but they helped me at making my point. And, as I hope, they might also be useful for you when explaining concepts or understanding yourself.

Therefore today, I am releasing the graphics under the Creative Commons Attribution-ShareAlike 3.0 Germany license. You should attribute to „Felix Dreissig, noris network AG“ as author if you use them. The images are partially based on Tango icons, which are in Public Domain.

Basic branching

(There are a lot of similars to that one out there, I admit.)

Git Branching

Download SVG

Repository/Index/working copy

This attempts to demonstrate the differences between the three areas. Changed or new files are marked in red.

Git Repo/Index/Working-copy

Download SVG


That one features a remote server and a development machine. The latter keeps an exact copy of the server’s branches, plus some local branches.

Git Remote/Local

Download SVG

3 Responses

(oh-my-)zsh key bindings on Ubuntu 12.10

After upgrading my Ubuntu system to the 12.10 beta recently, I experienced some strange quirk in my shell related to the oh-my-zsh key bindings: The up-line-or-search feature on arrow-up (resp. down-line-or-search on arrow-down) had ceased to work. One could still browse the history using the arrow keys as that seems to be zsh’s default configuration, but the “search history for commands beginning with the first word I entered” feature didn’t work anymore.

I figured out that Ctrl+V reported the key code ^[OA for arrow-up, while the other tools I checked (namely cat and bash) still returned the ordinary ^[[A. At first I guessed that this behavior had to do with Ubuntu’s upgrade to zsh 5.0, but then some help from #zsh on freenode pointed me into the right direction:

Debian’s /etc/zsh/zshrc (and therefore Ubuntu’s as well), which is executed for every shell in addition to your personal .zshrc now contains those crucial lines:

if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
    function zle-line-init () {
        printf '%s' ${terminfo[smkx]}
    function zle-line-finish () {
        printf '%s' ${terminfo[rmkx]}
    zle -N zle-line-init
    zle -N zle-line-finish
    # ...

In general, it seems to be a good idea to put the terminal into “application mode” before executing zle, at least you can find code like that in some other zshrcs as well. I still don’t entirely understand what this is about, but some information about terminal modes can be found here. What’s important to know in order to understand the above snippet is that by outputting the smkx or rmkx codes, you enable or disable application mode.

Application mode, however, uses different key codes which don’t match the hardcoded ones from oh-my-zsh. I finally solved the issue by replacing the oh-my-zsh arrow key bindings with this:

bindkey "${terminfo[kcuu1]}" up-line-or-search
bindkey "${terminfo[kcud1]}" down-line-or-search

(Debian’s /etc/zshrc conveniently stores the codes in an associative array called keys, but I didn’t wanna rely on that.)

There might be more key bindings which are affected from the problem, but I only noticed it for the arrow keys in daily usage. In my opionion it is bad style to use hardcoded key codes for the bindings in the first place and this is something that should be fixed by oh-my-zsh. I’m even a bit surprised why I couldn’t already find a patch or at least a bug report – if I manage to find enough time, I’ll definitely do that.

Update: Heres’s my pull request targeting the problem. What I wasn’t aware of (even though there’s a comment describing it right above the relevant lines), is that the reason to enable application mode at all is making use of terminfo. Ironically enough, you have to make sure application mode is really active (using some code similar to the above one), if you want to fix the problem that it causes. After all, however, you get a cleaner and more portable configuration.

4 Responses

To-do service shootout

When it comes to task management, I didn’t have a sophisticated workflow up to now: I kept most things in my head, in busy times I would write to-dos down on a piece of paper and I kept a Simplenote list of more long-term tasks which I don’t want to forget (mostly filled out of panic when stressed and never actually done). While this worked out in general, I felt like I could be more relaxed and productive with some technical support. What I was looking for is a service that follows basic GTD principles and lets me structure my tasks by a variety of data types without forcing me into a stringent, “religious” GTD workflow. Simple to-do list programs with due dates like Wunderlist or iOS Reminders therefore aren’t the right thing.

I want to use and sync the tasks across all of my devices, so a cloud-enabled service seemed like the way to go. Since Linux versions of desktop apps are often not available, services which don’t offer a web interface for desktop usage (primarily OmniFocus) didn’t come into consideration for me. Another basic requirement was the availability of an iOS app for mobile usage. What I didn’t check were features for collaboration, sharing and assigning of tasks as I have no usecase for that at the moment.

This lead to the major contestants from my research: Remember the Milk, Producteev and Doit.im. Let’s take a look at the pros and cons of those three and how they compare with each other…

Remember the Milk

remember the milk RTM can be seen as the pioneer when it comes to web-based to-do management: It has been around since 2005 and I even have had an account there for some years, though I didn’t actively use it. Nowadays, its web interface looks a bit old-fashioned at first sight. However, it turns out to be pretty powerful if you adapt to it.

The service provides a great variety of ways to structure your tasks, as the only one of the three including the possibility to attach them to locations. Due to the lack of location-based notifications, iOS Reminders are still the best option in my rare usecases for such a feature, but I feel like there might be an opportunity for RTM’s approach at some time. In fact, they don’t support reminders at all, – not even time-based ones – so you always have to check your to-do lists on your own, even for very important tasks. What’s lacking as well is the possibility to set start times for to-do items, i.e. dates before they can’t be accomplished and therefore shouldn’t show up in some views.

The iPhone and iPad version of the service’s app is done quite nicely, though practically unusable without a Pro account: It doesn’t automatically keep your account in sync and lets you only sync manually once in 24 hours. However, I think the Pro subscription is priced quite fairly at $25 per year, even without offering student discount rates. I tend to keep local backups of all of my relevant data from cloud services; RTM provides ATOM and iCal feeds of your tasks, which seems good enough for me.


producteev What RTM ails at its web interfaces, Producteev makes up: It offers a through and through modern and good-looking web app. What I like about it as well is the unique feature to create lightweight subtasks for single to-do items, which basically just consist of some text and a “Completed” checkbox. While the other services let you assign only three levels of priorities, Producteev has fife of them. This seems like a sensible grade of granularity to me, though sometimes maybe a little bit too detailed.

I don’t really get along with their sorting of task lists, since you can’t select a secondary criterion and my desired behaviour doesn’t accord with the default: I like my to-do items to be sorted by deadline and within that by priority, which doesn’t seem to be possible with Producteev at the moment. For repeating tasks, there is no “repeat until” end date and just like at RTM, you can’t assign start times. The service always adds a time-based reminder to each task upon creation, but those don’t seem to show up anywhere in the default configuration except the web interface.

Producteev has a decent iPhone app, but an iPad version is still in the making and their workaround in form of tablet-optimized website can’t really compensate this big handicap. The service lets you download your data in CSV format, so a basic backup should be possible there as well.


Doit.im As only one of the three, Doit.im lets you set the start date for a task, but I don’t get along with their implementation of that feature: Since start times are seen at the “main time” for a task, it won’t let you set a deadline without a start date, which is what I need far more often than I want to set a start time at all. Maybe since that is the case for most people, they seem to mix the two dates in the interface and don’t seem to have a clear differentiation of their meaning. This is especially obvious as their whole (otherwise quite good) interface relies on the classification by start (or whatever) date. There’s still a second structure by “contexts”, but you can even get a complete list of your to-do items only crabwise. Good thing is, they have time-based reminders done right.

They also have a nifty app for iPhone und iPad. Doit.im’s Pro account description reads a lot like RTM’s “without it only sync manually once a day”, but I didn’t exceed the free Pro trial until now, so no confirmation on that. The Pro pricing, however, is comparable. As the only service of the presented three, Doit.im won’t let you download a copy if your data in any format.


No clear winner here: All of the three have their selling points and disadvantages. I for one bought a pro subscription from RTM and am now actively using it in my everyday life – works out pretty well so far. If Producteev gets their few but major downsides sorted out, they seem like a possible competitor in the future. Doit.im’s way to structure tasks just doesn’t fit into my workflow and I’m not expecting this to change fundamentally; its other feature don’t make it stand out as well.

2 Responses

Hello world!

So, here we go…
Ladies and Gentlemen, fasten your seatbelts and prepare for takeoff of ”F30.me”, my freshly deployed weblog.

As the subtitle suggests, I treat this site as “my personal place to publish… stuff”. And “stuff” really implies whatever I come along with: Sometimes in English, sometimes in German. Sometimes technical, sometimes political, sometimes personal. Sometimes my own articles, sometimes random findings from all over the internet.

To be realistic, I currently don’t expect a lot of regular readers. But sometimes I just feel like making my thoughts public and conserving them for the future – that’s why I created this blog. So dont’t expect regular updates or daily diary entries, actually the post frequency will be quite low. And some articles might also only interest a small, special audience.

Enough warning, I still hope you and others will find something useful here from time to time. And of course, this post wouldn’t be complete without the famous words of every first step in the digital world:
Hello world!

1 Response