Page 1 of 1

My VM randomly disappeared

Posted: 25. Dec 2008, 10:40
by mike503
I don't know how, but I was tweaking some of my VM settings, and now I am getting an error "Could not find a registered machine named 'desktop'" - even though I just got done using and booting it.

Notice the first two commands have no problem, but then randomly it stopped. Anyone have any hints here? The files seem to still be there...

Code: Select all

mike@tablerock:~$ VBoxManage modifyvm "desktop" -nicspeed1 10000000
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

mike@tablerock:~$ VBoxManage modifyvm "desktop" -nic1 hostif
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

mike@tablerock:~$ VBoxManage modifyvm "desktop" -floppy disable
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling virtualBox->FindMachine(Bstr(argv[0]), machine.asOutParam()) at line 1615!
[!] Primary RC  = VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents
[!] Full error info present: true , basic error info present: true 
[!] Result Code = VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents
[!] Text        = Could not find a registered machine named 'desktop'
[!] Component   = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee      = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
mike@tablerock:~$ VBoxManage modifyvm "desktop" -nic1 hostif
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling virtualBox->FindMachine(Bstr(argv[0]), machine.asOutParam()) at line 1615!
[!] Primary RC  = VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents
[!] Full error info present: true , basic error info present: true 
[!] Result Code = VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents
[!] Text        = Could not find a registered machine named 'desktop'
[!] Component   = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee      = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
mike@tablerock:~$


mike@tablerock:~$ cat /home/mike/.VirtualBox/VirtualBox.xml 
<?xml version="1.0" encoding="UTF-8"?>
<!-- Sun xVM VirtualBox Global Configuration -->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.5-linux">
  <Global>
    <MachineRegistry>
      <MachineEntry uuid="{05e8aab5-6ee6-4194-9094-3a49efbf7007}" src="/home/mike/desktop/desktop/desktop.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{60d22ca2-f853-4bd4-9520-a16984e5f56f}" location="/home/mike/desktop/desktop.vdi" format="VDI" type="Normal"/>
      </HardDisks>
      <DVDImages>
        <Image uuid="{0574da87-60a5-4525-acc8-5fcf3368a7e2}" location="/home/mike/winxp_sp2.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
    <USBDeviceFilters/>
    <SystemProperties defaultMachineFolder="Machines" defaultHardDiskFolder="HardDisks" defaultHardDiskFormat="VDI" remoteDisplayAuthLibrary="VRDPAuth" webServiceAuthLibrary="VRDPAuth" HWVirtExEnabled="false" LogHistoryCount="3"/>
  </Global>
</VirtualBox>
mike@tablerock:~$

Posted: 25. Dec 2008, 12:22
by mike503
someone asked me to list vms on IRC (this issue has now happened twice!)

it always seems to be after i do a modifyvm, this time around i adjusted a bunch of things all at once.

Code: Select all

mike@tablerock:~$ VBoxManage modifyvm desktoptest -memory "1600MB" -acpi on -boot1 dvd -nic1 hostif -nictype1 82540EM -audio alsa -usb on -usbehci on -hwvirtex on -nestedpaging on
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

mike@tablerock:~$ VBoxManage modifyvm desktoptest -memory "1600MB" -acpi on -boot1 dvd -nic1 hostif -nictype1 82540EM -audio alsa -usb on -usbehci on -hwvirtex on -nestedpaging on
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

[!] FAILED calling virtualBox->FindMachine(Bstr(argv[0]), machine.asOutParam()) at line 1615!
[!] Primary RC  = VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents
[!] Full error info present: true , basic error info present: true
[!] Result Code = VBOX_E_FILE_ERROR (0x80BB0004) - File not accessible or erroneous file contents
[!] Text        = Could not find a registered machine named 'desktoptest'
[!] Component   = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee      = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
mike@tablerock:~$
the output from the list vms shows the issue most likely - the XML is malformed somehow.

Code: Select all

