How to Quickly Set Up a Vagrant + VirtualBox Development Environment on Windows
Learn step‑by‑step how to install VirtualBox and Vagrant on Windows 7/10, configure a CentOS6 box, troubleshoot common PowerShell and virtualization errors, set up SSH access with Xshell, and enable bidirectional folder syncing for a seamless development environment.
The following instructions are based on Windows 7 (64‑bit); adjust compatibility steps if you use a different OS.
Using the Vagrant + VirtualBox combo simplifies development environment setup. This guide shows how to configure it on Windows.
1. Install VirtualBox
Run the provided VirtualBox-5.2.18-124319-Win.exe installer.
2. Install Vagrant
Run the provided vagrant_2.1.2_x86_64.exe installer.
3. Add a box
Navigate to the folder where you want the VM (e.g., D:\centos6) and execute:
vagrant box add demo CentOS6.box
4. Initialize the environment
vagrant init demo
5. Start the VM
vagrant up
Common issues:
5.1 PowerShell version too low – upgrade to PowerShell 3.0 using the executables provided in the same directory.
5.2 Virtualization not enabled – enable VT‑x/AMD‑V in BIOS. You can also uncomment the following lines in Vagrantfile to show the VirtualBox GUI and see the error:
config.vm.provider "virtualbox" do |vb| vb.gui = true end
5.3 Insufficient user permissions – add the following to Vagrantfile and save:
config.ssh.username = "root" config.ssh.password = "vagrant"
Then run vagrant up again.
6. Install Xshell
Download and install Xshell (provided as Xshell-6.0.0095p.exe).
7. Access the VM
Windows terminals do not support SSH directly, so use Xshell:
Create a new session in Xshell (File → New) and fill in the details as shown.
Connect with username root and password vagrant to enter the VM.
7.3 Enable bidirectional folder sync
Edit Vagrantfile (remember to save) and add:
config.vm.network "private_network", ip: "192.168.33.10" config.vm.synced_folder "D:/website", "/home/www", :mount_options => ["dmode=7777","fmode=666"]
This syncs D:/website on the host with /home/www in the VM. After reloading the VM ( vagrant reload), you can access services via the host IP 192.168.33.10. Example connection screenshot:
8. Completion
If you are on Windows 10 and cannot create symbolic links after entering the VM, run the client tools (e.g., Git Bash, Xshell) with administrator privileges.
Attachments (e.g., installers) can be downloaded by clicking “Read the original article”.
Architecture Talk
Rooted in the "Dao" of architecture, we provide pragmatic, implementation‑focused architecture content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
