VirtualBox Script unable to manage interfaces

Bug #1676504 reported by Rene Soto
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
Medium
Fuel Sustaining

Bug Description

Detailed bug description:
The VirtualBox scripts for Fuel 9.0 are failing when running the launch.sh script with the following configuration:
-Windows 7
-VirtualBox 5.1.18 + 5.1.18 Extension Pack
-Cygwin x64
-Mirantis OpenStack 9.0 + 9.0 VirtualBox Scripts
(which satisfies the requirements specified in the documentation)

Steps to reproduce:
Follow the steps exactly as outlined in:
https://docs.mirantis.com/openstack/fuel/fuel-9.0/quickstart-guide.html#introduction
to configure VirtualBox and cygwin.

Expected results:
launch.sh script runs successfully without any errors, proceeds to configuration of VirtualBox VMs

Actual result:
When running the launch script (for either launch.sh, launch_8GB.sh, or launch_16GB.sh), the following error is shown:

$ sh launch.sh
./functions/shell.sh: line 75: warning: command substitution: ignored null byte in input
Prepare the host system...
Checking for 'dumpkeys.cache'... OK
Checking for 'free'... OK
Checking for 'expect'... OK
Checking for 'xxd'... OK
Checking for 'VBoxManage'... OK
Checking for VirtualBox Extension Pack... OK
Checking for VirtualBox iPXE firmware...SKIP
VirtualBox iPXE firmware is not found. Used standard firmware from the VirtualBox Extension Pack.
Checking for Mirantis OpenStack ISO image... OK
Going to use Mirantis OpenStack ISO file: iso/MirantisOpenStack-9.0.iso
Checking if SSH client installed... OK
Checking if ipconfig or ifconfig installed... OK
Done.

Check available memory on the host system...
Done.

Сlean previous installation if exists...
Done.

Deleting old interfaces if exists...
...eting host-only interface: VirtualBox Host-Only Ethernet Adapter
' could not be foundr: The host network interface named 'VirtualBox Host-Only Ethernet Adapter
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component HostWrap, interface IHost, callee IUnknown
VBoxManage.exe: error: Context: "FindHostNetworkInterfaceByName(Bstr(pszName).raw(), hif.asOutParam())" at line 139 of file VBoxManageHostonly .cpp
" was not removed. Aborting...x Host-Only Ethernet Adapter

Reproducibility:
100%. This issue was initially reported by a customer, and I was able to reproduce this in a fresh Windows 7 installation.

Workaround:
Unknown

Impact:
Unable to create virtualbox VMs with scripts.

Description of the environment:
 Operation system: Windows 7
 Versions of components:
-VirtualBox 5.1.18 + 5.1.18 Extension Pack
-Cygwin x64
-Mirantis OpenStack 9.0 + 9.0 VirtualBox Scripts
(which satisfies the requirements specified in the documentation)
 Reference architecture: N/A
 Network model: N/A
 Related projects installed: N/A
Additional information:
Based on the error message indicating that it could not delete the Host-Only Ethernet Adapter, I edited the config.sh file and set the following parameter:
rm_network=0
and now we can see that it fails to create a new one when re-launching the script:
$ sh launch.sh
./functions/shell.sh: line 75: warning: command substitution: ignored null byte in input
Prepare the host system...
Checking for 'dumpkeys.cache'... OK
Checking for 'free'... OK
Checking for 'expect'... OK
Checking for 'xxd'... OK
Checking for 'VBoxManage'... OK
Checking for VirtualBox Extension Pack... OK
Checking for VirtualBox iPXE firmware...SKIP
VirtualBox iPXE firmware is not found. Used standard firmware from the VirtualBox Extension Pack.
Checking for Mirantis OpenStack ISO image... OK
Going to use Mirantis OpenStack ISO file: iso/MirantisOpenStack-9.0.iso
Checking if SSH client installed... OK
Checking if ipconfig or ifconfig installed... OK
Done.

Check available memory on the host system...
Done.

Сlean previous installation if exists...
Done.

Deleting old interfaces if exists...
Done.

Creating host-only interface...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Fatal error. Interface VirtualBox Host-Only Ethernet Adapter #2 does not exist after creation. Exiting

