Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahoereth/2607d2ee99103a0a9bc9 to your computer and use it in GitHub Desktop.
Save ahoereth/2607d2ee99103a0a9bc9 to your computer and use it in GitHub Desktop.

Tutorial: Meteor on Windows using Vagrant

Requirements

Before doing anything else, install those:

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/trusty32 (Ubuntu 14.04 32bit - use ubuntu/trusty64 for x64)
  5. Edit the Vagrantfile and add the following inside the Vagrant.configure(...) block:
    config.vm.synced_folder './shared', '/home/vagrant/shared'
    
    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
    
  6. vagrant up
  7. 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 directory 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 their code available to the Windows host.

  1. (cd ~/shared)
  2. meteor create --example leaderboard
  3. cd leaderboard
  4. mkdir -p ~/mock/leaderboard
  5. mv .meteor ~/mock/leaderboard
  6. mkdir .meteor
  7. sudo mount --bind /home/vagrant/mock/leaderboard/.meteor .meteor
  8. 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.
  • You will have to remount (step 7 above) the .meteor directory on every vagrant restart. Mount the directory before you do any version control!
  • To halt a vagrant VM: vagrant halt
  • To destroy a VM: vagrant destroy
  • You might want to run sudo apt-get update in the VM to install the latest Ubuntu security updates

Original tutorial by @gabrielsapo

@elGusto
Copy link

elGusto commented Jan 13, 2015

@gabrieljenik

I did and it works just perfect. I just spent a little while figuring out how to let VB capture the usb port and let adb recognize the device.

@PanArnaud
Copy link

It was very useful ! Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment