Page 1 of 1

CentOS 6.8 - VM becomes inaccessible when adding NIC

Posted: 30. Oct 2016, 16:42
by JoeBlowski
Hey everyone,

I have a very repeatable bug i'm encountering on CentOS 6.8 on VirtualBox-5.1-5.1.8_111374_el6-1.x86_64 when creating a new VM and adding a NIC to it. I have been able to recreate this many many times. As soon as i try and assign the created vmnic to a network interface (vboxnet1), the VM becomes inaccessible.

I'm using the exact same syntax which works perfectly fine on VirtualBox-4.2-4.2.10_84104_el6-1.x86_64, using CentOS 6.8 as well. How does that saying go? One step forward, two steps back?

<snip>

[vm@vmhost ~]$ cat /etc/redhat-release
CentOS release 6.8 (Final)
[vm@vmhost ~]$ rpm -qa|grep -i virtualbox
VirtualBox-5.1-5.1.8_111374_el6-1.x86_64
vboxmanage createvm --name test0 --register
Virtual machine 'test0' is created and registered.
UUID: 602e2c17-d946-4de8-84a6-9f06956f8aa2
Settings file: '/home/vm/VirtualBox VMs/test0/test0.vbox'
[vm@vmhost ~]$ vboxmanage modifyvm test0 --memory 4096 --acpi on
[vm@vmhost ~]$ vboxmanage modifyvm test0 --nic1 hostonly
[vm@vmhost ~]$ vboxmanage list vms
"test0" {602e2c17-d946-4de8-84a6-9f06956f8aa2}
[vm@vmhost ~]$ vboxmanage modifyvm test0 --hostonlyadapter1 vboxnet1
VBoxManage: error: Could not find a registered machine named 'test0'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 500 of file VBoxManageModifyVM.cpp
[vm@vmhost ~]$ vboxmanage list vms
"<inaccessible>" {602e2c17-d946-4de8-84a6-9f06956f8aa2}

</snip>

I'd love to hear from some folks on what exactly is making this bork my VM... I can recreate this like clockwork. This is an extremely clean install, with almost nothing except vbox on it.

Any ideas?

Cheers,

JB

Re: CentOS 6.8 - VM becomes inaccessible when adding NIC

Posted: 30. Oct 2016, 17:00
by JoeBlowski
So for some reason, this works....

vboxmanage modifyvm test0 --nic1 hostonly --hostonlyadapter1 vboxnet1

VBox... whyYouNoErrorHandle?!? Any comments?

Cheers,

JB

Re: CentOS 6.8 - VM becomes inaccessible when adding NIC

Posted: 2. Nov 2016, 13:18
by klaus
Actually this is a case of too tight error checks and not missing ones. This overly paranoid XML settings checking behavior was in place since VirtualBox 4.1, so your claim that it was working with VirtualBox 4.2 isn't necessarily true (but I didn't spend any time on retrying with that old version, it might have some other bug which is hiding the problem). You might have been faster with typing previously (or used some scripts which made the two changes close enough together), because to make this happen one needs to have at least 5 seconds between two VBoxManage commands (and have no other API client running).

Re: CentOS 6.8 - VM becomes inaccessible when adding NIC

Posted: 4. Nov 2016, 10:02
by frank
The fix will be part of the next 5.1.x maintenance release.