Index: trunk/src/VBox/Additions/solaris/Installer/postinstall.sh
===================================================================
--- trunk/src/VBox/Additions/solaris/Installer/postinstall.sh	(revision 58203)
+++ trunk/src/VBox/Additions/solaris/Installer/postinstall.sh	(revision 59001)
@@ -335,19 +335,4 @@
 groupadd vboxsf >/dev/null 2>&1
 
-# install openGL extensions for X.Org
-if test ! -z "$xorgbin"; then
-    # 32-bit crogl opengl library replacement
-    if test -f "/usr/lib/VBoxOGL.so"; then
-        cp -f /usr/X11/lib/mesa/libGL.so.1 /usr/X11/lib/mesa/libGL_original_.so.1
-        ln -sf /usr/lib/VBoxOGL.so /usr/X11/lib/mesa/libGL.so.1
-    fi
-
-    # 64-bit crogl opengl library replacement
-    if test -f "/usr/lib/amd64/VBoxOGL.so"; then
-        cp -f /usr/X11/lib/mesa/amd64/libGL.so.1 /usr/X11/lib/mesa/amd64/libGL_original_.so.1
-        ln -sf /usr/lib/amd64/VBoxOGL.so /usr/X11/lib/mesa/amd64/libGL.so.1
-    fi
-fi
-
 # Move the pointer integration module to kernel/drv & remove the unused module name from pkg and file from disk
 
Index: trunk/src/VBox/Additions/solaris/Installer/preremove.sh
===================================================================
--- trunk/src/VBox/Additions/solaris/Installer/preremove.sh	(revision 58203)
+++ trunk/src/VBox/Additions/solaris/Installer/preremove.sh	(revision 59001)
@@ -65,15 +65,4 @@
 /opt/VirtualBoxAdditions/x11restore.pl
 
-# Restore crogl symlink mess
-# 32-bit crogl opengl library replacement
-if test -f "/usr/lib/VBoxOGL.so" && test -f "/usr/X11/lib/mesa/libGL_original_.so.1"; then
-    mv -f /usr/X11/lib/mesa/libGL_original_.so.1 /usr/X11/lib/mesa/libGL.so.1
-fi
-
-# 64-bit crogl opengl library replacement
-if test -f "/usr/lib/amd64/VBoxOGL.so" && test -f "/usr/X11/lib/mesa/amd64/libGL_original_.so.1"; then
-    mv -f /usr/X11/lib/mesa/amd64/libGL_original_.so.1 /usr/X11/lib/mesa/amd64/libGL.so.1
-fi
-
 
 echo "Done."
Index: trunk/src/VBox/Additions/solaris/Installer/vboxguest.sh
===================================================================
--- trunk/src/VBox/Additions/solaris/Installer/vboxguest.sh	(revision 58203)
+++ trunk/src/VBox/Additions/solaris/Installer/vboxguest.sh	(revision 59001)
@@ -178,4 +178,42 @@
 }
 
+install_3d()
+{
+    # 32-bit crogl opengl library replacement
+    if test -f /system/volatile/opengl/lib/libGL.so.1 && test -f /usr/lib/VBoxOGL.so && \
+        /usr/bin/VBoxClient --check3d; then
+        rm -f /system/volatile/opengl/lib/libGL.so.1
+        ln -sf /usr/lib/VBoxOGL.so /system/volatile/opengl/lib/libGL.so.1
+    fi
+
+    # 64-bit crogl opengl library replacement
+    if test -f /system/volatile/opengl/lib/amd64/libGL.so.1 && test -f /usr/lib/amd64/VBoxOGL.so && \
+        /usr/bin/VBoxClient --check3d; then
+        rm -f /system/volatile/opengl/lib/amd64/libGL.so.1
+        ln -sf /usr/lib/amd64/VBoxOGL.so /system/volatile/opengl/lib/amd64/libGL.so.1
+    fi
+}
+
+remove_3d()
+{
+    # 32-bit crogl opengl library replacement
+    if test -f /system/volatile/opengl/lib/libGL.so.1 && test -f "/usr/lib/mesa/libGL.so.1"; then
+        rm -f /system/volatile/opengl/lib/libGL.so.1
+        ln -sf /usr/lib/mesa/libGL.so.1 /system/volatile/opengl/lib/libGL.so.1
+    elif test -f /system/volatile/opengl/lib/libGL.so.1 && test -f "/usr/X11/lib/mesa/libGL.so.1"; then
+        rm -f /system/volatile/opengl/lib/libGL.so.1
+        ln -sf /usr/X11/lib/mesa/libGL.so.1 /system/volatile/opengl/lib/libGL.so.1
+    fi
+
+    # 64-bit crogl opengl library replacement
+    if test -f /system/volatile/opengl/lib/amd64/libGL.so.1 && test -f "/usr/lib/mesa/amd64/libGL.so.1"; then
+        rm -f /system/volatile/opengl/lib/amd64/libGL.so.1
+        ln -sf /usr/lib/mesa/amd64/libGL.so.1 /system/volatile/opengl/lib/amd64/libGL.so.1
+    elif test -f /system/volatile/opengl/lib/amd64/libGL.so.1 && test -f "/usr/X11/lib/mesa/amd64/libGL.so.1"; then
+        rm -f /system/volatile/opengl/lib/amd64/libGL.so.1
+        ln -sf /usr/X11/lib/mesa/amd64/libGL.so.1 /system/volatile/opengl/lib/amd64/libGL.so.1
+    fi
+}
+
 status_module()
 {
@@ -189,4 +227,5 @@
 stop_all()
 {
+    remove_3d
     stop_vboxms
     stop_vboxfs
@@ -201,4 +240,5 @@
     start_vboxfs
     start_vboxms
+    install_3d
     return 0
 }
@@ -221,6 +261,8 @@
     start_module
     start_vboxms
+    install_3d
     ;;
 stop)
+    remove_3d
     stop_vboxms
     stop_module
@@ -240,4 +282,10 @@
 vmsstop)
     stop_vboxms
+    ;;
+3dstart)
+    install_3d
+    ;;
+3dstop)
+    remove_3d
     ;;
 *)
