title: VBoxLinuxAdditions.run never exits with 0
body: <p>I am trying to automate the installation of Virtualbox guest additions using Chef, however I am running into an issue where VBoxLinuxAdditions.run never exists with exit code 0. I always get exit code 1, even without any errors being reported in scripts printout.</p>
  
  <p>It seems that they are getting installed, so I do not understand why this script always returns 1.</p>
  
  <p>I am working on a Windows 8.1 host, Virtualbox 4.3.12 with Debian 6 guest os.</p>
  
  <p>I am trying to accomplish this by running the following recipe using kitchen:</p>
  
  <pre><code>include_recipe "apt"
  
  %W[make gcc xserver-xorg xserver-xorg-core linux-headers-#{node['kernel']['release']} dkms].each do |p|
    package p do
      action :install
    end
  end
  
  # get additions iso file
  remote_file "#{Chef::Config[:file_cache_path]}/vboxAdditions.iso" do
    source "http://download.virtualbox.org/virtualbox/#{node['virtualbox']['version']}/VBoxGuestAdditions_#{node['virtualbox']['version']}.iso"
  end
  
  # create the mount point
  directory "/mnt/vboxAdditions" do
    owner "root"
    group "root"
    mode "0755"
    action :create
  end
  
  # mount the iso
  mount "/mnt/vboxAdditions" do
    action :mount
    device "#{Chef::Config[:file_cache_path]}/vboxAdditions.iso"
  fstype "iso9660"
    options "loop"
  end
  
  # run the installer script
  execute "install vbox guest additions" do
    command "sh /mnt/vboxAdditions/VBoxLinuxAdditions.run"
  end
  </code></pre>
  
  <p>My .kitchen.yml file:</p>
  
  <pre><code>---
  driver_plugin: vagrant
  
  platforms:
  - name: debian-6
    driver_config:
      box: opscode-debian-6.0.7
      box_url: http://opscode-vm.s3.amazonaws.com/vagrant/opscode_debian-6.0.7_chef-11.2.0.box
      require_chef_omnibus: 11.4.0
  
  suites:
  
  - name: guest_additions
    run_list: ["recipe[virtualbox::guest_additions]"]
    attributes: {
      "virtualbox": {
        "version": "4.3.12"
      }
    }
  </code></pre>
  
  <p>Below is the output I receive:</p>
  
  <pre><code>       ================================================================================
         Error executing action `run` on resource 'execute[install vbox guest additions]'
         ================================================================================
  
  
         Mixlib::ShellOut::ShellCommandFailed
         ------------------------------------
         Expected process to exit with [0], but received '1'
         ---- Begin output of sh /mnt/vboxAdditions/VBoxLinuxAdditions.run ----
         STDOUT: Verifying archive integrity... All good.
         Uncompressing VirtualBox 4.3.12 Guest Additions for Linux............
         STDERR: VirtualBox Guest Additions installer
         Removing installed version 4.2.6 of VirtualBox Guest Additions...
         Copying additional installer modules ...
         add_symlink: link file /usr/lib/VBoxGuestAdditions already exists
         Installing additional modules ...
         Removing existing VirtualBox DKMS kernel modules ...done.
         Removing existing VirtualBox non-DKMS kernel modules ...done.
         Building the VirtualBox Guest Additions kernel modules ...done.
         Doing non-kernel setup of the Guest Additions ...done.
         Starting the VirtualBox Guest Additions ...done.
         Installing the Window System drivers
         Installing X.Org Server 1.7 modules ...done.
         Setting up the Window System to use the Guest Additions ...done.
         You may need to restart the hal service and the Window System (or just restart
         the guest system) to enable the Guest Additions.
  
         Installing graphics libraries and desktop services components ...done.
         ---- End output of sh /mnt/vboxAdditions/VBoxLinuxAdditions.run ----
         Ran sh /mnt/vboxAdditions/VBoxLinuxAdditions.run returned 1
  
  
         Resource Declaration:
         ---------------------
         # In /tmp/kitchen/cookbooks/virtualbox/recipes/guest_additions.rb
  
          70:   execute "install vbox guest additions" do
          71:     command "sh /mnt/vboxAdditions/VBoxLinuxAdditions.run"
          72:   end
          73:
  
  
  
         Compiled Resource:
         ------------------
         # Declared in /tmp/kitchen/cookbooks/virtualbox/recipes/guest_additions.rb:70:in `from_file'
  
         execute("install vbox guest additions") do
           action "run"
           retries 0
           retry_delay 2
           command "sh /mnt/vboxAdditions/VBoxLinuxAdditions.run"
           backup 5
           returns 0
           cookbook_name :virtualbox
           recipe_name "guest_additions"
         end
  
  
  
         [2014-08-21T19:34:55+00:00] INFO: Running queued delayed notifications before re-raising exception
         [2014-08-21T19:34:55+00:00] ERROR: Running exception handlers
         [2014-08-21T19:34:55+00:00] ERROR: Exception handlers complete
         Chef Client failed. 14 resources updated
         [2014-08-21T19:34:55+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
         [2014-08-21T19:34:55+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[install vbox guest additions] (virtualbox::guest_additions line 70) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
         ---- Begin output of sh /mnt/vboxAdditions/VBoxLinuxAdditions.run ----
         STDOUT: Verifying archive integrity... All good.
         Uncompressing VirtualBox 4.3.12 Guest Additions for Linux............
         STDERR: VirtualBox Guest Additions installer
         Removing installed version 4.2.6 of VirtualBox Guest Additions...
         Copying additional installer modules ...
         add_symlink: link file /usr/lib/VBoxGuestAdditions already exists
         Installing additional modules ...
         Removing existing VirtualBox DKMS kernel modules ...done.
         Removing existing VirtualBox non-DKMS kernel modules ...done.
         Building the VirtualBox Guest Additions kernel modules ...done.
         Doing non-kernel setup of the Guest Additions ...done.
         Starting the VirtualBox Guest Additions ...done.
         Installing the Window System drivers
         Installing X.Org Server 1.7 modules ...done.
         Setting up the Window System to use the Guest Additions ...done.
         You may need to restart the hal service and the Window System (or just restart
         the guest system) to enable the Guest Additions.
  
         Installing graphics libraries and desktop services components ...done.
         ---- End output of sh /mnt/vboxAdditions/VBoxLinuxAdditions.run ----
         Ran sh /mnt/vboxAdditions/VBoxLinuxAdditions.run returned 1
  &gt;&gt;&gt;&gt;&gt;&gt; Converge failed on instance &lt;guest-additions-debian-6&gt;.
  &gt;&gt;&gt;&gt;&gt;&gt; Please see .kitchen/logs/guest-additions-debian-6.log for more details
  &gt;&gt;&gt;&gt;&gt;&gt; ------Exception-------
  &gt;&gt;&gt;&gt;&gt;&gt; Class: Kitchen::ActionFailed
  &gt;&gt;&gt;&gt;&gt;&gt; Message: SSH exited (1) for command: [sudo -E chef-solo --config /tmp/kitchen/solo.rb --json-attributes /tmp/kitchen/dna.json  --log_level info]
  &gt;&gt;&gt;&gt;&gt;&gt; ----------------------
  bash.exe"-3.1$
  </code></pre>