From 0c4fad6f54f4bf9929ad8fe740164d4a66fd20da Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Fri, 6 May 2016 09:48:41 +0200 Subject: [PATCH 1/5] Get official ubuntu box * Is not needed to set url box, we can get directly box from https://atlas.hashicorp.com/ubuntu --- Vagrantfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index b8c467b..9b3511d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,7 +1,6 @@ Vagrant.configure("2") do |config| - config.vm.box = "precise64" - config.vm.box_url = "http://files.vagrantup.com/precise64.box" + config.vm.box = "ubuntu/precise64" config.vm.network :private_network, ip: "10.10.10.10" config.ssh.forward_agent = true @@ -14,4 +13,4 @@ Vagrant.configure("2") do |config| config.vm.provision :shell, :path => "server_config/server_install.sh" -end \ No newline at end of file +end From 6f892c7dbf5fb89eab629aa70b1e70ad29b86d6e Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Fri, 6 May 2016 09:51:27 +0200 Subject: [PATCH 2/5] Prefer official node repository * Took from https://github.com/nodesource/distributions ** We need 0.12 version ** chris-lea PPA is an obsolete repository --- server_config/server_install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server_config/server_install.sh b/server_config/server_install.sh index 18fd4ed..f3e4c92 100644 --- a/server_config/server_install.sh +++ b/server_config/server_install.sh @@ -6,8 +6,7 @@ sudo apt-get install lsb-release libfontconfig1 libfreetype6 libjpeg-dev -y --fo sudo apt-get install curl git python-software-properties build-essential make g++ -y --force-yes # Installation of NodeJS -sudo add-apt-repository -y ppa:chris-lea/node.js -sudo apt-get update +curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash - sudo apt-get install -y nodejs source ~/.profile From ae65c1af3da2709613b56e21c94edb2dec46e0e7 Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Fri, 6 May 2016 09:59:10 +0200 Subject: [PATCH 3/5] 512Mo is not enough * Add more memory to vbox --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 9b3511d..7112488 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,7 +7,7 @@ Vagrant.configure("2") do |config| config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] - vb.customize ["modifyvm", :id, "--memory", 512] + vb.customize ["modifyvm", :id, "--memory", 1024] vb.customize ["modifyvm", :id, "--cpus", 2] end From ae9e520df18ac032998d993086c1b741222182c1 Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Fri, 6 May 2016 10:14:42 +0200 Subject: [PATCH 4/5] Remove some stdin warning * Ubuntu by default prevent messages being written to root's console * Disallow this annoying error --- Vagrantfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 7112488..43b7a13 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,6 +5,12 @@ Vagrant.configure("2") do |config| config.vm.network :private_network, ip: "10.10.10.10" config.ssh.forward_agent = true + # http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html + config.vm.provision "fix-no-tty", type: "shell" do |s| + s.privileged = false + s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile" + end + config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--memory", 1024] From b6bf77956b0d9c3cf3bcba371ac4216dbd4f7a24 Mon Sep 17 00:00:00 2001 From: "cam.lafit" Date: Fri, 6 May 2016 10:18:58 +0200 Subject: [PATCH 5/5] Prevent dpkg-preconfigure: unable to re-open stdin warning * Follow http://www.liviubalan.com/vagrant-repair-default-dpkg-preconfigure-unable-to-re-open-stdin-no-such-file-or-directory-message trick * Move error message to /dev/null --- server_config/server_install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server_config/server_install.sh b/server_config/server_install.sh index f3e4c92..410e633 100644 --- a/server_config/server_install.sh +++ b/server_config/server_install.sh @@ -2,12 +2,12 @@ # APT-GET sudo apt-get update -sudo apt-get install lsb-release libfontconfig1 libfreetype6 libjpeg-dev -y --force-yes -sudo apt-get install curl git python-software-properties build-essential make g++ -y --force-yes +sudo apt-get install lsb-release libfontconfig1 libfreetype6 libjpeg-dev -y --force-yes > /dev/null 2>&1 +sudo apt-get install curl git python-software-properties build-essential make g++ -y --force-yes > /dev/null 2>&1 # Installation of NodeJS curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash - -sudo apt-get install -y nodejs +sudo apt-get install -y nodejs > /dev/null 2>&1 source ~/.profile # Installation of some packages globally