Tutorial: Meteor on Windows using Vagrant ==================================== ## Requirements 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 ## Steps on Windows command-line: Open cmd: Start > type cmd > ENTER 1. `cd C:\path\to\your\vagrant+meteor\project\folder` 2. `mkdir shared` 3. `set 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) 4. `vagrant init ubuntu/trusty64` (Ubuntu 14.04 x64) 5. Edit the Vagrantfile and add the following inside the `Vagrant.configure(...)` block: ``` config.vm.synced_folder './shared', '/home/vagrant/shared', nfs: true 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 ``` 7. `vagrant up` 8. `vagrant ssh` Now that you are inside the VM command-line: ## Steps on Ubuntu command-line: 1. `sudo apt-get install curl git` 2. `curl https://install.meteor.com | sh` ### Creating an app 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. 0. (`cd ~/shared`) 1. `meteor create --example leaderboard` 2. `cd leaderboard` 3. `mkdir -p ~/mock/leaderboard` 4. `mv .meteor ~/mock/leaderboard` 5. `mkdir .meteor` 5. `sudo mount --bind /home/vagrant/mock/leaderboard/.meteor .meteor` 6. `meteor` (finally!) Go to `http://localhost:3000` in Windows browser! ## Hints: * Make sure you do version control INSIDE THE VM, so the software can follow the mounted `.meteor` directory. * To halt a vagrant VM: `vagrant halt` * To destroy a VM: `vagrant destroy` --- Original tutorial by [@gabrielsapo](http://twitter.com/gabrielsapo)