98vboxadd-xclient revision 5c65eaa08f2ec993a19c9bef6e5463918e40e0eb
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#!/bin/sh
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard#
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Start the Guest Additions X11 Client
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Copyright (C) 2007-2010 Oracle Corporation
8dd4618c4709236b4ea297d7250d282e463ce2d8rbb#
8dd4618c4709236b4ea297d7250d282e463ce2d8rbb# This file is part of VirtualBox Open Source Edition (OSE), as
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawick# available from http://www.virtualbox.org. This file is free software;
2deb319e6b3de239f45c16a3e9e836d44f1f7108rbb# you can redistribute it and/or modify it under the terms of the GNU
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb# General Public License (GPL) as published by the Free Software
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanoj# Foundation, in version 2 as it comes in the "COPYING" file of the
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard#
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard# It can happen that pidfiles from a sudo session can land in the user's
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard# home directory and prevent new ones from being created. This is not really
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard# our fault, but the user may not quite appreciate that...
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddardfor i in $HOME/.vboxclient-*.pid; do
4a81c8eb2a61b43a9dd0879a65feb834a6dde1d5stoddard if test -r $i && ! ps -e | grep `cat $i`; then
bfb62a96023822c56c9120e4ee627d4091cc59c2rbb rm -f $i
bfb62a96023822c56c9120e4ee627d4091cc59c2rbb fi
bfb62a96023822c56c9120e4ee627d4091cc59c2rbbdone
bfb62a96023822c56c9120e4ee627d4091cc59c2rbb
bfb62a96023822c56c9120e4ee627d4091cc59c2rbb# Check whether the display we are running on running a known buggy version
bfb62a96023822c56c9120e4ee627d4091cc59c2rbb# of X.Org which might crash when we resize.
bfb62a96023822c56c9120e4ee627d4091cc59c2rbbno_display=
1c6fb1e726ce22694de0e9a957adb67b929e5d4fstoddardxorgbin=Xorg
1c6fb1e726ce22694de0e9a957adb67b929e5d4fstoddardfound=`which Xorg | grep "no Xorg"`
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddardif test ! -z "$found"; then
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard if test -f "/usr/X11/bin/Xorg"; then
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard xorgbin=/usr/X11/bin/Xorg
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard else
91a71946d0fb28c0866139edef3dd59f36ba5b9cstoddard exit 1
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj fi
369edcdd0a9c5516c61e736ec2a6fc8fb0d92fe2manojfi
369edcdd0a9c5516c61e736ec2a6fc8fb0d92fe2manojxout=`$xorgbin -version 2>&1`
2a6c49cfaef5979a5a06098f3ce987cd76769409manojif echo "$xout" | grep "1\.4\.99\.90[12345]" > /dev/null
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddardthen
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddard no_display=1
85cbdc16ac57fa68ce1358a308269abcd417f4d9stoddardfi
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard/usr/bin/VBoxClient --clipboard
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddard/usr/bin/VBoxClient --checkhostversion
d208bda4a893cc81ed5d3ed1cdd7d706e012bd42stoddardtest -z "$no_display" &&
10b386767f6c87b45937244371cb751f0b454d16wrowe /usr/bin/VBoxClient --display
10b386767f6c87b45937244371cb751f0b454d16wrowetest -z "$no_display" &&
75960f20f88dad6bc67892c711c429946063d133stoddard /usr/bin/VBoxClient --seamless
75960f20f88dad6bc67892c711c429946063d133stoddard