Changed in fuel:
milestone: none → 9.x-updates
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Akshay (aksubuceilo) wrote :

Even i am also facing the same issue. Any work around available ?

Revision history for this message
hassan YANG (hassanyang) wrote :

Hello, i faced the same issue even re install win 8.1 pro. by chance, i did update the vension of sed to 4.4-1 and grep version to 3.0-1, the issue fixed on my PC:

Win8.1 64 bit Pro
Virtualbox 5.12r112440

Is that the RCA because of lower version of sed and grep?

Revision history for this message
hassan YANG (hassanyang) wrote :

Version of Sed and grep in my environment which fixed the issue without any change of script.

***************
$ sed --version
sed (GNU sed) 4.4
Packaged by Cygwin (4.4-1)
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <email address hidden>.
****************************
$ grep --version
grep (GNU grep) 3.0
由 Cygwin (3.0-1) 打包
Copyright © 2017 Free Software Foundation, Inc.

************************************************

Revision history for this message
Ivan Wallis (iwallis) wrote :

Hi, I'm also getting the same error with cygwin on Windows 10 x64

$ ./launch_8GB.sh
Prepare the host system...
Checking for 'dumpkeys.cache'... OK
Checking for 'free'... OK
Checking for 'expect'... OK
Checking for 'xxd'... OK
Checking for 'VBoxManage'... OK
Checking for VirtualBox Extension Pack... OK
Checking for VirtualBox iPXE firmware...SKIP
VirtualBox iPXE firmware is not found. Used standard firmware from the VirtualBox Extension Pack.
Checking for Mirantis OpenStack ISO image... OK
Going to use Mirantis OpenStack ISO file: iso/MirantisOpenStack-9.0.iso
Checking if SSH client installed... OK
Checking if ipconfig or ifconfig installed... OK
Done.

Check available memory on the host system...
Done.

Сlean previous installation if exists...
Done.

Deleting old interfaces if exists...
Done.

Creating host-only interface...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Fatal error. Interface VirtualBox Host-Only Ethernet Adapter does not exist after creation. Exiting

Revision history for this message
Daniele (danygor) wrote :

Any update on this?
I'm getting the exact same error with cygwin on Windows 10 x64, but still unable to find a workaround.

Also, sed and grep are up to date in respect of cygwin packages, however the script won't work.

me@NET18118 ~
$ sed --version
sed (GNU sed) 4.4
Packaged by Cygwin (4.4-1)
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <email address hidden>.

me@NET18118 ~
$ grep --version
grep (GNU grep) 3.0
Packaged by Cygwin (3.0-2)
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

###
me@NET18118 /cygdrive/d/OpenStack/Mirantis Openstack/vbox-scripts-9.1
$ sh launch_8GB.sh
./functions/shell.sh: line 75: warning: command substitution: ignored null byte in input
Prepare the host system...
Checking for 'dumpkeys.cache'... OK
Checking for 'free'... OK
Checking for 'expect'... OK
Checking for 'xxd'... OK
Checking for 'VBoxManage'... OK
Checking for VirtualBox Extension Pack... OK
Checking for VirtualBox iPXE firmware...SKIP
VirtualBox iPXE firmware is not found. Used standard firmware from the VirtualBox Ex tension Pack.
Checking for Mirantis OpenStack ISO image... OK
Going to use Mirantis OpenStack ISO file: iso/MirantisOpenStack-9.0.iso
Checking if SSH client installed... OK
Checking if ipconfig or ifconfig installed... OK
Done.

Check available memory on the host system...
Done.

Сlean previous installation if exists...
Done.

Deleting old interfaces if exists...
...eting host-only interface: VirtualBox Host-Only Ethernet Adapter
' could not be foundr: The host network interface named 'VirtualBox Host-Only Ethernet Adapter
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component HostWrap, interface IHost, callee IUnknown
VBoxManage.exe: error: Context: "FindHostNetworkInterfaceByName(Bstr(pszName).raw(), hif.asOutParam())" at line 139 of file VBoxManageHostonly.cpp
" was not removed. Aborting...x Host-Only Ethernet Adapter
###

Revision history for this message
Daniele (danygor) wrote :
Download full text (7.8 KiB)

