VirtualBox

Ticket #14584 (closed defect: obsolete)

Opened 5 years ago

Last modified 8 months ago

VBoxManage --pciattach and/or --pcidetach broken

Reported by: noteirak Owned by:
Component: other Version: VirtualBox 5.0.4
Keywords: Cc:
Guest type: all Host type: all

Description

It seems like vboxmanage --pciattach and/or --pcidetach are broken in 5.0.x (tried 5.0.0 and 5.0.4) but works in 4.3.x (tried 4.3.30)
Attach returns without any error but trying to remove the same device fails with "not found".

This is related to  https://forums.virtualbox.org/viewtopic.php?f=7&t=70147 and contains a more verbose debub session.

List of PCI devices, let's use 01:00.0 being my 3D card:

$ lspci
[...]
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev ff)
[...]

Reproduce scenario:

$ vboxmanage unregistervm test --delete
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
$ vboxmanage createvm --name test --register
Virtual machine 'test' is created and registered.
UUID: b77218bd-1b50-46a2-b357-87320aad1338
Settings file: '/home/noteirak/VMs/test/test.vbox'
$ vboxmanage modifyvm test --chipset ich9
$ vboxmanage modifyvm test --pciattach 01:00.0
$ vboxmanage modifyvm test --pcidetach 01:00.0
VBoxManage: error: No host PCI device 00000100 attached
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachHostPCIDevice(iHostAddr)" at line 2981 of file VBoxManageModifyVM.cpp

Checking the VM config to see if it was added:

$ grep -iF -A 5 "<hostpci>" /home/noteirak/VMs/test/test.vbox
      <HostPci>
        <Devices>
          <Device host="256" guest="256" name="host01:00.0"/>
        </Devices>
      </HostPci>
      <EmulatedUSB>
$ vboxmanage showvminfo test --machinereadable | grep -i pci
AttachedHostPCI=ff:1f.7,ff:1f.7

Trying to detach using the reported different PCI address

$ vboxmanage modifyvm test --pcidetach ff:1f.7
VBoxManage: error: No host PCI device 0000ffff attached
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "DetachHostPCIDevice(iHostAddr)" at line 2981 of file VBoxManageModifyVM.cpp

It is also possible to add the same device several times which should return an error by looking at the source code in src/VBox/Main/src-server/MachineImpl.cpp:6675

$ vboxmanage modifyvm test --pciattach 01:00.0
$ grep -iF -A 5 "<hostpci>" /home/noteirak/VMs/test/test.vbox
      <HostPci>
        <Devices>
          <Device host="256" guest="256" name="host01:00.0"/>
          <Device host="256" guest="256" name="host01:00.0"/>
        </Devices>
      </HostPci>

Change History

comment:1 Changed 8 months ago by HarryM

Was this ever addressed? Did subsequent releases of VirtualBox alleviate this problem?

comment:2 Changed 8 months ago by aeichner

  • Status changed from new to closed
  • Resolution set to obsolete

PCI passthrough was never in a usable state so support was removed in 6.1 until we find time to do it properly (which we want to get to eventually but lack of resources and next to no demand from paying customers).

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use