OpenStack training-labs - VBoxManage.exe: error: Invalid machine group - windows

I am trying to install OpenStack instance into VirtualBox VMs as on https://wiki.openstack.org/wiki/Documentation/training-labs#Building_the_cluster
after ./osbash.sh -w cluster I get error
VBoxManage.exe: error: Invalid machine group 'C:/Program Files/Git/labs'
Yes, C:/Program Files/Git is location of git-bash.exe that is actual Git-Windows Bash, but how to make osbash.sh proceed with correct machine group name?
The scripts are stable Mitaka from http://docs.openstack.org/training_labs/ for Windows
http://tarballs.openstack.org/training-labs/dist/labs-stable-mitaka.zip
Paul#aspire MINGW64 /d/Workspaces/OpenStack/labs-stable-mitaka/labs/osbash
$ ./osbash.sh -b cluster
Base disk: base-ssh-mitaka-ubuntu-14.04-server-amd64
Distribution name: ubuntu
Virtualization provider: virtualbox
Creating Windows batch scripts: no
Creating cluster on this machine: yes
VM access method: ssh
GUI type: headless
2016年09月20日 18:09:36 osbash starting
Creating basedisk.
2016年09月20日 18:09:36 osbash vm_install starts.
Asked to delete VM "base" (not found)
Creating VM "base"
VBoxManage.exe: error: Invalid machine group 'C:/Program Files/Git/labs'
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "ComposeMachineFilename(bstrName.raw(), bstrPrimaryGroup.raw(), createFlags.raw(), bstrBaseFolder.raw(), bstrSettingsFile.asOutParam())" at line 264 of file VBoxManageMisc.cpp
FAILURE: VBoxManage: createvm --name base --register --ostype Ubuntu_64 --groups /labs
P.S. The same error when trying the latest master from git://git.openstack.org/openstack/training-labs.git
Raised bug https://bugs.launchpad.net/labs/+bug/1625562

The documentation may have mislead you. You don't need a POSIX environment to build the cluster on Windows and (as you found out) using the bash scripts does not work on Windows.
All you need is a VirtualBox installation and the content of the zip file you downloaded. There is no need to add VBoxManage to the Path, the scripts should find the executable anyway.
The zip file you downloaded contains the Windows batch files that build the cluster on Windows in the wbatch directory. Just double-click them: 1) create_hostnet 2) create_base 3) create_ubuntu_cluster_node
That's all. The scripts will set up the VMs, download the Ubuntu ISO image and build the OpenStack cluster.

Related

vagrant up doesn`t running Progress state: E_INVALIDARG VBoxManage.exe: error: Appliance import failed

Here is cmd error, I can't understand where is error and I'm bumping on it again and again, can`t solve it.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Preparing master VM for linked clones...
default: This is a one time operation. Once the master VM is prepared,
default: it will be used as a base for linked clones, making the creation
default: of new VMs take milliseconds on a modern system.
==> default: Importing base box 'hashicorp/bionic64'...
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\\boxes\\hashicorp-VAGRANTSLASH-bionic64\\1.0.282\\virtualbox\\box.ovf", "--vsys", "0", "--vmname", "ubuntu-18.04-amd64_1574870798285_57998", "--vsys", "0", "--unit", "11", "--disk", "C:/Users/\u256C\u044B\u0445\u0443/VirtualBox VMs/ubuntu-18.04-amd64_1574870798285_57998/ubuntu-18.04-amd64-disk001.vmdk"]
Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting \\?\C:\HashiCorp\boxes\hashicorp-VAGRANTSLASH-bionic64\1.0.282\virtualbox\box.ovf...
OK.
0%...
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 957 of file VBoxManageAppliance.cpp
I experienced the same issue and solved it by changing VirtualBox's base VM folder:
Open VirtualBox
Go to File -> Preferences
In the General tab, change the Default Machine Folder path to an existing path.
Run vagrant up again
In my case VirtualBox's Default Machine Folder was still pointing to my external hard drive which was no longer connected. Manually importing the Vagrant downloaded .ovf file in VBox via File -> Import Virtual Appliance lead me to the above solution. Vagrant does the same thing under the hood.
I got the same issue and stumbled for several hours. Finally, it worked from the following steps.
My C drive didn't have enough memory for the Vagrant to bring up the Virtual box. Cleared the memory for Vagrant. It all worked well without any issues.
free enough space in your drive C :
make sure it's C:\\HashiCorp\\boxes\\hashicorp-VAGRANTSLASH-bionic64\\1.0.282 up to date
I had the same issue. I had follow the instructions to change the default machine folder to the same path as the one set for environment variable for VAGRANT_HOME
Open VirtualBox
Go to File -> Preferences
In the General tab, change the Default Machine Folder path to an existing path.
Run vagrant up again
you can check PATH below,if has blank or special character, change it.
Vagrant install PATH
VirtualBox install PATH
$VAGRANT_HOME PATH
VirtualBox default Virtual Machine location PATH
Also, free enough space $VAGRANT_HOME and VirtualBox default Virtual Machine location

