Vagrant VBoxGuessAdditions error - vagrant

I created a Vagrant box with Ubuntu + KDE. I have a problem with resolution screen in this. A perhaps way to resolve this is install new VBoxGuessAdditions.
Indeed I change boolean (from false to true) on this line on my vagrantFile :
config.vbguest.auto_update = true
With this line at 'false' value I have no problem for up my vagrant.
But when a set this config at 'true' I have this error :
Installing the Window System drivers
Installing X.Org Server 1.17 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the the Window System (or just restart the guest system)
to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done.
An error occurred during installation of VirtualBox Guest Additions 5.0.12. Some functionality may not work as
intended.
In most cases it is OK that the "Window System drivers" installation failed.
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
stdin: is not a tty
Cleaning up downloaded VirtualBox Guest Additions ISO...
==> default: Checking for guest additions in VM...
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
C:/Users/mynickname/.vagrant.d/gems/gems/vagrant-vbguest-0.11.0/lib/vagrant-vbguest/download.rb:23:in `unlink': P
ermission denied # unlink_internal - C:/Users/mynickname/.vagrant.d/tmp/VBoxGuestAdditions_5.0.12.iso (Errno::EAC
CES)
from C:/Users/mynickname/.vagrant.d/gems/gems/vagrant-vbguest-0.11.0/lib/vagrant-vbguest/download.rb:23:i
n `cleanup'
from C:/Users/mynickname/.vagrant.d/gems/gems/vagrant-vbguest-0.11.0/lib/vagrant-vbguest/hosts/base.rb:62
:in `cleanup'
from C:/Users/mynickname/.vagrant.d/gems/gems/vagrant-vbguest-0.11.0/lib/vagrant-vbguest/installers/base.
rb:194:in `cleanup'
My environment :
OS Host : Windows 7 pro
VirtualBox : 5.0.12 r104815
Vagrant : 1.8.1
ruby : 1.9.3p545
Can anyone know what doing on this vagrant and information of VBoxGuessAdditions ?

Try Vagrant 1.7.X. I had the same issue with 1.8.X.
Cheers,

Related

VirtualBox/Vagrant stopped working after Windows 10 Creators Update

