Skip to content

Instantly share code, notes, and snippets.

@theparticleman
Created December 2, 2015 23:00
Show Gist options
  • Save theparticleman/8eace8f96d1d078251b7 to your computer and use it in GitHub Desktop.
Save theparticleman/8eace8f96d1d078251b7 to your computer and use it in GitHub Desktop.
ASP.NET 5 with .NET Core Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :private_network, ip: "192.168.33.15"
$script = <<-SCRIPT
reset
sudo apt-get update
sudo apt-get install unzip curl -y
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh
sudo apt-get install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev uuid-dev -y
dnvm upgrade -r coreclr
sudo apt-get install make automake libtool curl -y
curl -sSL https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | sudo tar zxfv - -C /usr/local/src
cd /usr/local/src/libuv-1.4.2
sudo sh autogen.sh
sudo ./configure
sudo make
sudo make install
sudo rm -rf /usr/local/src/libuv-1.4.2 && cd ~/
sudo ldconfig
sudo apt-get install git -y
cd ~
git clone https://github.com/aspnet/Home.git
SCRIPT
config.vm.provision "shell", inline: $script, privileged: false
end
@theparticleman
Copy link
Author

Once you vagrant up and vagrant ssh in to the box, you can do the following to start a web site:
cd ~/Home/samples/1.0.0-rc1-final/HelloWeb - switch to the directory where one of the samples lives
dnu restore - restore nuget packages
dnx web - start up the web server

You may want to make a change in project.json so that the web site will be accessible outside of the VM. If so, change the http://localhost:5004 url to something like http://192.168.33.15:5004. You should then be able to access the website from your host machine.

@karneaud
Copy link

What sample files?

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