Allow VirtualBox to run as a different user than the runner service

This commit adds the configuration option "override_user_name" for
VirtualBox runners, allowing the VirtualBox executor to run VBoxManage
commands as a different user than the one under which the GitLab Runner
service is running. This is currently only implemented for Unix-like
systems using "sudo -u" to execute VirtualBox commands. The runner must
also be running with sufficient privileges so that it can run commands
under the specified user without requiring a password (on Linux, the
runner service is executed under root, so it will already have
sufficient priviliges on such systems).

Fixes #1121
17 jobs for run-virtualbox-as-configured-user in 37 minutes and 22 seconds (queued for 7 seconds)
latest
Status Job ID Name Coverage
  Prebuild
passed #72703788
docker
bindata

00:09:23

passed #72703789
clone test repo

00:01:08

manual #72703790
allowed to fail manual
review-docs-deploy
 
  Test
passed #72703791
codequality

00:01:05

passed #72703794
docs check links

00:00:39

passed #72703796
git 1.7.1

00:04:55

passed #72703795
docker
race conditions detector

00:15:21

failed #72703793
docker allowed to fail
unit tests

00:15:18

passed #72703792
docker
unit tests (no race)

00:06:37

 
  Build
passed #72703797
docker
binaries darwin/386 darwin/amd64

00:04:37

passed #72703798
docker
binaries freebsd/386 freebsd/amd64 freebsd/arm

00:04:11

passed #72703799
docker
binaries linux/386 linux/amd64 linux/arm

00:06:47

passed #72703800
docker
binaries windows/386 windows/amd64

00:05:02

 
  Package
passed #72703801
docker
package-deb

00:02:21

passed #72703803
docker
package-rpm

00:02:15

 
  Release
passed #72703804
docker
development docker images

00:03:26

 
  Cleanup
manual #72703805
allowed to fail manual
review-docs-cleanup
 
Name Stage Failure
failed
unit tests Test
?   	gitlab.com/gitlab-org/gitlab-runner/helpers/userexec	[no test files]
? gitlab.com/gitlab-org/gitlab-runner/helpers/virtualbox [no test files]
ok gitlab.com/gitlab-org/gitlab-runner/network 6.708s coverage: 81.7% of statements
? gitlab.com/gitlab-org/gitlab-runner/scripts [no test files]
ok gitlab.com/gitlab-org/gitlab-runner/shells 1.058s coverage: 29.6% of statements
? gitlab.com/gitlab-org/gitlab-runner/shells/mocks [no test files]
Makefile:195: recipe for target 'test' failed
make: *** [test] Error 1
ERROR: Job failed: exit code 1