To setup a virtual machine running a windows OS, We would be using vagrant
and virtualbox
.
Vagrant
is an open-source software product for building and maintaining portable virtual software developement environments. We can use vagrant
to build a box
from scratch or use an existing box
Box
is the package format for Vagrant environments. A box can be used by anyone on any platform that Vagrant supports to bring up an identical working environment.
Virtualbox
is a free and open-source hosted hypervisor for x86 computers currently being developed by Oracle Corporation. Basically, virtualbox
enables us to run more than one operating system at a time. For example, On my MacOS I could also run a windows OS.
To follow along with this guide, we need to have vagrant
and virtualbox
installed on our system. If you don't have them installed, follow the steps below
- Ensure you have
homebrew
installed on your system or clickhere
for instruction on installinghomebrew
- To install vagrant, run the command below in your terminal
brew install cask vagrant
- To install virtualbox, run the command below
brew install cask virtualbox
After completing the prerequisites, follow the steps below to configure a virtual machine on your system.
-
Clone the repository below on github, run the command below to do that
git clone https://github.com/kensanni/configuring-a-virtual-machine.git
-
Move into
configuring-a-virtual-machine
directorycd configuring-a-virtual-machine
-
To build the windows OS, run
vagrant up
This might takes some time, depending on your network connectivity since the size of the box is a little bit large.
-
run
virtualbox
to open the virtualbox UI and click on theshow
button to open your windows OS
When we run vagrant up
, vagrant checks for a Vagrantfile
. Vagrantfile is a configuration file for vagrant, here we specified an existing windows OS vagrant box.
If you are getting an error like the one below
This is most likely caused by a poor network connectivity. To fix this error, ensure you have a stable network and also prevent your system from going to sleep while vagrant up
is still running.