I was happily using Vagrant with VirtualBox for my laravel projects (Homestead) but after the Creators Update for Windows 10, VirtualBox stopped working - vagrant up was not throwing any errors and I was even able to vagrant ssh successfully but my web projects were unreachable from the browser.
Initially I was using VirtualBox v.5.1.14 but decided to update to the latest (which is v.5.1.22) - no luck whatsoever, so after reading the answers from this thread I've downgraded to v.5.0.38
Now when I try to vagrant up this error is shown:
vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' is up to date...
==> homestead-7: Resuming suspended VM...
==> homestead-7: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "e5ac5ef8-07fa-412f-b59c-bfd745db047e", "--type", "headless"]
Stderr: VBoxManage.exe: error: Failed to load unit 'cpum' (VERR_INVALID_FLAGS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
p.s. I've already set Host-Only Network Adapter through preferences in VirtualBox
What I did to resolve the issue was to "plug off" my virtual machine's state using discard, hoping not to lose any information... Now I'm on VirtualBox v.5.1.14 and will stick with it until all things work.
I had to update to Virtualbox Version 5.2 to get my boxes running again.
and also need to reinstall git for windows 2.15.1.2-64 bit and select the option "use windows default console" (cmd.exe) instead of "MinTTY"
With MinTTY the command :
vagrant ssh
will not show the bash command line.
using windows default Console worked.
see more possibe workarounds to this piont also in this git issue
My Working env:
- Windows 10 - 1709 - Build 16299.125
- vagrant 2.0.1
- virtualbox 5.2.0
- git for windows 2.15.1.2. 64 bit
Turning off Hyper-V solved my problem.
Solution:
Control Panel -> Turn Windows Feature on or Off -> Uncheck Hyper-V
I had the same problem. My vagrant up stopped working after the Windows Fall Creators Update (1709). It worked after I turned off Hyper-V.
Current Working Environment:
- Windows 10 (1709)
- Vagrant 1.9.7
- VirtualBox 5.1.32

What's the best way to debug vagrant up hanging at "Setting the name of the VM: ..."

I destroyed my CoreOS vagrant box, then tried to re-up but it's hanging at:
==> core-01: Matching MAC address for NAT networking...
==> core-01: Checking if box 'coreos-alpha' is up to date...
==> core-01: Setting the name of the VM: coreos-vagrant_core-01_1447605695441_10076
In my VirtualBox graphical user interface, coreos-vagrant_core-01_1447605695441_10076 is shown as being Powered Off.
And then, nothing happens.
My question is: how best to debug this? How can I get more information about what is going on and where it's hanging?
vagrant up --debug will give you logging info from the VM
I had the same problem on Windows.
The suggestion (solution) based on my experience:
If you have updated/modified your puphpet config.yaml file recently:
If recenlty downloaded from puphpet.com make sure you have compatible vagrant version, currently: Minimum required Vagrant version is 1.7.4
Try changing your sync_type: to default (recommended for win is SMB, but for me personally this would cause to hang, until changed to default)
And last but not least, try running (up) with debug option, like so:
vagrant up --debug
P.S. Notice the double -- dash

Vagrant error: Failed to mount folders in Linux guest

I have a vagrant error. The log as follows:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/diguage/box/centos
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
I Google it. StackOverflow had the same question:
Vagrant error : Failed to mount folders in Linux guest
I did it as the top answer: here. The different is that I downloaded the VBoxGuestAdditions_4.3.18.iso. But it did not work.
I try the second answer: here. It also did not work.
So, I have to ask the question.
My environment is :
Mac OSX 10.10
vagrant 1.6.3
CentOS release 6.5 (Final)
Kernel 2.6.32-431.29.2.el6.x86_64
VirtualBox 4.3.18
PS:
I used the box chef / centos-6.5. I first start the box, it was OK. But I sudo yum update,then sudo yum clean, restart the box, export the error.
Use Following is work fine for me.
vagrant plugin install vagrant-vbguest
I was having the same problem with the same setup, I noticed the problem is only with centos 6.5, so I am using chef/centos-6.6 and it has been working fine. There is very little difference between 6.5 and 6.6, so you shouldn't have any problems migrating your code over. Here's the link to the chef boxes.
EDIT
Ok, I ended up needing a 6.5 box, so I worked through it. The core issue is that the CentOS base repo doesn't include kernel headers(Ubuntu does). You first need to add the appropriate repos to your /etc/yum.repos.d/CentOS-Vault.repo, and you need to enable them. What you append should look something like this:
[C6.5-centosplus]
name=CentOS-6.5 - CentOSPlus
baseurl=http://vault.centos.org/6.5/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
You also need to check the /etc/yum.conf file and make sure there aren't any exclusions such as:
exclude=kernel*
if so comment this out for the time being, but make sure to uncomment it at the end.
Now, you can install the necessary headers for the kernel. The headers depend on kernel-devel, so lets grab that up first.
yum install kernel-devel-$(uname -r)
Then, grab up the headers
yum install kernel-headers-$(uname -r)
Finally, you'll need the dkms package
yum install dkms
Go back and uncomment the exclusions in yum.conf and you should be good to reboot. With only that installed you could then use:
vagrant package --base MyBase
This will give you a reusable CentOS 6.5 box that you can grab on demand. Hope this wasn't too late for you.
I have experienced this using Vagrant 1.8.1, VirtualBox 5.0.18, Chef 12.10.10 host MacOSX El Capitan and guest CentOS7.
I tried installing kernel-devel inside the guest, installing the latest GuestAdittions and running yum update, but none of these worked for me, so I changed the mount type for "nfs" in both my custom synced folders and chef temporary folder, and it worked!
In Vagrantfile, my synced folders:
config.vm.synced_folder ".", "/vagrant", type: "nfs"
and my chef_solo config:
chef.cookbooks_path = ["chef/cookbooks/"]
chef.synced_folder_type = "nfs"

VBoxLinuxAdditions.run never exits with 0

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.
It seems that they are getting installed, so I do not understand why this script always returns 1.
I am working on a Windows 8.1 host, Virtualbox 4.3.12 with Debian 6 guest os.
I am trying to accomplish this by running the following recipe using kitchen:
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
My .kitchen.yml file:
---
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"
}
}
Below is the output I receive:
================================================================================
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
>>>>>> Converge failed on instance <guest-additions-debian-6>.
>>>>>> Please see .kitchen/logs/guest-additions-debian-6.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E chef-solo --config /tmp/kitchen/solo.rb --json-attributes /tmp/kitchen/dna.json --log_level info]
>>>>>> ----------------------
bash.exe"-3.1$
I am running 4.3.16 on Linux, and ran into the same problem. My installation is also embedded in an automated process.
You can unpack the archive to inspect the files with
./VBoxLinuxAdditions.run --target foo --noexec
The offending and useless piece of code that is causing the problem is in the install.sh starts here:
test ! -d "$INSTALLATION_DIR" && REMOVE_INSTALLATION_DIR=1
(REMOVE_INSTALLATION_DIR never gets set to 1 despite whether or not $INSTALLATION_DIR exists).
The bug, at the end of the file, is this:
test -n "$REMOVE_INSTALLATION_DIR" &&
echo "$INSTALLATION_DIR/" >> "$CONFIG_DIR/$CONFIG_FILES"
Since $REMOVE_INSTALLATION_DIR never gets set, test -n returns 1 (fail), and instead of providing an exit 0 at the end of the install script like the author should have, it falls off the end and gives that last exit code to the shell.
Successful workaround:
# REMOVE_INSTALLATION_DIR=0 ./VBoxLinuxAdditions.run
# echo $?
0
A followup to Victor Roetman's method, which avoids some pathing issues:
if ! modinfo vboxsf >/dev/null 2>&1; then
echo "Cannot find vbox kernel module. Installation of guest additions unsuccessful!"
exit 1
fi
I can confirm that the problem still exists in the install.sh script for version 5.0.4 - and that Derek's workaround is still good. I've included the relevant snippets in the code sample below:
27 PACKAGE="VBoxGuestAdditions"
...
32 INSTALLATION_VER="5.0.4"
33 INSTALLATION_REV="102546"
...
38 INSTALLATION_DIR="/opt/$PACKAGE-$INSTALLATION_VER"
...
324 INSTALLATION_MODULES_DIR="$INSTALLATION_DIR/installer/"
...
329 mkdir -p -m 755 "$INSTALLATION_MODULES_DIR"
...
343 test ! -d "$INSTALLATION_DIR" && REMOVE_INSTALLATION_DIR=1
344 mkdir -p -m 755 "$INSTALLATION_DIR"
...
531 test -n "$REMOVE_INSTALLATION_DIR" &&
532 echo "$INSTALLATION_DIR/" >> "$CONFIG_DIR/$CONFIG/FILES"
REMOVE_INSTALLATION_DIR will never be set to 1 on line 343 because INSTALLATION_DIR is created (as a parent directory) for the INSTALLATION_MODULES_DIR on line 329.
Even with VirtualBox 5.0 guest additions, I find the return code of VBoxLinuxAdditions.run to be completely unreliable. For example, if I remove gcc from the box, and run with
REMOVE_INSTALLATION_DIR=0 ./VBoxLinuxAdditions.run
as stated in another answer, it will fail to build but still give a return code of 0.
My solution is to check if the kernel modules were built. So I run it like this:
/location/of/VBoxLinuxAdditions.run || true
if ! test -f /lib/modules/$(uname -r)/extra/vboxsf.ko
then
echo "installation of guest additions unsuccessful"
exit 1
fi
I tried Derek's solution and it did not worked. I am scripting the creation of VMs using vagrant's packer. What I did was the following:
echo "sudo /path/to/installer/VBoxLinuxAdditions.run" > /tmp/install_va.sh
/bin/bash /tmp/install_va.sh
sudo /usr/sbin/VBoxService --version
This way, the spurious error result (which in my case was making Vagrant's packer to destroy the VM) will happen in the subprocess and not catched in the current process. The last operation's result will be the result of the script. If the last check errored, something went wrong in the installation.

Vagrant, error when running vagrant up --provider=docker

I'm trying to test the new docker support in vagrant 1.6. I'm on windows and I've setup my vagrant file but when I run "vagrant up --provider=docker" I get the following:
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
default: Vagrant will now create or start a local VM to act as the Docker
default: host. You'll see the output of the `vagrant up` for this VM below.
default:
default: Box 'mitchellh/boot2docker' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
default: Loading metadata for box 'mitchellh/boot2docker'
default: URL: https://vagrantcloud.com/mitchellh/boot2docker
default: Adding box 'mitchellh/boot2docker' (v0.8.0) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/mitchellh/boot2docker/version/1/provider/virtualbox.box
default: Progress: 100% (Rate: 2999k/s, Estimated time remaining: --:--:--)
The executable 'bsdtar' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.
Uninstall Vagrant completely, remove C:\HashiCorp.
Reinstall Vagrant.
This will fix everything.
Go to Programs and Features
Find Vagrant and Repair
No need to reinstall :)
a fast solution is to attach the path of the mingw binary location to the system's Path variable, e.g.:
C:\HashiCorp\Vagrant\embedded\mingw\bin
Remember to separate path entries with a ;.
Download & Install package follow instruction here http://gnuwin32.sourceforge.net/packages/libarchive.htm
then update your Path environment variable to include the installed path of bsd executable, usually C:\Program Files (x86)\GnuWin32\bin

Resources