Page 1 of 1

vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 11:36
by Nirav
Hello Team,

I am facing issues with "vboxmanage modifyvm --nic2 hostonly --hostonlyadapter1 vboxnet0" the error I am getting is due to second interface which is Host-Only and using VBoxManage (CLI).
As soon as I click (Not Select) OK in GUI (Network--> Adapter 2 ----> OK) a quick progress bar comes and vm starts without any issue.
Am I missing something here?

Setup : Clean Setup
OL 7.3 Latest (4.1.12-61.1.28.el7uek.x86_64) + VirtualBox-5.1-5.1.16_113841_el7-1.x86_64 (Latest)

Commands:

Code: Select all

# Create Hostonly Network and DHCPSERVER
VBoxManage hostonlyif create # this will create vboxnet0
VBoxManage hostonlyif ipconfig vboxnet0 --ip 172.30.0.1 --netmask 255.255.255.0 
vboxmanage dhcpserver add --ifname vboxnet0 --ip 172.30.0.10 --netmask 255.255.255.0 --lowerip 172.30.0.11 --upperip 172.30.0.100 --enable
sleep 1

# Create and Modify VM
vboxmanage createvm --name "cloud1" --ostype "Oracle_64" --register
vboxmanage modifyvm "cloud1" --ostype "Oracle_64" --description "cloud1"
vboxmanage modifyvm "cloud1" --memory 2048 --cpus 1 
vboxmanage modifyvm "cloud1" --acpi on
vboxmanage modifyvm "cloud1" --boot1 dvd --boot2 disk --boot3 none --boot4 none
#vboxmanage modifyvm "cloud1" --groups "/o3l_3_test"
#vboxmanage modifyvm "cloud1" --usb on --usbxhci on
vboxmanage modifyvm "cloud1" --usb on --audio none
vboxmanage modifyvm "cloud1" --nic1 bridged --bridgeadapter1 enp10s0 
vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0
.
.
# Start / Stop VM Bootup
VBoxManage startvm "cloud1" --type gui
ERROR

Code: Select all

[root@jack virtualboxvms]# # Start / Stop VM Bootup
[root@jack virtualboxvms]# VBoxManage startvm "cloud1" --type gui
Waiting for VM "cloud1" to power on...
[color=#FF0000]VBoxManage: error: Nonexistent host networking interface, name '' (VERR_INTERNAL_ERROR)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole[/color]
[root@jack virtualboxvms]#
I have also uploaded the VBox log file

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 14:57
by Perryg
Why are you running the commands in/as root?

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 14:59
by Nirav
This is my home lab, and making a wrapper script for Oracle OpenStack for Oracle Linux demo lab. using "root" will create any issue?

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 15:21
by Perryg
yes. try it without.

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 15:30
by Nirav
I tried using my personal user but there are other permission issues, which are giving different errors :( , this doesn't seem to be "root" type of issue. As using CLI I can create hostonlyif and everything gets populated in Network Manager. Problem is when I attach the "hostonlyadapter1" it doesn't pickup "vboxnet0" .

From GUI, I can just select the Guest, Click Settings, and Click OK. A quick progress bar appears and VM can not poweron.

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 15:41
by Perryg
Root has a different permission level when creating files and not one that the normal user has access to. You now need to fix the permission issues to be able to get this fixed.

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 15:43
by socratis
Nirav wrote:I tried using my personal user but there are other permission issues, which are giving different errors
Are you going to enlighten us or are you going to keep the errors for yourself? ;)

The reason that I'm asking is that don't seem to realize that VirtualBox runs under the user-context. Being root not only doesn't give you additional powers, it completely changes the user-context under which the commands are run and which configuration files are modified.

VirtualBox uses the "/home/<user>/.config/VirtualBox" files for its global configuration and the "/home/<user>/VirtualBox VMs/<VM>/<VM>.vbox" for the VM configuration. If you run as "root", then you're modifying something entirely different than what you intended to.

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 15:43
by Nirav
OK Sounds good, let me try this tomorrow.
And thank you for your replies.

Re: vboxmanage modifyvm "cloud1" --nic2 hostonly --hostonlyadapter1 vboxnet0 not working

Posted: 10. Mar 2017, 15:55
by Nirav
I am sorry, do not intend to keep the permission errors to myself. Since this is my home LAB I am superuser :D
For Example, my VirtualBox config folder is "/root/.config/VirtualBox" and my iso files and "Default Machine Floder" is /home/virtualboxvms

(PS - Unfortunately creating a custom OL7 iso right now, so cannot switch user safely) I will get back on this tomorrow.