Vagrant Setup on Azure Windows VM

Hi All,

During Vagrant setup on Azure VM I’m facing issue. Once i run “vagrant up” command its start provisioning VM “Database” & “Infrastructure” and its restart my VM machine with message “Running Pre-boot VM customization…” and its never come back .I tried multiple time on Window,Linux. but faced same issue every time.

Please help to resolve this issue.


There might be some restrictions/problems in running a VirtualBox VM inside an Azure VM but first let’s try a few things.

Instead of running vagrant up, it’s best to build the machine one-by-one starting with the database machine:

  1. Provision the database machine:
    a) Update the provision-database file using these instructions
    b) Run the following
    vagrant destroy database -f
    vagrant up database
    c) Login and test
    vagrant ssh database
    mongo --version
    NB: If the mongo command doesn’t show you the version details, then your installation was not complete.
  2. Provision the infrastructure machine:
    a) Run the following
    vagrant destroy infrastructure -f
    vagrant up infrastructure
    b) Login
    vagrant ssh infrastructure

If you encounter problems, share a full screenshot.

Hi @satvant_43960,

You can also try to edit the vagrant file and the changes mentioned in the following link for both the virtual boxes: infrastructure and database:

I hope it helps!!

Please let me know, if you still face any issues.


Hi Sonali, Thanks for your response.

Steps are not clear in link attached .As what customization needed before boot is not mentioned in given link for my issue.

Could you provide specific solution. Screen print attached.


I take it you haven’t followed the steps I provided in my post?

Hi 007_jb,

I was unable to try steps given by you, because after running command “vagrant up” it shutdown my Host machine and provision “database” VM under OracleVM which is not configured correctly .
When start "database VM " manually it again stop my host machine.Means my provisioned database VM is corrupt.

Please let know if you have other option to resolve.


Which host machine are you referring to here, Azure or your local machine? And how did you manage to take that screen grab?

Also note that I mentioned vagrant up database and not vagrant up so give that a try.

I’m referring here my Azure VM . I tired your steps but still same issue .

After boot I tried to start database VM manually but it not happening.

Check if your Azure environment can accept inbound traffic on port 2222. I believe that there are some settings you’ll need to apply on your VM to allow vagrant to work, either from a resource allocation and/or network traffic point of view.


Yes , Azure inbound traffic on port 2222 is allowed. Even it allow for all port but still i have same issue.

Hi @satvant_43960,

I think my initial presumption still stands. I’ve just tried this on an AWS Workspace (i.e. similar to a managed PC/workstation) and it also disconnected/rebooted when it tried to boot up the VM.

I’m yet to try it on an EC2 instance (which I believe is equivalent to Azure’s VM) but I would imagine that the same restrictions would apply too; not being able to use the VM as a hypervisor.

Suggest you contact Azure for confirmation or install the course VM on your local machine.

Did the OS system (windows10) go threw an update after you started? If so, I had the same issue when my Windows10 laptop did a system update.

I was able to fix it by deleting the network drivers for the VM box. Virtual box will create 2 Virtual Network cards. The update will change something on them and that will cause issues. delete them and let Virtual box recreate them when you execute Vargrant Up command.

Please let us know if this solves the issue.

1 Like

I don’t know if you realise that we’re talking about a cloud environment, Microsoft Azure @Johnny_40501? :slight_smile:

Yes, I do. Windows for the most part works the same. It worth a try.