Hi again,

I'm really a dumbass at programming, however I pinned out the issue is the carriage return which is inside the replies from VBoxManage.
Let's start everytime with manually removing all Host-Only ethernet adapters using Virtualbox GUI.
The first broken function we will encounter running the launch.sh is the following one:

 functions/network.sh: is_hostonly_interface_present()

in particular, the error resides in the line:

 local found_iface=(`execute VBoxManage list hostonlyifs | egrep "Name: + $name\$" | awk '/Name/ { $1 = ""; print substr($0, 2) }'`)

in fact, it return void, while `execute VBoxManage list hostonlyifs`, stripping the egrep and awk commands, returns:

Name: VirtualBox Host-Only Ethernet Adapter
GUID: 39ad9efd-607e-47d0-82b6-eb0f41221373
DHCP: Disabled
IPAddress: 192.168.130.1
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:6c61:d4f4:02ed:69aa
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:13
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter

What's happening?
Let's analyze what "VBoxManage list hostonlyifs" is actually returning, it's enough to add the following line just before the line "local found_iface..."

 echo `execute VBoxManage list hostonlyifs | od -c`

#output:
0000000 N a m e :
0000020 V i r t u a l B o x H o s t
0000040 - O n l y E t h e r n e t A
0000060 d a p t e r \r \n G U I D :
0000100 2 6 c f 5 a d
0000120 e - e 3 9 7 - 4 c c 6 - a 0 b 5
0000140 - e 6 3 b 3 9 9 b e 9 f a \r \n D
0000160 H C P :
0000200 D i s a b l e d \r \n I P A d d r
0000220 e s s : 1 9 2 . 1
0000240 6 8 . 1 0 4 . 1 \r \n N e t w o r
0000260 k M a s k : 2 5 5 . 2
0000300 5 5 . 2 5 5 . 0 \r \n I P V 6 A d
0000320 d r e s s : f e 8 0 :
0000340 0 0 0 0 : 0 0 0 0 : 0 0 0 0 : 9
0000360 1 b c : 5 2 c 5 : 2 4 0 4 : 1 1
0000400 2 6 \r \n I P V 6 N e t w o r k M
0000420 a s k P r e f i x L e n g t h :
0000440 6 4 \r \n H a r d w a r e A d d
0000460 r e s s : 0 a : 0 0 : 2 7 : 0
0000500 0 : 0 0 : 1 3 \r \n M e d i u m T
0000520 y p e : E t h e r n
0000540 e t \r \n S t a t u s :
0000560 U p \r \n V B o x N e t
0000600 w o r k N a m e : H o s t I n
0000620 t e r f a c e N e t w o r k i n
0000640 g - V i r t u a l B o x H o s
000066...

Read more...

Revision history for this message
lalit (eic7772k) wrote :

Hi all,
Issue is solved after changing the blow lines in the network.sh
line 70
  local found_iface=(`execute VBoxManage list hostonlyifs | sed 's/\r$//'| egrep "Name: + $name\$" | awk '/Name/ { $1 = ""; print substr($0, 2) }'`)
line 100
  local new_name=(`execute VBoxManage list hostonlyifs | sed 's/\r$//' | egrep -A9 "Name: + $name\$" | awk '/Name/ { $1 = ""; print substr($0, 2) }'`)
line 109 to 111
  local new_ip=(`execute VBoxManage list hostonlyifs | sed 's/\r$//'| egrep -A9 "Name: + $name\$" | awk '/IPAddress:/ { print $2 }'`)
  local new_mask=(`execute VBoxManage list hostonlyifs | sed 's/\r$//'| egrep -A9 "Name: + $name\$" | awk '/NetworkMask:/ { print $2 }'`)
  local new_dhcp=(`execute VBoxManage list hostonlyifs | sed 's/\r$//'| egrep -A9 "Name: + $name\$" | awk '/DHCP:/ { print $2 }'`)
line 137

  local id=`execute VBoxManage hostonlyif create | sed 's/\r$//'| sed "s/'/_/g" | cut -d "_" -f2 | sed 's/\r$//'| sed "s/^_//" | sed "s/_$//"`

BR//
lalit mohan

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.