Sunday, 20 May 2012

Xen: Failed while collecting E820 with: -3 (errno:0)



# xl create /etc/xen/ace2x1
Parsing config file /etc/xen/ace2x1

libxl: error: libxl_create.c:700:do_domain_create: Failed while collecting E820 with: -3 (errno:0)
: Success

I had to add some extra logging into libxl_pci.c to work this one out. It turns out it was choking in e820_sanitize on this test:


    if (!src || !map_limitkb || !balloon_kb || !nr_entries)
        return ERROR_INVAL;

As you can see, if balloon_kb is 0 (which comes from libxl_domain_config), it will fail. That's what was happening in my case.

libxl: error: libxl_pci.c:1182:e820_sanitize: ============== delta_kb: 0 start: 0 start_kb: 0 last: 0 map_limitkb: 200000 balloon_kb: 0 nr_entries: 18 

Hence, this issue can be worked around quite easily by adding a maxmem assignment to the guest config.

memory = '2047'
maxmem = '2048'

The kernel source for this kernel does not seem to be installed


Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.

I regularly reinstall my graphics drivers, but can never seem to remember where the link to the kernel source/headers should be for DKMS to find it automatically. Here it is for reference, assuming your kernel source/headers are placed at /usr/src/linux-<kernelversion>:

# unlink /lib/modules/$(uname -r)/build
# ln -s /usr/src/linux-$(uname -r) /lib/modules/$(uname -r)/build

Saturday, 12 May 2012

Synergy 1.3.8 crashes with Shift & other modifier keys

Synergy is one of those reliable applications which rarely goes wrong. However, following an upgrade either to the client or server, my Ubuntu synergy client crashed every time I used a modifier key such as Shift. Oddly enough, I have two synergy clients (one Debian, one Ubuntu), both using the same version (1.3.8), yet only the Ubuntu client suffered from this problem.


This problem is not uncommon, and the accepted solution is to upgrade to the latest beta version of synergy on both the server and the affected client.


Upgrading Ubuntu to 1.4.8 beta was predictably easy; download the .deb and install using your method of choice; either double-click or use dpkg.

Upgrading the synergy server was more complex, since that runs on my FreeBSD box. I originally installed it via the ports collection.

The process I followed was:

$ wget http://synergy.googlecode.com/files/synergy-1.4.8-Source.tar.gz
$ tar xf synergy-1.4.8-Source.tar.gz
$ cd synergy-1.4.8-Source
$ chmod +x configure
$ ./configure

Then I hit an error about a missing XKBlib.h. That clearly wasn't the case, the configure script was just looking in the wrong place:


$ find /usr/ -name XKBlib.h 2>/dev/null
/usr/local/include/X11/XKBlib.h

After messing around with CMakeLists.txt for some time without success, I found a helpful comment on an issue tracker which provided the less-than-obvious workaround:

$ rm -f CMakeCache.txt
$ cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DCMAKE_C_FLAGS="${CFLAGS} -I/usr/local/include -L/usr/local/lib" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -I/usr/local/include -L/usr/local/lib" \
-G "Unix Makefiles"

After that, I could proceed:

$ ./configure
$ make
$ cd bin
# cp synergys /usr/local/bin/synergys-1.4.8b
# mv /usr/local/bin/synergys /usr/local/bin/synergys-1.3.8
# ln -s /usr/local/bin/synergys-1.4.8b /usr/local/bin/synergys
# pkill synergys
# synergys -c /etc/synergy.conf