diff -burN ioemu/Makefile.target ioemu-vmgl/Makefile.target
--- ioemu/Makefile.target	2007-02-14 16:57:01.000000000 -0500
+++ ioemu-vmgl/Makefile.target	2007-02-15 14:33:38.000000000 -0500
@@ -405,7 +405,7 @@
 VL_OBJS+=gdbstub.o 
 endif
 ifdef CONFIG_SDL
-VL_OBJS+=sdl.o
+VL_OBJS+=sdl.o $(LIBVMGLSTUBPATH)/../../dist/lib/libvmglstubdaemon.a
 endif
 VL_OBJS+=vnc.o
 VL_OBJS+=d3des.o
@@ -464,7 +464,7 @@
 	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
 
 sdl.o: sdl.c keymaps.c sdl_keysym.h
-	$(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
+	$(CC) $(CFLAGS) -I$(LIBVMGLSTUBPATH) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
 
 vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
 	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
diff -burN ioemu/sdl.c ioemu-vmgl/sdl.c
--- ioemu/sdl.c	2007-02-14 16:57:01.000000000 -0500
+++ ioemu-vmgl/sdl.c	2007-02-15 14:23:59.000000000 -0500
@@ -25,6 +25,10 @@
 
 #include <SDL.h>
 
+/* VMGL */
+#include <SDL_syswm.h> 
+#include "vmgl-stub-daemon.h"
+
 #ifndef _WIN32
 #include <signal.h>
 #endif
@@ -524,6 +528,7 @@
 {
     int flags;
     uint8_t data = 0;
+    SDL_SysWMinfo info; /* VMGL */
 
 #if defined(__APPLE__)
     /* always use generic keymaps */
@@ -561,6 +566,10 @@
     sdl_cursor_normal = SDL_GetCursor();
 
     atexit(sdl_cleanup);
+    /* VMGL */
+    SDL_VERSION(&info.version);
+    SDL_GetWMInfo(&info);
+    daemonStart(info.info.x11.window, 7001, ".stub-daemon.log");
     if (full_screen) {
         gui_fullscreen = 1;
         gui_fullscreen_initial_grab = 1;
