Having trouble with Vagrant up command working on Mac

=> default: Adding box ‘m103’ (v0) for provider: virtualbox
default: Downloading: m103
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn’t open file /Users/ryancourtney/university/m103/m103
ryancourtney@Ryans-MacBook-Air-8 m103 % sudo vagrant up
Password:
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Box ‘m103’ could not be found. Attempting to find and install…
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly…
==> default: Adding box ‘m103’ (v0) for provider: virtualbox
default: Downloading: m103
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn’t open file /Users/ryancourtney/university/m103/m103
ryancourtney@Ryans-MacBook-Air-8 m103 %

Perhaps you can show a full screenshot of the entire log, from the command that you ran all the way to the end.

31%20PM

I started over and this is what Im getting now

Instead of vagrant init, try the following:
vagrant destroy
vagrant up

Then if all goes well, vagrant ssh

16%20PM

What’s the structure of your working directory? Can you ls let’s see.

12%20PM

There should be a provision-mongod file in this same dir. Download the zip file again and extract both files into the same directory.

Just to clarify, @007_jb means that you should do the following:

Re-download the course handouts in the "Lab: Setting Up the Vagrant Environment" lesson:



Once you have downloaded this zipped file, move it to your m103 folder and unzip it:



The two files circled in green below are the unzipped files you should have

vagrant_unzipped_files

Don’t worry about the provision-mongod - original file, that is just a copy I made of the provision-mongod file.

Also don’t worry about the 3 folders. Those folders will be created when you run the vagrant up --provision command.

1 Like

Hi @Ryan_Courtney_8612,

As suggested by @007_jb and @Jennifer_45288, please download the zip files again and cd into the “m103-vagrant-env” directory before you run your commands.

You can also refer to the following thread if you need help downloading the handouts and running vagrant:

Kindly get back if you face any issues.

Thanks,
Muskan
Curriculum Support Engineer

finally got it working! Thank you!

ndras-MBP:m103-vagrant-env chandradesam$ vagrant up

Bringing machine ‘mongod-m103’ up with ‘virtualbox’ provider…

==> mongod-m103: Clearing any previously set network interfaces…

There was an error while executing VBoxManage, a CLI used by Vagrant

for controlling VirtualBox. The command and stderr is shown below.

Command: [“hostonlyif”, “create”]

Stderr: 0%…

Progress state: NS_ERROR_FAILURE

VBoxManage: error: Failed to create the host-only adapter

VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface

VBoxManage: error: Context: “RTEXITCODE handleCreate(HandlerArg *)” at line 94 of file VBoxManageHostonly.cpp

I installed vbox and vagrant in my mac
iam geting this error in mac when i issued vagrant up command in shell

Now iam getting this error

(base) Chandras-MBP:m103-vagrant-env chandradesam$ vagrant up

The provider ‘virtualbox’ that was requested to back the machine

‘mongod-m103’ is reporting that it isn’t usable on this system. The

reason is shown below:

Vagrant has detected that you have a version of VirtualBox installed

that is not supported by this version of Vagrant. Please install one of

the supported versions listed below to use Vagrant:

4.0, 4.1, 4.2, 4.3, 5.0, 5.1, 5.2, 6.0

A Vagrant update may also be available that adds support for the version

you specified. Please check www.vagrantup.com/downloads.html to download

the latest version.

Hi @SUJANA_42894,

Please remove the existing version of VirtualBox from your system and download the 6.0 build using this link.

https://www.virtualbox.org/wiki/Download_Old_Builds_6_0

After doing this, please run these commands.

vagrant destroy

vagrant up

If you face any issue then please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

i removed existing version of virtualbox and dowloaded 6.0 build as you said.

But iam getting error like this, when i say vagrant destroy

(base) Chandras-MBP:m103-vagrant-env chandradesam$ vagrant destroy
The provider ‘virtualbox’ could not be found, but was requested to
back the machine ‘mongod-m103’. Please use a provider that exists.

Vagrant knows about the following providers: docker, hyperv

I reinstall vagrant and now vagrant up is working

Hi @SUJANA_42894,

I’m glad your issue got resolved. If you have any other query then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Closing the thread as both the issues has been resolved.