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

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Nirav
Posts: 5
Joined: 10. Mar 2017, 11:14

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

Post 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
Attachments
VBox.log
Error is visible in Log file as well
(3.03 KiB) Downloaded 8 times
Last edited by socratis on 10. Mar 2017, 14:00, edited 1 time in total.
Reason: Enclosed the code in [code] tag for better readability
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post by Perryg »

Why are you running the commands in/as root?
Nirav
Posts: 5
Joined: 10. Mar 2017, 11:14

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

Post 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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post by Perryg »

yes. try it without.
Nirav
Posts: 5
Joined: 10. Mar 2017, 11:14

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

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post 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.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

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

Post 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.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Nirav
Posts: 5
Joined: 10. Mar 2017, 11:14

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

Post by Nirav »

OK Sounds good, let me try this tomorrow.
And thank you for your replies.
Nirav
Posts: 5
Joined: 10. Mar 2017, 11:14

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

Post 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.
Post Reply