mike@tablerock:~$ VBoxManage list vms
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Name:            <inaccessible!>
UUID:            05e8aab5-6ee6-4194-9094-3a49efbf7007
Config file:     /home/mike/desktop/desktop/desktop.xml
Access error details:
[!] Full error info present: true , basic error info present: true
[!] Result Code = VBOX_E_XML_ERROR (0x80BB000A) - Invalid XML found
[!] Text        = Could not load the settings file '/home/mike/desktop/desktop/desktop.xml'.
Element '{http://www.innotek.de/VirtualBox-settings}HostInterface', attribute 'name': [facet 'pattern'] The value '' is not accepted by the pattern '.+'.
Element '{http://www.innotek.de/VirtualBox-settings}HostInterface', attribute 'name': '' is not a valid value of the atomic type '{http://www.innotek.de/VirtualBox-settings}TLocalFile'
[!] Component   = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee      = <NULL>, {00000000-0000-0000-0000-000000000000}

Name:            <inaccessible!>
UUID:            d150c4da-af25-4eb9-bffe-52a8e4e414eb
Config file:     /home/mike/.VirtualBox/Machines/desktoptest/desktoptest.xml
Access error details:
[!] Full error info present: true , basic error info present: true
[!] Result Code = VBOX_E_XML_ERROR (0x80BB000A) - Invalid XML found
[!] Text        = Could not load the settings file '/home/mike/.VirtualBox/Machines/desktoptest/desktoptest.xml'.
Element '{http://www.innotek.de/VirtualBox-settings}HostInterface', attribute 'name': [facet 'pattern'] The value '' is not accepted by the pattern '.+'.
Element '{http://www.innotek.de/VirtualBox-settings}HostInterface', attribute 'name': '' is not a valid value of the atomic type '{http://www.innotek.de/VirtualBox-settings}TLocalFile'
[!] Component   = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee      = <NULL>, {00000000-0000-0000-0000-000000000000}

mike@tablerock:~$

Posted: 25. Dec 2008, 12:25
by mike503
figured it out.

it appears that -nic1 hostif wants a name, otherwise this is in the XML:

Code: Select all

<Adapter slot="0" enabled="true" MACAddress="080027E184A1" cable="true" speed="0" type="82540EM">
  <HostInterface name=""/>
</Adapter>
the empty was breaking the XML syntax checking. no wonder this occured each time i changed the networking :)

suggestion: make the parameters check it fully. it seems like other things do the checks, i think this one just slipped through the cracks.

like this one for example:

Code: Select all

mike@tablerock:~$ VBoxManage modifyvm desktoptest -nicspeed1 10000000
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

error: Invalid -nicspeed1 argument '10000000'
mike@tablerock:~$ VBoxManage modifyvm desktoptest -nicspeed1 1000000
VirtualBox Command Line Management Interface Version 2.1.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

mike@tablerock:~$
sanity checking is good :)

Posted: 25. Dec 2008, 16:01
by TerryE
Mike, I editted your posts to add code blocks which make it a lot more readable. If you can read C++ then you can look at the source yourself at SVN - VBoxManage.cpp. You will see that the error checking is pretty minimal and caught by exceptions at lower levels in the code: hence your strange errors. The trick is to do a single modifyvm with all of your arguments specified using continuation lines when appropriate. In this case -nic1=hostif must be paired with a -hostifdev1 <devicename>. I have suggested that it would be nice to have an exportvm, but ...

Posted: 25. Dec 2008, 21:07
by mike503
TerryE wrote:Mike, I editted your posts to add code blocks which make it a lot more readable. If you can read C++ then you can look at the source yourself at SVN - VBoxManage.cpp. You will see that the error checking is pretty minimal and caught by exceptions at lower levels in the code: hence your strange errors. The trick is to do a single modifyvm with all of your arguments specified using continuation lines when appropriate. In this case -nic1=hostif must be paired with a -hostifdev1 <devicename>. I have suggested that it would be nice to have an exportvm, but ...
Thanks. I was being too lazy to put the code tags.

I don't see the difference about requiring the extra params...