Failed to create the VirtualBox object

I was trying to login into the already existing vm using vagrant in bash. But it says failed to start or it's not running.
This is a already existing vm in the local.
I tried
$vagrant global-status -> to get the vm id.
then,
$vagrant up <id> ->to start the vm.
Got the following error,
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["showvminfo", "cd2ec772-3e94-476f-a0d9-59c3d2768fb5"]
Stderr: VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code REGDB_E_CLASSNOTREG (0x80040154) - Class not registered (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or failed to start.

VAGRANT UP not working when executed via BAMBOO

I am trying to work with Vagrant and Bamboo together. I created custom box which I put on a web server from which it is getting downloaded when doing vagrant up. When I do it manually on the computer everything goes as expected.
When I try this via Bamboo however, the folder for local box in c:\Windows\System32\config\systemprofile\.vagrant.d\boxes is not created and subsequently fails as vagrant is not able to do import.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'http://127.0.0.1:8000/k.box'...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["import", "-n", "C:/Windows/System32/config/systemprofile/.vagrant.d/boxes/http-VAGRANTCOLON--VAGRANTSLASH--VAGRANTSLASH-127.0.0.1-VAGRANTCOLON-8000-VAGRANTSLASH-k.box/0/virtualbox/box.ovf"]
Stderr: 0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance read failed
VBoxManage.exe: error: Could not read OVF file 'box.ovf' (VERR_PATH_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component ApplianceWrap, interface IAppliance
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleImportAppliance(struct HandlerArg *)" at line 307 of file VBoxManageAppliance.cpp
Did any of you encountered similar problem?
Thank you.
After some investigation I found the reason for this. The problem is that by default .vagrant.d folder is created in C:\Windows\SysWOW64\config\systemprofile when the vagrant is run via Bamboo. This is the folder where the boxes are stored after download.
The PROFILEUSER environment variable is set to C:\Windows\System32\config\systemprofilefor SYSTEM user. Subsequently after downloading the box it went to look for it into .vagrant.d folder inside PROFILEUSER folder instead of the one that really stored the box.
This problem was solved by setting VAGRANT_HOME environment variable to C:\Windows\SysWOW64\config\systemprofile\.vagrant.d. After this, vagrant looks into correct folder for stored boxes.

Restoring Laravel's Homestead after critical error

I'm using Homestead via Vagrant for my Laravel environment. When I ran vagrant up today, there was a critical error saying that the box is inaccessible.
One of the instructions that I found on the web suggested unregistering the VM by using its machine uuid, which I did:
> VBoxManage.exe unregistervm [uuid]
After unregistering the status of Homestead box changed from inaccessible to not created.
Next step was to register the box, which I do like this:
> VBoxManage.exe registervm "C:\Users\Rhino\VirtualBox VMs\homestead\box-disk1.vmdk"
However the command above throws the following error:
VBoxManage.exe: error: Start tag expected, '<' not found.
VBoxManage.exe: error: Location: 'C:\Users\Rhino\VirtualBox VMs\homestead\box-disk1.vmdk', line 1 (0), column 1.
What am I doing wrong?
OK, I figured it out. There was probably a step missing in the guide I found - creation. All the steps again:
(1)Unregister the box with machine uuid. The uuid can be found e.g. in the .vbox-prev file in your homestead virtual machine folder. Run this when you retrieve the uuid:
C:\Program Files\Oracle\VirtualBox> VBoxManage.exe unregistervm [uuid]
(2)Create the box with --register flag:
C:\Program Files\Oracle\VirtualBox> VBoxManage.exe createvm --name "C:\Users\Rhino\VirtualBox VMs\homestead\box-disk1.vmdk" --register
(3)Delete the folder in which your homestead vm is kept (I guess it's by default created in VirtualBox VMs folder)
(4)Run vagrant up

How to create a jenkins job in order to perform VBoxManage operations on virtual images?

I want to setup a jenkins job in order to e.g. clone a virtual image. The (working) command line is e.g.
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonevm UbuntuTest --name TestNeu --register
However, the same command line executed in jenkins as window batch script does not work, it gives an error
VBoxManage.exe: error: Could not find a registered machine named 'UbuntuTest'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(pszSrcName).raw(), srcMachine.asOutParam())" at line 434 of file VBoxManageMisc.cpp
I only can suppose this jenkins script runs as a different user and does not know of the available images located in C:\Users\alex\VirtualBox VMs.
How to fix this problem?
Addendum:
Running this as a different user does not seem to work or is impossible: link
You need to define your Jenkins slave process to run as the desired user.
First install Jenkins slave as a Windows service , then go the service properties and in the 'Log On' tab change it from the default 'Local System Account' to "This Account:" - enter your account name (alex) and password.
Don't forget to restart the service.

Resources