Paul Becotte
Paul Becotte

Reputation: 9997

Jenkins / Vagrant / VirtualBox - Virtualbox is running as the system user?

I'm pretty new to both VirtualBox and Vagrant, but not Jenkins. I have a Jenkins build being run on a Windows slave that is running "vagrant up" in a specific directory. There was a problem with the VM- I went to that directory and tried to manually run vagrant up and it started recloning the box. Investigating, the VirtualBox VMs folder is being stored in /Windows/system32... I have looked and the Jenkins process and the VirtualBox process are definately being run as the user account that is running the jenkins slave. If I log into that account and launch virtualbox, it looks for VMs in the account home directory though!

I could probably fix this by pointing both accounts to a third location, but I would like to understand why this is happening. Any takers?

Upvotes: 0

Views: 1238

Answers (1)

ivan.sim
ivan.sim

Reputation: 9288

According to the docs, since VirtualBox 4.0, the default location where virtual machines are saved is the current system user's home directory. So:

  1. C:\Documents and Settings\<username> on Windows
  2. /Users/<username> on Mac OS X
  3. /home/<username> on Linux and Solaris

Take a look at the Default Machine Folder settings of the virtualbox on your Windows slave to see if anyone has changed the path to /Windows/System32

File > Preferences > General > Default Machine Folder

Also, I am assuming you are using the jenkins vagrant plugin to spawn your vagrant box? (If not, you should). AFAIK, that plugin doesn't require any system administrator privilege on the slave machine.

Upvotes: 1

Related Questions