diff --git a/README_tests.md b/README_tests.md
index efaef30361b3e03d674cb25a19ead24124f08aea..556444cf787123ea8f8ce589304cbb88638098ab 100644
--- a/README_tests.md
+++ b/README_tests.md
@@ -17,13 +17,16 @@ Once the requirements are in place, the test suite may be run in this manner:
     git clone git@0xacab.org:liberate/backupninja.git
     cd backupninja
     vagrant up
-    vagrant rsync
     vagrant ssh -c "sudo /vagrant/test/test.sh"
 
 It's possible to only test a specific handler with:
 
     vagrant ssh -c "sudo /vagrant/test/test.sh rdiff"
 
+To synchronise changes in the source code and rebuild backupninja:
+
+    vagrant rsync local && vagrant ssh -c "build-backupninja.sh"
+
 Please report any problems with the test suite on the issue tracker at:
 
     https://0xacab.org/liberate/backupninja/-/issues
diff --git a/Vagrantfile b/Vagrantfile
index eb824cc43f9fd5d7851b0eb61b20651463655848..1de10f84b3b7308b3877a4feaba5a1adeda84952 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -41,11 +41,16 @@ Vagrant.configure("2") do |config|
       locale-gen
       apt-get update
       apt-get install -y automake make dialog sshpass
-      cd /vagrant
-      ./autogen.sh
-      ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --libexecdir=/usr/lib
-      make
-      make install
+      BUILDSCRIPT="/usr/local/bin/build-backupninja.sh"
+      echo "#!/bin/sh" >> $BUILDSCRIPT
+      echo "cd /vagrant" >> $BUILDSCRIPT
+      echo "make clean" >> $BUILDSCRIPT
+      echo "./autogen.sh" >> $BUILDSCRIPT
+      echo "./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --libexecdir=/usr/lib" >> $BUILDSCRIPT
+      echo "make" >> $BUILDSCRIPT
+      echo "sudo make install" >> $BUILDSCRIPT
+      chmod +x $BUILDSCRIPT
+      $BUILDSCRIPT
       mkdir -p /root/.ssh
       yes y | ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N ''
       echo "StrictHostKeyChecking accept-new" >> /root/.ssh/config