Browse Source

Allow virtual box to run TFB using 12.04

Hamilton Turner 10 years ago
parent
commit
96bdb1e8d7
2 changed files with 15 additions and 4 deletions
  1. 7 4
      deployment/vagrant-common/core.rb
  2. 8 0
      deployment/vagrant-virtualbox/README.md

+ 7 - 4
deployment/vagrant-common/core.rb

@@ -81,10 +81,13 @@ def provider_virtualbox(config, role)
   config.vm.provider :virtualbox do |vb, override|
     override.vm.hostname = "TFB-#{role}"
 
-    override.vm.box = "ubuntu/trusty64"
-    if ENV.fetch('TFB_VB_ARCH','64') == "32"
-      override.vm.box = "ubuntu/trusty32"
-    end
+    # Valid values are 32 and 64
+    arch = ENV.fetch('TFB_VB_ARCH','64')
+
+    # Value values are precise, trusty, etc
+    code = ENV.fetch('TFB_VB_CODE','trusty')
+    
+    override.vm.box = "ubuntu/" + code + arch
     
     if ENV.fetch('TFB_SHOW_VM', false)
       vb.gui = true

+ 8 - 0
deployment/vagrant-virtualbox/README.md

@@ -8,6 +8,7 @@ that modify how TFB launches your Virtuabox virtual machines.
 | :------------------------------- | :------------------ | :----------------------- | 
 | `TFB_VB_SHOW`                    | `true,false`        | Show the VM in a window when running? Default is false
 | `TFB_VB_ARCH`                    | `64,32`             | Used to force TFB to run a 32-bit virtual machine. This is unsupported, as many of the framework binaries we download are 64-bit only and will not launch. If you cannot run a 64-bit VM, then we recommend using the Amazon AWS provider instead of using this variable
+| `TFB_VB_CODE`                    | `trusty,precise`    | Force TFB to run a specific Ubuntu codename. Only trusty (14.04) is officially supported, but it's occasionally useful to see how the framework runs on precise (12.04)
 | `TFB_VB_MEM`                     | `<number>` e.g. `2048` | Size of VM's RAM in MB. Default is `2048`
 | `TFB_VB_CPU`                     | `<number>` e.g. `2` | Number of host CPUs that the VM can access
 
@@ -22,3 +23,10 @@ My standard workflow is to do `vagrant up` and immediately
 do a `vagrant snap` to preserve the initial state. Then I can
 install things, work on pull requests, etc, and roll back to the 
 initial state each time to avoid interference. 
+
+**Use Guest Additions Plugin**
+
+[This](https://github.com/dotless-de/vagrant-vbguest) Vagrant plugin will
+automatically build and inject the correct version of Oracle's Guest 
+Additions for the VM you are running. It's helpful for avoiding annoying 
+errors like "host additions are 4.3.10 but guest is 4.3.18"