- Download and install vagrant from vagrantup.com (requires system restart)
- Other stuff
Download a box image : http://hashicorp-files.vagrantup.com/precise32.box
vagrant init
vagrant box add --name mybox precise32.box
Now before actually starting the box, let's do some further configuration.
The stuff below is inspired by this stackoverflow question.
First connect to wifi-hotspot to allow installation of the plugin below.
vagrant plugin install vagrant-proxyconf
Add the following to the Vagrantfile to work with vagrant-proxyconf
plugin
Vagrant.configure("2") do |config|
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://username:password@192.168.0.2:3128/"
config.proxy.https = "http://username:password@192.168.0.2:3128/"
config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
end
# ... other stuff
end
While we're in the vagrantfile, we'll need to set up port-forwarding for RStudio Server (which uses 8787 by default). So where the # ... other stuff
is, insert the following:
config.vm.network "forwarded_port", guest:8787, host:8787
This starts the VM and connects to it using SSH
vagrant up
vagrant ssh
Run the following inside the VM
sudo apt-get update
sudo apt-get install curl
sudo apt-get install gdebi-core
sudo apt-get install libapparmor1 # Required only for Ubuntu, not Debian
wget http://download2.rstudio.org/rstudio-server-0.98.1103-i386.deb
sudo gdebi rstudio-server-0.98.1103-i386.deb
Note that the service is automatically started after installation, but if you need to, here's how you modify its state.
sudo rstudio-server stop
sudo rstudio-server start
sudo rstudio-server restart
For more on managing RStudio server, see here, or the administrator guide.
From the host-machine: point chrome to localhost:8787
and login with username and password vagrant/vagrant
.
From any other machine: point chrome to mycomputername:8787
and login with username and password vagrant/vagrant
.