vagrant package command fails - vagrant

I am trying to create a vagrant box of a VirtualBox Ubuntu VM on my MacBook Pro. When I run the command I get an error that I don't understand. I've tried rebuilding the virtual machine. I've tried different virtual machines in different states. I keep hitting this brick wall.
It looks like VBoxManage tries to create a temporary file for the package process, but the file can't be written for some reason. This also happened on my Ubuntu laptop. So that's really interesting and makes me wonder if it is a problem with VBoxManage itself, however, it doesn't seem that many people are having this specific issue (though the error code "code VBOX_E_FILE_ERROR (0x80bb0004)" is relatively common.)
Here is the output of my command:
earthmant$ vagrant package --base 64precise6
==> 64precise6: Attempting graceful shutdown of VM...
64precise6: Guest communication could not be established! This is usually because
64precise6: SSH is not running, the authentication information was changed,
64precise6: or some other networking issue. Vagrant will force halt, if
64precise6: capable.
==> 64precise6: Forcing shutdown of VM...
==> 64precise6: Exporting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["export", "64precise6", "--output", "/Users/earthmant/.vagrant.d/tmp/1417878317/box.ovf"]
Stderr: 0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Appliance write failed
VBoxManage: error: File not accessible or erroneous file contents
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Appliance, interface IAppliance
VBoxManage: error: Context: "int handleExportAppliance(HandlerArg*)" at line 1121 of file VBoxManageAppliance.cpp

I noticed that a lot of people explicitly state that when you create the VM in VirtualBox, you should use the vmdk file format for the disk. I had used qcow. When I rebuilt the VM with vmdk, vagrant package succeeded.

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:

Change in vagrant requires removal of saved state in VirtualBox

I am running Vagrant 2.2.2 on a MacBook Pro, with VirtualBox, Version 6.0.4 r128413. A Mac update cascaded a need to update these about 2 months ago.
When I enter vagrant status it says "saved". If I run vagrant up the following results:
My-MBP:vbox4 oliverwilliams$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Resuming suspended VM...
==> default: 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", "894fe7ac-8c87-4c18-8afa-4b24b6268f19", "--type", "headless"]
Stderr: VBoxManage: error: Failed to load unit 'lsilogicscsi' (VERR_SSM_LOADED_TOO_LITTLE)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
I can "Discard Saved State" and then do vagrant up and it works but that's a pain. I opened the VirtualBox UI, went to Machine > Settings, and under storage (after I discarded saved state but not before), I see Controller:SCSI - no option to change to SATA:AHCI as this post suggests: https://www.virtualbox.org/ticket/18263.
How do I fix this so a saved state can be stored without having to discard it?

Installing Virtual box for kong Vagrant set up

I am trying to set up vagrant for kong. I have installed VirtualBox and vagrant. But when i run 'vgrant up' i encounter the below issue:
Bringing machine 'default' up with 'virtualbox' provider...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["list", "hostonlyifs"]
Stderr: VBoxManage: error: Failed to create the VirtualBox object!
VBoxManage: error: Code NS_ERROR_FACTORY_NOT_REGISTERED (0x80040154) - Class not registered (extended info not available)
I have searched for this error with no much luck.
I am using centos 7.4 and the kernel version is 3.10.0-693.21.1.el7.x86_64.
I have downloaded the relevant gcc, devel and dkms. In short followed the link https://tecadmin.net/install-oracle-virtualbox-on-centos-redhat-and-fedora/
Any tip is appreciated.
Thanks
Dinah
This is most likely a problem with your VirtualBox install, not Vagrant. To confirm this, you should receive the same error when running: VBoxManage list vms
A common reason for this error are when /tmp is full or has the incorrect permissions.
To check if /tmp is full try df -h
To fix permissions on /tmp if they're incorrect, try sudo chmod ug-s /tmp && sudo rm -rf /tmp/.vbox*
Apparently we were trying this on a VM. And Vagrant tries to spin up another VM. So having a VM spun within a VM is causing the issue.

Vagrant up error with windows 10

After upgrading to windows 10 I have been having trouble getting my vagrant box to work. I tried following the steps at this link fix vagrant issue with windows 10 but still could not get it to work. The steps were also not documented very well so I could have done something wrong. Does someone have a work around to fix this issue?
$vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'TLWPLGZN'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: UMUWXLAR
==> default: Clearing any previously set network interfaces...
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: E_FAIL
VBoxManage.exe: error: Failed to create the host-only adapter
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "int __cdecl handleCreate(struct HandlerArg *,int,int *)" at line 66 of file VBoxManageHostonly.cpp
Virual Box has released a patch that when ran while loading your virtual machine allows virtualbox to correctly establish its network adapter in windows 10

Laravel 5 Homestead w/ Vagrant and Virtual Box white page

Hello fellow programmers,
So i am currently assigned to install and configure Laravel 5 with homestead and Vagrant currently i am having various issues.. for now i came across the following error in my gitbash. Before this error i had run the init.sh again because someone told me he fixed his homestead that way..
So how can i fix this error?
Oh and i am working on Windows 7.
Welcome to Git (version 1.9.5-preview20150319)
Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
Stefano#STEFANO-PC ~/Homestead/Homestead (master)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
The name of your virtual machine couldn't be set because VirtualBox
is reporting another VM with that name already exists. Most of the
time, this is because of an error with VirtualBox not cleaning up
properly. To fix this, verify that no VMs with that name do exist
(by opening the VirtualBox GUI). If they don't, then look at the
folder in the error message from VirtualBox below and remove it
if there isn't any information you need in there.
VirtualBox error:
VBoxManage.exe: error: Could not rename the directory 'C:\Users\Stefano\VirtualB
ox VMs\settler_default_1430450956915_11366_1431938089885_29938' to 'C:\Users\Ste
fano\VirtualBox VMs\homestead' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachi
ne, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "SaveSettings()" at line 2788 of file VBoxManage
ModifyVM.cpp
Stefano#STEFANO-PC ~/Homestead/Homestead (master)
$
You already did this, as stated in the error message?
To fix this, verify that no VMs with that name do exist (by opening the VirtualBox GUI). If they don't, then look at the folder in the error message from VirtualBox below and remove it if there isn't any information you need in there.
I was confused by the response because I was deleting the machine form virtual box manager. I went to the c/users/%user%/Vbox directory and deleted all the boxes and was able to reload the vbox. I suspect all data was lost but it was a fresh install but curious how to back up the data and restore it in this situation. (I.e. in the event I had data there I needed.)

Resources