Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Aaron HARPT
Aaron HARPT
19,845 Points

laravel homestead

I am having another error when I run vagrant up in the command line. Here is the error that I am getting:

The VirtualBox VM was created with a user that doesn't match the current user running Vagrant. VirtualBox requires that the same user be used to manage the VM that was created. Please re-run Vagrant with that user. This is not a Vagrant issue.

The UID used to create the VM was: 501 Your UID is: 0

4 Answers

Andrew Shook
Andrew Shook
31,709 Points

Did you use "sudo" to create the VM?

Aaron HARPT
Aaron HARPT
19,845 Points

Can you tell me why that would matter?

Andrew Shook
Andrew Shook
31,709 Points

If your using a MAC, an probably Windows but not 100% sure, then your user is not the root user ( even if your user is the only user on the system), your user is just a regular user with sudo/admin privileges. That's why you have to type in your user password to install software you download from the internet, the OS is using "sudo" in the background to install the software. If you used "sudo" to create the vm, then technically that vm belongs to the root user and not you. Hence, you can start up the VM, because don't own it. To check the ownership you can open up a terminal, navigate to the directory holding the VM, and run the command ls -al (list all file in the long format). That will give you something that looks like this:

d rwx------  3  andrewshook  staff  102  Oct 1 2014  VirtualBox VMs
d rwxr-xr-x  2  root  staff  68  Nov 13 16:52  testDir

The first on is my VirtualBox folder that I created without sudo, and the second one is a test folder I made using sudo. Notice that "staff", the user group I am in, doesn't have permission to write/create files in the testDir folder. My permissions are r-x, meaning I can read and execute files in that folder but not write/create. However, because I didn't install VirtualBox using sudo my user is the owner, and when I run vagrant, vagrant is allowed to use access the VirtualBox folder because is own both. If you "sudo" installed VirtualBox though, then vagrant doesn't have permission to use VirtualBox, because you don't have permission to write to VB (which vagrant will need to do).

Aaron HARPT
Aaron HARPT
19,845 Points

I have a different virtual machine on my system that works, and they are both from the same installation of Vagrant and Virtual Box.