The keyboard and trackpad will always appear as "unavailable" on an Apple device as the rest of the system really doesn't like it when these things disappear from the USB bus.
Unless there is something specific that you want only the virtual machine to have access to, none of the "Apple Inc." items in the USB list need to be given to the VM. Resources are shared via the virtualisation layer, which VirtualBox takes care of.
Looking at the problem of the lack of input on the VM, it would be good to first check that the input settings have not been changed. Select the "Input" menu and confirm that "Mouse Integration" is checked:
If it is not checked, then click the item. You can test its operation by clicking inside the VM to open an application or perform another pointer-based action.
For the keyboard, click "Keyboard" from the input menu item and open the "Keyboard Settings..." option. This will open a modal that sits on top of the VM:
Verify that "Auto Capture Keyboard" is checked.
If both the "Mouse Integration" and "Auto Capture Keyboard" settings are checked and the VM still does not accept input, then you will probably need to invest some time to track down the issue. One option would be to:
- Update the VirtualBox software to ensure you have the latest release
- Test the VM to see if the problem persists
- If the problem persists, create a new Ubuntu VM to see if the problem is with the first VM, or with VirtualBox itself
If the problem is found to be with the first VM, then you will probably want to boot the VM using the Ubuntu installation .iso file to begin copying any necessary files off, and migrate to a new VM image.