VBoxManage needs to be root but then it can't find the VM??

Discussions related to using VirtualBox on Linux hosts.

VBoxManage needs to be root but then it can't find the VM??

Postby sbpetrack » 4. Mar 2020, 00:16

I am exceedingly confused. I would like to configure PCI passthrough of an NVIDIA GPU from a Linux host to a WIndows guest called NewestWin:

Code: Select all   Expand viewCollapse view
[scott@scott-dell7577 ~]$ VBoxManage list vms
"<inaccessible>" {40f0f5f6-a651-459c-aa4b-9afd94088847}
"<inaccessible>" {4c4c4544-004d-4c10-8042-b9c04f4c4832}
"NewestWin" {a2c4b5b7-6ae2-4f48-8c8d-2684f19b81de}
[scott@scott-dell7577 ~]$


Now when I try to set it up, i get:

Code: Select all   Expand viewCollapse view
[scott@scott-dell7577 ~]$   VBoxManage modifyvm  "NewestWin" --pciattach  01:00.0a@01:00.0
Oracle VM VirtualBox Command Line Management Interface Version 6.1.4
(C) 2005-2020 Oracle Corporation
All rights reserved.

Usage:

VBoxManage modifyvm         <uuid|vmname>
                                           ..... LONG usage output text notice ending with
                                                    [--defaultfrontend default|<name>]

VBoxManage: error: Unknown option: --pciattach


It'a very confusing to be told that it's an unknown option. After much head-scratching, and some time later, it occurred to me that VBoxManage might well need root priviliges. But now:

Code: Select all   Expand viewCollapse view
[[scott@scott-dell7577 ~]$ sudo  VBoxManage modifyvm  "NewestWin" --pciattach  01:00.0a@01:00.0
[sudo] password for scott:
VBoxManage: error: Could not find a registered machine named 'NewestWin'
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 546 of file VBoxManageModifyVM.cpp


What do I do? I don't want to register the VM to root, but it seems that I must run VBoxManage as root. But then it won't operate on machines which are owned by other users. How to i get out of this catch 22 please?

Is the solution that I must Unregister the VM, then register it as root? This machine was created with the virtualbox application, so it's xml file was automatically generated and sits inside the .config directory. So what I need to do is sometihng like
1. go into the .config file And create a new xml for the VM. 2. detach all virtual disk derives 3. unregister the machine 4. register it using sudo VBoxManage 5, Finally import the machine to the virtualbox accoutn of my own.

Surely there is something simpler i can do.

I am sorry to be so stupid; thank you for your help.

Scott

P.S. May I humbly suggest that the error which is returned when not running with root priviliges should NOT be unknown option, but rather something like "Only root can do that" or "insuficient permission"
sbpetrack
 
Posts: 11
Joined: 20. Sep 2014, 09:41

Re: VBoxManage needs to be root but then it can't find the VM??

Postby scottgus1 » 4. Mar 2020, 00:20

"unknown option" is because PCI passthrough is removed from version 6.1.x. It is still in 6.0.x.
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
Volunteer
 
Posts: 7020
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VBoxManage needs to be root but then it can't find the VM??

Postby sbpetrack » 5. Mar 2020, 23:41

1. You mean that If i had bothered to reregister the VM with user root, then when i run the VBoxManage command as root, i would no longer see the error "Could not find the Virtual Machine", but I WOULD have received the "unrecognizead option" error?

Someone in your design team must truly hate VirtualBox users. I can't imagine how angry i would have been to go through the hoops required to register a VM with a different user, only to learn that as a result I "progressed" to being back where I started.


2. I now see in the 6.1 changelog the sentence:

"Linux host: Drop PCI passthrough, the current code is too incomplete (cannot handle PCIe devices at all), i.e. not useful enough "

I realize that you cannot possibly commit to anything on behalf of any dev team, but perhaps you can just give me a clue about which way the wind is blowing: is support for PCI passthrough truly dead -- i.e. as dead as Monty Python's ex-Parrot? Or is it merely "dropped" onto the floor, where it will rest temporarily until resources are available to pick it up, dust it off, and complete it. If the latter, about how long should I expect to wait (say in resolution of half-years: is it likely to reappear in H2 2020? H1 2021?

3. For approx how long will the solution that is "just use 6.0.x" be tenable? That is, for about how long can I expect 6.0.x to be supported ?

THanks

scott
sbpetrack
 
Posts: 11
Joined: 20. Sep 2014, 09:41

Re: VBoxManage needs to be root but then it can't find the VM??

Postby scottgus1 » 6. Mar 2020, 01:07

Re #1:
Continuing to try to use PCI passthrough on a version that no longer has it will cause the "unrecognizead option" error.
Registering the guest as root will allow root to run the guest, but would not change the behavior of the error.
Removing PCI passthrough or using 6.0.x will allow the guest to run, if there are no other errors.

Re #2,3:
No one but the developers can answer these questions. You can contact them through other channels if desired. https://www.virtualbox.org/wiki/Community Only the paying Oracle customers drive development of Virtualbox. We freeloaders get to reap the benefits. If someone wants to donate the code to enhance PCI passthrough so it becomes robust PCIe passthrough then the developers might put it in again.

For now, status is, in the slightly distorted words of Samuel Clemens:
The reports of PCI passthrough's death are not exaggerated.


sbpetrack wrote:Someone in your design team

I own Oracle? I should go buy a bigger house! :lol:

sbpetrack wrote:must truly hate VirtualBox users. I can't imagine how angry i would have been to go through the hoops required to register a VM with a different user, only to learn that as a result I "progressed" to being back where I started.

Running the guest as root was your idea, not the forum's or Virtualbox's. Hanlon's Razor applies:
Never attribute to malice that which is adequately explained by [uninformed attempts to fix a problem].
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
Volunteer
 
Posts: 7020
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 12 guests