Search code examples
usbsolarisqemu

QEMU usb keyboard passthrough difficulties


I'm having trouble getting QEMU to recognize my keyboard. The host machine is windows 7. The client is solaris 10 SPARC. I'm running commands through cygwin.

Everything starts up, but when it comes time to input anything, no strokes are captured.

My keyboard, mouse and monitors are connected to my computer via a physical dell hub which might affect things. But because my computer has few usb slots, the hub is needed.

However, I can see my usb keyboard and mouse like normal using lsusb:

$ lsusb
Bus 002 Device 022: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
...
Bus 002 Device 029: ID 413c:2107 Dell Computer Corp.
Bus 002 Device 002: ID 413c:9016 Dell Computer Corp.
...

I double checked with -v, and Bus 002, Device 029 is the keyboard

Bus 002 Device 029: ID 413c:2107 Dell Computer Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x413c Dell Computer Corp.
  idProduct          0x2107
  bcdDevice            1.15
  iManufacturer           1 Dell
  iProduct                2 Dell USB Entry Keyboard

I can usually get to the choose language dialog but then I either can't input anything or it doesn't take (depending on the options):

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Feb 15 2019 10:05
  Type 'help' for detailed information
[Evaling fcode, entry point...]
SunOS Release 5.10 Version Generic_147147-26 64-bit
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
could not find debugger-vocabulary-hook>threads:interpret: exception -13 caught
interpret \ Copyright (c) 1995-1999 by Sun Microsystems, Inc.
[Some pragma stuff...]
h# unix-tte:interpret: exception -13 caught
interpret ' unix-tte is va>tte-data failed with error ffffffffffffffed
WARNING: consconfig: cannot find driver for screen device /pci@1fe,0/pci@1,1/QEMU,VGA@2
Configuring devices.
WARNING: ata_controller[0] - Unsupported Controller
        Vendor 0x9510, Device 0x4606, Revision 0x7
WARNING: Out of range register specification from device node <fdthree>
/platform/sun4u/kernel/drv/sparcv9/i8042: undefined symbol 'i_ddi_alloc_ispec'
WARNING: mod_load: cannot load module 'i8042'
WARNING: ata_controller[0] - Unsupported Controller
        Vendor 0x9510, Device 0x4606, Revision 0x7
WARNING: Out of range register specification from device node <fdthree>
/platform/sun4u/kernel/drv/sparcv9/i8042: undefined symbol 'i_ddi_alloc_ispec'
WARNING: mod_load: cannot load module 'i8042'
WARNING: SUNW,hme0 : No transceiver found., SEVERITY_HIGH, XCVR

WARNING: SUNW,hme0 : No transceiver found., SEVERITY_HIGH, XCVR

WARNING: SUNW,hme0 : Failed to initialize hardware/driver, SEVERITY_HIGH, INIT  

Using RPC Bootparams for network configuration information.
svc:/system/filesystem/local:default: WARNING: /usr/sbin/zfs mount -a failed: one or more file systems failed to mount
Serial console, reverting to text install
Beginning system identification...
Searching for configuration file(s)...
Search complete.
Discovering additional network configuration...
Select a Language

   0. English
   1. Brazilian Portuguese
   2. French
   3. German
   4. Italian
   5. Japanese
   6. Korean
   7. Simplified Chinese
   8. Spanish
   9. Swedish
  10. Traditional Chinese

Please make a choice (0 - 10), or press h or ? for help:
[Cannot input, or if can, doesn't take]

I'm convinced this has to do with proper arguments for usb passthrough, but I'm not sure which ones. For convenience sake, assume all the following commands start with

"C:\Program Files\qemu\qemu-system-sparc64" -m 2048 -cdrom "sol-10-u11-ga-sparc-dvd.iso" -k en-us -boot d 

Things I've tried:

  1. No additional options

    I get to the select language step but cannot input anything. I have checked that I am 'grabbed' by the qemu window when I try to type.

  2. No graphics Mode

     -nographic 
    

    I eventually need graphics (which is going to be another bag of worms), but for now I tried turning it off. This allows me to get to the select language step, but imputing the selection and hitting enter does nothing. Perhaps it has something to do with the failure to initialize hardware driver?

  3. Specifying keyboard at high level

    -device usb-kbd
    

    Which gives me

    No 'usb-bus' bus found for device 'usb-kbd'
    
  4. Specifying hostbus and address

    -device usb-host,hostbus=2,hostaddr=29
    

    Which also gives me

    No 'usb-bus' bus found for device 'usb-host'
    
  5. Specifying vendorid and productid

    -device piix4-usb-uhci,id=usb,bus=pci,addr=0x4 -device usb-host,vendorid=0x413c,productid=0x2107
    

    I can't seem to find a free, non-reserved slot. They all already have a device in them or return something like:

    PCI: slot 4 function 0 not available for piix4-usb-uhci, reserved
    

    I think uhci is usb 1.0, should I have a different specifier in the first device argument? I can see the options with -device help but don't know what I should pick.

  6. Different Devices and OS

    I've tried getting QEMU to take input for this solaris client on Windows 7, 10 and Ubuntu 18.04.2 LTE hosts across two different physical computers and this gave the same problem.

    I know the keyboard works, as it is fine on the host OS. I know the keyboard works with other emulated OS because I got an x86 ubuntu client working fine.

  7. QEMU Monitor

    I've tried bringing up the QEMU monitor as the VM is running and using sendkey. Didn't work. However, info says that the VM is running. usb returns no devices.

I've gone through the following links:


Solution

  • I ran into same issue and tried several approaches. From running different ISOs to trying out different driver configurations but nothing worked. I believe SPARC64 is not yet fully supported with QEMU architecture. I also tried Solaris 11 as suggested by @Andrew Henle. Though I wasn't able to get it running with -M niagara but I believe that could be the right direction.

    Now if you don't specifically want the QEMU but just want to use/test Solaris 10 or 11 on SPARC architecture. I think you still have two options:

    1. You can buy the supported hardware on eBay.
    2. If you do not want to purchase the hardware, you can get a shared SPARC server from Oracle Cloud.

    Good Luck!