Virtualbox image corrupted on vagrant up - vagrant

I've been having some trouble with Vagrant and Virtualbox lately and I can't pinpoint what is going on. I am trying to use the Vagrant setup in this repository (https://github.com/sapienza/vagrant-php-box) but everytime I issue a vagrant up command I get the same traceback error about a corrupted image:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "/home/dan/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/20160602.0.0/virtualbox/box.ovf", "--vsys", "0", "--vmname", "ubuntu-cloudimg-trusty-vagrant-amd64_1466024621846_36463", "--vsys", "0", "--unit", "6", "--disk", "/home/dan/VirtualBox VMs/ubuntu-cloudimg-trusty-vagrant-amd64_1466024621846_36463/box-disk1.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /home/dan/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/20160602.0.0/virtualbox/box.ovf...
OK.
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Could not create the imported medium '/home/dan/VirtualBox VMs/ubuntu-cloudimg-trusty-vagrant-amd64_1466024621846_36463/box-disk1.vmdk'.
VBoxManage: error: VMDK: Compressed image is corrupted '/home/dan/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/20160602.0.0/virtualbox/box-disk1.vmdk' (VERR_ZIP_CORRUPTED)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 877 of file VBoxManageAppliance.cpp
I attempted to remove the corrupted box with vagrant box remove ubuntu/trusty64 and reissue the vagrant up command and the box appears to be successfully downloaded but it fails every time when importing the base box.
I'm currently using Vagrant 1.8.4 and Virtualbox 5.0.20 on Ubuntu 14.04. Any help would be greatly appreciated.

To assist in the troubleshooting, how about:
Create a new directory
Inside the new directory, execute a vagrant init ubuntu/trusty64
vagrant up
Does the machine come up ? if so, then environment should be okay.
Next I would create a new directory again, and copy only the relevant files from that github repo excluding the hidden directory .vagrant
Ideally, a .gitignore should be in present in that repo excluding that a .vagrant directory.
Good Luck!

Related

E_INVALIDARG - Laravel Homestead VirtualBox error while executing VBoxManage

System: Windows 10 Home 64bit, Vagrant 2.2.13, VirtualBox 6.1.16
Few seconds after running "vagrant up" command i'm getting this error:
There was an error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.
Progress state: E_INVALIDARG.
VBoxManage.exe: error: Appliance import failed.
VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) - One or more arguments are invalid (extended info not available).
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleImportAppliance(struct HandlerArg )" at line 1118 of file VBoxManageAppliance.cpp
I have already:
Checked if there is no other virtual boxes running;
Tried to run different commands: vagrant provision, vagrant reload --provision, vagrant up --provision, vagrant up, vagrant reload.
Deleted ".vagrant" folder in the "Homestead" folder;
Still, not running.
My Homestead.yaml.
How to fix it and make Homestead run normally?
Thank you for your time and help.
OK, in my case situation was solved by moving VirtualBox default machine folder to another drive, because there was not enough space on C drive, that was originally configured in VirtualBox.
In other words this error "Code E_INVALIDARG (0x80070057)" means you have not enough space for your virtual machine to start.
Change the drive and you should be good to go.
See attached image of the VirtualBox setting window:

Laravel Homestead on USB Drive

