Index: /trunk/src/VBox/Additions/x11/Installer/x11config-new.pl
===================================================================
--- /trunk/src/VBox/Additions/x11/Installer/x11config-new.pl	(revision 24717)
+++ /trunk/src/VBox/Additions/x11/Installer/x11config-new.pl	(revision 24718)
@@ -43,4 +43,5 @@
         my $CFG;
         my $xkbopts = "";
+        my $kb_driver = "";
         if (open(CFG, $cfg))
         {
@@ -83,7 +84,24 @@
                         $xkbopts = $xkbopts . $line;
                     }
+                    # If we find a keyboard driver, remember it
+                    if ($line =~ /^\s*driver\s+\"(kbd|keyboard)\"/i)
+                    {
+                        $kb_driver = $1;
+                    }
                     $line = "# " . $line;
                 }
                 print TMP $line;
+            }
+
+            if ($kb_driver ne "")
+            {
+                print TMP <<EOF;
+Section "InputDevice"
+  Identifier   "keyboard[0]"
+  Driver       "$kb_driver"
+$xkbopts  Option       "Protocol" "Standard"
+  Option       "CoreKeyboard"
+EndSection
+EOF
             }
 
@@ -101,11 +119,4 @@
   Option      "ZAxisMapping" "4 5"
   Option      "CorePointer"
-EndSection
-
-Section "InputDevice"
-  Identifier   "keyboard"
-  Driver       "keyboard"
-$xkbopts  Option       "Protocol" "Standard"
-  Option       "CoreKeyboard"
 EndSection
 EOF
@@ -136,14 +147,6 @@
 EndSection
 
-Section "InputDevice"
-  Identifier   "keyboard[0]"
-  Driver       "kbd"
-$xkbopts  Option       "Protocol" "Standard"
-  Option       "CoreKeyboard"
-EndSection
-
 Section "ServerLayout"
   Identifier   "Layout[all]"
-  InputDevice  "Keyboard[0]" "CoreKeyboard"
   InputDevice  "Mouse[1]" "CorePointer"
   InputDevice  "Mouse[2]" "SendCoreEvents"
@@ -154,4 +157,5 @@
 EOF
             }
+
             print TMP <<EOF;
 
