diff --git a/test/virtualbox.sh b/test/virtualbox.sh
index 28913f1..db152f8 100755
--- a/test/virtualbox.sh
+++ b/test/virtualbox.sh
@@ -9,7 +9,7 @@ os_filename="$1"
 vbox_dir="$(./utils/mktemp.sh -d)"
 vmname="automatic-os-test-$(date +%s)-$$"
 
-ln -sf "$(readlink -f "$os_filename")" "build/virtualbox.img"
+ln -sf "$(./utils/absolute-path.sh "$os_filename")" "build/virtualbox.img"
 VBoxManage createvm --name "$vmname" --register --basefolder "$vbox_dir"
 VBoxManage modifyvm "$vmname" --hwvirtex off
 VBoxManage modifyvm "$vmname" --nestedpaging off
diff --git a/utils/absolute-path.sh b/utils/absolute-path.sh
new file mode 100755
index 0000000..f086e69
--- /dev/null
+++ b/utils/absolute-path.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 1 || test "$1" = "-h" -o "$1" = "--help"; then
+  echo "Usage: $0 [/]absolute/or/relative/path"
+fi
+
+case "$1" in
+  /*) echo "$1";;
+  *) echo "$PWD/$1";;
+esac
diff --git a/utils/auto-push.sh b/utils/auto-push.sh
index 01ea1fa..288d445 100755
--- a/utils/auto-push.sh
+++ b/utils/auto-push.sh
@@ -65,7 +65,7 @@ else
   eval `ssh-agent -s`
   ssh-add ~/.ssh/travis-deploy-key-id_rsa
 
-  travis_known_hosts="$(realpath "$(dirname "$0")/travis_known_hosts")"
+  travis_known_hosts="$("$(dirname "$0")/absolute-path.sh" "$(dirname "$0")/travis_known_hosts")"
   chmod 600 "$travis_known_hosts"
   echo "$travis_known_hosts"
   cat "$travis_known_hosts"
diff --git a/utils/gui-wrapper-mac.sh b/utils/gui-wrapper-mac.sh
index c6579fd..0d1d4ba 100755
--- a/utils/gui-wrapper-mac.sh
+++ b/utils/gui-wrapper-mac.sh
@@ -5,7 +5,7 @@ set -e
 resolution="$1" # e.g. 800x600x24 (width x height x bits_per_pixel)
 shift           # the following arguments are the program to execute and its arguments
 
-bg="$(realpath "build/checkerboard_$(echo "$resolution" | cut -d 'x' -f1-2).png")"
+bg="$(./utils/absolute-path.sh "build/checkerboard_$(echo "$resolution" | cut -d 'x' -f1-2).png")"
 anim="$(./utils/mktemp.sh -d)"
 
 echo "$anim $resolution $@"