I'm trying to set up a Laravel Homestead on a USB drive given the unfortunate amount of space on my laptop's disk. My current OS is Ubuntu 16.04. I've followed this tutorial:
https://www.jeffgeerling.com/blogs/jeff-geerling/running-vagrant-virtualbox
My USB Drive has three directories:
"vagrant_home", where I copied and renamed ".vagrant.d", as instructed by the tutorial. I successfully have a laravel/homestead box in here.
"VirtualBox VMs", where I set VirtualBox to look for VMs.
"Homestead", following the directions in the official Laravel tutorial, I cloned this git repository and changed one of the Homestead.yaml settings to reflect the USB Drive:
folders:
- map: /media/nick/Homestead/Code
to: /home/vagrant/Code
type: "nfs"
When I run "vagrant up", an unwanted .vagrant.d folder is created in my home directory, not on the USB drive. Additionally, I get this error:
There was an error while executing 'VBoxManage', a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["hostonlyif", "create"]
Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: VBoxNetAdpCtl: ioctl failed for /dev/vboxnetctl: Inappropriate ioctl for devic
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg*)" at line 94 of file VBoxManageHostonly.cpp
`
I have also installed Vagrant and VirtualBox, as described by the official Homestead tutorial: https://laravel.com/docs/5.1/homestead
Thanks for reading. Your help is much appreciated.
Try restarting virtual box or vagrant reload command.
Make sure its not a permission issue

Failed to run homestead vagrant box

I'm trying to install the Laravel Homestead vagrant box. I followed the official documentation and when I run vagrant up I get this error:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "/Users/carlo/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0.2.7/virtualbox/box.ovf", "--vsys", "0", "--vmname", "settler_default_1434987271004_24349_1442413617944_69497", "--vsys", "0", "--unit", "7", "--disk", "/Users/carlo/VirtualBox VMs/settler_default_1434987271004_24349_1442413617944_69497/box-disk1.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting /Users/carlo/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0.2.7/virtualbox/box.ovf...
OK.
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Appliance import failed
VBoxManage: error: Could not create the imported medium '/Users/carlo/VirtualBox VMs/settler_default_1434987271004_24349_1442413617944_69497/box-disk1.vmdk' (VERR_VD_VMDK_INVALID_FORMAT)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleImportAppliance(HandlerArg*)" at line 876 of file VBoxManageAppliance.cpp
I tried vagrant with another simple ubuntu box and it's working

There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox

When running vagrant up I get the following error:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'lavash-devstack'...
Progress: 10%There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "C:/HashiCorp/Vagrant/home/boxes/lavash-devstack/0/virtualbox/box.ovf", "--vsys", "0", "--vmname", "devstack_default_1416365851757
_3107_1428337748513_82036", "--vsys", "0", "--unit", "10", "--disk", "C:\\Users\\adrian espinoza\\VirtualBox VMs\\devstack_default_1416365851757_3107_
1428337748513_82036\\box-disk1.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting C:\HashiCorp\Vagrant\home\boxes\lavash-devstack\0\virtualbox\box.ovf...
OK.
0%...10%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance import failed
VBoxManage.exe: error: Could not create the imported medium 'C:\Users\adrian espinoza\VirtualBox VMs\devstack_default_1416365851757_3107_1428337748513
_82036\box-disk1.vmdk'.
VBoxManage.exe: error: VMDK: cannot write allocated data block in 'C:\Users\adrian espinoza\VirtualBox VMs\devstack_default_1416365851757_3107_1428337
748513_82036/box-disk1.vmdk' (VERR_DISK_FULL)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance
VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct HandlerArg *)" at line 779 of file VBoxManageAppliance.cpp
Does someone know what is wrong? I reviewed the related questions, and applied the possibles solution but I still get the error.
here
You problem is similar to me. It may because you did not get enough permission. I run vagrant in git on Windows 8.1. I solve this problem by restart git in administration mode. Hope it help.
For those stumbling upon this while pasting their error directly, it appears to be a VirtualBox problem, not a vagrant problem.
I'm running macOS Sierra, and started running into this issue after my upgrade. I downloaded VirtualBox again, and re-installed which began the upgrade process.
After that was complete, my vagrant environments were set.

error while executing `VBoxManage` (vagrant/ virtualbox)

I'm following the installation tutorial from Data Science at the Command Line which includes the following steps:
$ mkdir MyDataScienceToolbox
$ cd MyDataScienceToolbox
$ vagrant init data-science-toolbox/data-science-at-the-command-line
$ vagrant up
This works perfectly on one of my computer but not the other. Why?
Both computers are using Virtualbox version:4.3.12 and Windows 7.
This is the error message:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'data-science-toolbox/data-science-at-the-command-line'...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "C:\\Users\\bernard\\.vagrant.d\\boxes\\data-science-toolbox-VAGRANTSLASH-data-science-at-the-command-line\\0.0.5\\virtualbox\\box.ovf", "--vsys", "0", "--vmname", "packer-virtualbox-iso_1410075150030_92186", "--vsys", "0", "--unit", "7", "--disk", "C:\\cygwin64\\home\\bernard\\VirtualBox VMs\\packer-virtualbox-iso_1410075150030_92186\\packer-virtualbox-iso-disk1.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting C:\Users\bernard\.vagrant.d\boxes\data-science-toolbox-VAGRANTSLASH-data-science-at-the-command-line\0.0.5\virtualbox\box.ovf...
OK.
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance import failed
VBoxManage.exe: error: Could not create the clone medium 'C:\cygwin64\home\bernard\VirtualBox VMs\packer-virtualbox-iso_1410075150030_92186\packer-virtualbox-iso-disk1.vmdk'.
VBoxManage.exe: error: VMDK: cannot write allocated data block in 'C:\cygwin64\home\bernard\VirtualBox VMs\packer-virtualbox-iso_1410075150030_92186/packer-virtualbox-iso-disk1.vmdk' (VERR_DISK_FULL)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance
VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct HandlerArg *)" at line 779 of file VBoxManageAppliance.cpp
It looks like on the failing system your C: drive might not have enough free space. From the tail end of the error messages: "VERR_DISK_FULL".
Similar question on Super User: What causes the "Failed to create the hard disk storage" error when creating a new virtual machine?
You can use with sudo , I got rid of errors when executing with root access.
Example:
sudo vagrant up

Resources