Before doing anything else, install those:
- VirtualBox: https://www.virtualbox.org/wiki/Downloads
- Vagrant: http://downloads.vagrantup.com/
- git: http://git-scm.com/download/win
Open cmd: Start > type cmd > ENTER
cd C:\path\to\your\vagrant+meteor\project\foldermkdir sharedset PATH=%PATH%;C:\Program Files (x86)\Git\bin(Append git binaries to path so vagrant can run ssh - you should add git to your PATH environmental variable permanently so you don't have to run this everytime)vagrant init ubuntu/trusty64(Ubuntu 14.04 x64)- Edit the Vagrantfile and add the following inside the
Vagrant.configure(...)block:
config.vm.synced_folder './shared', '/home/vagrant/shared', nfs: true
config.vm.provision :shell, :path => "meteor.sh"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.provider "virtualbox" do |v|
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
vagrant upvagrant ssh
Now that you are inside the VM command-line:
sudo apt-get install curl gitcurl https://install.meteor.com | sh
This also applies when you clone an app from git. The idea is to move the .meteor folder out of the shared direction and link it back in. MongoDB cannot run in the shared folder because of permission problems. Create all apps in the ~/shared folder to make them available to your Windows host.
- (
cd ~/shared) meteor create --example leaderboardcd leaderboardmkdir -p ~/mock/leaderboardmv .meteor ~/mock/leaderboardmkdir .meteorsudo mount --bind /home/vagrant/mock/leaderboard/.meteor .meteormeteor(finally!)
Go to http://localhost:3000 in Windows browser!
- Make sure you do version control INSIDE THE VM, so the software can follow the mounted
.meteordirectory. - To halt a vagrant VM:
vagrant halt - To destroy a VM:
vagrant destroy
Original by @gabrielsapo
Thanks for this.