Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 42 additions & 15 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "ubuntu/trusty64"

# Using Ubuntu Server 14.04 (Trusty Tahr), supported by R

# if we are running parallels provider, use the following box
config.vm.provider "parallels" do |v, override|
override.vm.box = "parallels/ubuntu-14.04"
end

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
Expand All @@ -25,7 +31,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "66.66.66.10"
config.vm.network "private_network", ip: "192.168.33.12"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
Expand All @@ -36,20 +42,32 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Default value: false
# config.ssh.forward_agent = true

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "./project/", "/www-shiny/", create: true
# The shiny:shiny user is created after provisioning using uid=999 and
# guid=999. Mounting "/www-shiny-writeable/" using the expected uid and guid
# as is done below allows us to mount the shared folder with shiny:shiny
# permissions before the shiny user is created. This method allows the Shiny
# server to write to the app folder below, but not the one above (whose user
# is vagrant).
config.vm.synced_folder "./writeable-project/", "/www-shiny-writeable/",
create: true, mount_options:["uid=999,gid=999"]
# Share the project folder to your Shiny web server folder
# config.vm.synced_folder "../data", "/vagrant_data"
hostos = RbConfig::CONFIG["host_os"].downcase
case hostos
when 'linux-gnu'
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder './project/', '/www-shiny/', :nfs => true,
:mount_options => ['rw', 'vers=3', 'tcp', 'nordirplus', 'nolock', 'local_lock=none'],
:create => true
# The shiny:shiny user is created after provisioning using uid=999 and
# guid=999. Mounting "/www-shiny-writeable/" using the expected uid and guid
# as is done below allows us to mount the shared folder with shiny:shiny
# permissions before the shiny user is created. This method allows the Shiny
# server to write to the app folder below, but not the one above (whose user
# is vagrant).
config.vm.synced_folder './writeable-project/', '/www-shiny-writeable/',
:nfs => true, :mount_options => ['rw', 'vers=3', 'tcp', 'nordirplus',
'nolock', 'local_lock=none'], :create => true
# Share the project folder to your Shiny web server folder
else
config.vm.synced_folder './project/', '/www-shiny/', :nfs => true, :create => true
config.vm.synced_folder './writeable-project/', '/www-shiny-writeable/', :nfs => true,
:create => true
end

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
Expand All @@ -63,6 +81,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.customize ["modifyvm", :id, "--memory", "1536"]
end
#
config.vm.provider "parallels" do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
vb.update_guest_tools = true
vb.memory = 1536
end
#
# View the documentation for the provider you're using for more
# information on available options.

Expand Down