Problem setting VM closing

This is for discussing general topics about how to use VirtualBox.
Post Reply
boxino
Posts: 137
Joined: 24. Nov 2016, 12:04

Problem setting VM closing

Post by boxino »

I installed Oracle VM 5.2.12. I had set, for some VMs, the non-automatic closing of the same. I tried to apply the commands in https://www.virtualbox.org/manual/ch09.html#idm9354 9.20.9. Default action when terminating the VM but give error:

: sudo VBoxManage setextradata /media/mycomputer-i/DATAHD/Debian-new/Debian9o.vdi GUI/DefaultCloseAction Detach
VBoxManage: error: Could not find a registered machine named '/media/mycomputer-i/DATAHD/Debian-new/Debian9o.vdi'
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 808 of file VBoxManageMisc.cpp

I would like to ask for confirmation before closing the machine in question.
Help me.
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Problem setting VM closing

Post by Martin »

The path and name of the virtual harddisk file is not the "VM name"... ;)
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Problem setting VM closing

Post by socratis »

As Martin said, you pointed to the virtual hard drive, not to the VM. To get the list of registered VMs, the command is:
  • VBoxManage list vms
That lists both the VM registered name, and the VM UUID.
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.
boxino
Posts: 137
Joined: 24. Nov 2016, 12:04

Re: Problem setting VM closing

Post by boxino »

Code: Select all

:~$ VBoxManage list vms
....
"XP-Prove" {......}

:~$ sudo VBoxManage setextradata "XP-Prove" GUI/GuruMeditationHandler PowerOff
VBoxManage: error: Could not find a registered machine named 'XP-Prove'
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 808 of file VBoxManageMisc.cpp

:~$ sudo VBoxManage setextradata XP-Prove GUI Default
VBoxManage: error: Could not find a registered machine named 'XP-Prove'
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 808 of file VBoxManageMisc.cpp

:~$ sudo VBoxManage setextradata "XP-Prove" GuruMeditationHandler PowerOff
VBoxManage: error: Could not find a registered machine named 'XP-Prove'
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 808 of file VBoxManageMisc.cpp
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Problem setting VM closing

Post by Martin »

Don't use 'sudo'.
With sudo you switch the command from your user to the root user and root doesn't have/know your user's VMs.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Problem setting VM closing

Post by socratis »

There is this notion that using "sudo" will make you more powerful. Not in the VirtualBox world, it won't. VirtualBox is a per user context process/files/VMs. Not shareable, not accessible by anyone else. By design...
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.
Post Reply