Hi I got this error 'VM must be created before running this command. Run `vagrant up` first. ' when i run vagrant ssh command

These are the steps i did.
1.Run vagrant up --version
Bringing machine ‘mongod-m103’ up with ‘hyperv’ provider…
==> mongod-m103: Verifying Hyper-V is enabled…
==> mongod-m103: Verifying Hyper-V is accessible…
==> mongod-m103: Box ‘ubuntu/trusty64’ could not be found. Attempting to find and install…

  • mongod-m103: Box Provider: hyperv*
  • mongod-m103: Box Version: >= 0*
    ==> mongod-m103: Loading metadata for box ‘ubuntu/trusty64’
  • mongod-m103: URL: https://vagrantcloud.com/ubuntu/trusty64*
    The box you’re attempting to add doesn’t support the provider
    you requested. Please find an alternate box or use an alternate
    provider. Double-check your requested provider to verify you didn’t
    simply misspell it.

If you’re adding a box from HashiCorp’s Vagrant Cloud, make sure the box is
released.

Name: ubuntu/trusty64
Address: https://vagrantcloud.com/ubuntu/trusty64
Requested provider: [:hyperv]
2.Run vagrant ssh
VM must be created before running this command. Run vagrant up first.

It’s trying to use Hyper-V instead of VirtualBox. You need to:

  1. Disable Hyper-V. Search the forum or the Internet for instructions on this. But if you absolutely need Hyper-V for other things, let us know.
  2. Run vagrant up without --version.

And have you installed the latest version of VirtualBox as per the instructions?

Hi ,
Like you said i disabled hyper v , restarted PC and run vagrant --up
result is
Bringing machine ‘mongod-m103’ up with ‘hyperv’ provider…
==> mongod-m103: Verifying Hyper-V is enabled…
The Hyper-V cmdlets for PowerShell are not available! Vagrant
requires these to control Hyper-V. Please enable them in the
“Windows Features” control panel and try again.

my Vagrant version is 2.2.6,virtual box version is 6.1.0r135406

Can you share a full screenshot of the command and the full output. And also your OS and version.

Hi my OS is windows 10 Pro
Here is the commands

For some reason vagrant is trying to use Hyper-V as the default provider.

From your System Environment Variables, let’s see a screenshot of all the variables beginning with “VBOX”:
image

In the meantime, try the following command:
vagrant up --provider virtualbox

C:\Users\fascs\Handouts\m103\m103-vagrant-env>vagrant up --provider


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.
My virtual box version is 6.1.0r135406 ,should i install a lower version and try?

Uninstall VirtualBox 6.1 and install 6.0. That’s what the error message is saying and I’m using 6.0 which works.

But before you do this, rename the variable from VBOX_MSI_INSTALL_PATH to VBOX_INSTALL_PATH and run vagrant up again. I would like to see if it uses VirtualBox.

Renaming of VBox path wont work .Any way let me try with old version and check , thank you

Rename the name of the variable, not the path. This is a bug that’s why I’m requesting you do this.

Rename the variable, open a new terminal and run vagrant up.

i did the same , rename the system variable from VBOX_MSI_INSTALL_PATH to VBOX_INSTALL_PATH , Open a new command window and run the command vagrant up .
C:\Users\fascs\Handouts\m103\m103-vagrant-env>vagrant up
Bringing machine ‘mongod-m103’ up with ‘hyperv’ provider…
==> mongod-m103: Verifying Hyper-V is enabled…
The Hyper-V cmdlets for PowerShell are not available! Vagrant
requires these to control Hyper-V. Please enable them in the
“Windows Features” control panel and try again.

Also tried vagrant up --provision , i am getting same error message

Hi,i did a fresh installation of virtual box 6.0 but still i am facing issues ,please help
C:\Users\fascs\Handouts\m103\m103-vagrant-env>vagrant up
Bringing machine ‘mongod-m103’ up with ‘virtualbox’ provider…
==> mongod-m103: Box ‘ubuntu/trusty64’ could not be found. Attempting to find and install…
mongod-m103: Box Provider: virtualbox
mongod-m103: Box Version: >= 0
==> mongod-m103: Loading metadata for box ‘ubuntu/trusty64’
mongod-m103: URL: https://vagrantcloud.com/ubuntu/trusty64
==> mongod-m103: Adding box ‘ubuntu/trusty64’ (v20190514.0.0) for provider: virtualbox
mongod-m103: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20190514.0.0/providers/virtualbox.box
mongod-m103: Download redirected to host: cloud-images.ubuntu.com
mongod-m103:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Failed to connect to cloud-images.ubuntu.com port 443: Timed out

Looks more like a Firewall and/or Antivirus that’s blocking this. Are you connected to a corporate network as well?

not yet , i just have an antivirus in my pc

Disable your firewall and antivirus and try again.

antivirus was already in disabled state , i turned off all firewalls, still same error ,do i need a system restart needed ?

I don’t think so, but give it a try.

Run a few tests and let’s see the screenshots:

  1. What’s the outcome of this on a web browser
    http://portquiz.net:443
  2. Run on a terminal
    ping cloud-images.ubuntu.com
  3. If you have telnet installed:
    telnet cloud-images.ubuntu.com 443
1 Like
  1. utcome of this on a web browser
    http://portquiz.net:443 is an html page with header Outgoing port tester and This server listens on all TCP ports, allowing you to test any outbound TCP port.

You have reached this page on port 443 .

Your network allows you to use this port. (Assuming that your network is not doing advanced traffic filtering.)

Network service: https
Your outgoing IP: 86.98.54.30
2.ping cloud-images.ubuntu.com -timeout

This is the problem. You can’t reach that repository from your network. It works fine for me.

… if you’re using a work laptop, it’s most likely using a proxy.

Test using these instructions or search for “Proxy” on Windows start menu.