I want to go over some common issues that might arise when working with vagrant and virtual box.
The first issue I want to talk about is anti-virus software.
Some windows anti-virus software such as Vira EVGA and others have been known to interfere with the
operation of virtual box.
I have listed some errors on your screen here that can be associated with this type of issue.
If you get such an error when starting a virtual machine try disabling your anti-virus software and
rebooting your system.
Here's a screenshot of one such error.
Even if you're using vagrant to control your virtual machines it can be helpful to start the virtual
box application to get a better idea of what is happening with your virtual machines.
Again the workaround for this is to simply disable the anti-virus software or switch to another anti-virus
software that doesn't interfere with virtual box.
If you happen to have a Mac you could use it for your coursework as most of the issues we'll be talking
about here are Windows related in some way another issue you might encounter is that your virtual machines
virtual network cable may be disconnected on boot.
You'll see the message on your screen after you run vagrant up.
If that's the case if you were to open up the virtual box application you would find that the virtual
machine is running.
Also if you were to go to the settings of that virtual machine and click on network and finally click
on advanced you would see that the check box next to cable connected is unchecked.
We want to make sure that this box is checked and we can tell vagrant to do that for us.
Here's how you add an additional stanza to your vagrant file which is highlighted on your screen.
This tells vagrant to make sure that the virtual cable is connected.
For that virtual machine when it is started once you've added this additional configuration you can
run vagrant to reload which will restart the virtual machine this time with a network interface enabled
this brings me to another issue I've seen before and that's not editing the correct vagrant file.
Sometimes we're working with multiple virtual machines and we think we're editing one file when we're
actually editing another one.
I suggest starting your editor from the command line in the directory that you're running your vigorish
commands in one editor that I like and recommend is called Adam.
It has syntax highlighting so it makes spotting some typing mistakes easier.
Also it works on Windows Mac and Linux to edit the vagrant file in your current directory simply execute
atom space vagrant file with a capital V.
Another reason you might see the previous error message about the config.
VM that boot underscore timeout setting is because the virtualization settings for your processor haven't
been enabled in your BIOS.
You can confirm this by looking at the Virtual Box window for your virtual machine.
Also known as the Gooley or graphical user interface.
The easiest way to do that is to add the configuration on your screen to the vagrant file and then run
vagrant to reload.
If you see an error in your virtual machine window that says something along the lines of this kernel
requires an X 86 64 CPQ but only detected it.
I 686 EPU.
Then you need to enable the virtualization options in your BIOS.
This means making sure that you have VTX for Intel processors and am divi for A&E processors enabled.
This varies from manufacturer to manufacturer so you might have to look up the documentation for your
specific computer.
Really one of the most common issues I see when working with configuration files including the vagrant
file are simple typing mistakes.
A very common one that I see a lot that is specific to vagrant files.
Is using an equal sign in the config that VM dot network line.
It looks correct but it isn't.
You see config that VM dot box followed by an equal sign you also see configure VM hostname followed
by an equal sign and if you continue with that pattern you'll actually use config that the M.Com network
followed by an equal sign.
But that is not the syntax that vagrant is expecting.
The proper syntax is config dot VM dot network followed by a space.
There is no equal sign on that line.
If you are to run vagrant up with this configuration you'll get an error like the one on your screen.
The good news is that the error message tells you what line the problem is on although it doesn't necessarily
point to the proper place in the line.
Again just remove the equal sign and when you run vagrant up you'll be all set.
This simple mistake just goes to show you how important it is to pay attention to details.
Every little character counts punctuation and capitalization included during this course you will be
installing web applications.
If you can pin your virtual machine but you can't get to it from your web browser it could be a couple
of different things.
First off if you're using Microsoft edge browser it has some additional security features that prevent
you from connecting to a local IP address on your system.
So the first thing to do is try a different web browser.
I'm a big fan of Google's Chrome browser but there are other good choices as well such as Firefox.
If you've tried another web browser and still can't connect to the web application then make sure the
web server is running.
Look at its status with System CDL is Dasch active h TPD or system CDL status.
H t TPD.
If it's stopped then started with Sardou system sitio start HTP D.
Also make sure to enable it with sudo system CDL enable H.T. TPD if we forgot this step and rebooted
our virtual machine.
The web server will not start automatically on boot.
This is a common reason why the web server isn't running.
If the web server is running but you still can't access your application via a web browser the next
thing to check is the Arab League do that by running SU to cat.
Slash var Ford slash law Ford slash HDDVD forward slash error underscore log.
There is another issue with the web server you'll almost always be able to determine what it is by looking
at the error log file.
By the way if you're ever prompted by windows with a question like do you want to allow this app to
make changes to your computer.
Answer Yes it's either a vagrant or a virtual box trying to configure your system for you.
You might see a message about Hashi Corp which is associated with vagrant or Oracle which is associated
with Virtual Box.
It's perfectly fine to give those applications the ability to make changes on your system.
Are known good applications.
They aren't going to infect your system with a virus for example there's a chance you'll see something
like this the first time you try to configure an IP address on one of your virtual machines for example.
If you don't allow vagrant and virtual box to modify settings on your Windows system then they aren't
going to function properly if you've tried several troubleshooting steps and nothing seems to work.
I would suggest first taking a break and then starting all over start over with a fresh directory then
run vagrant init in that new directory and try again all the way from the beginning of that project.
Sometimes when we try a little bit of this and a little bit of that we can create new issues so it can
be best just to start over again with a clean slate.
Finally I want to leave you with one last troubleshooting step which is to simply reboot your physical
computer and try again.
There is a chance that something is not functioning properly that isn't immediately obvious to us.
There could be a process or procedure that is hanging or a duplicate network configuration in use because
of all of our troubleshooting steps.
When it comes to troubleshooting our local systems this is a relatively quick and harmless thing to
try.