utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
26.14k stars 1.31k forks source link

USB connection seems really bad (M1 host, Linux guest) #4509

Open ballo opened 1 year ago

ballo commented 1 year ago

Describe the issue
When attaching a ath9k_htc device, it will cause various errors depending where the wind blows. Sometimes a UTM connection error. Sometimes the Linux module (driver) loads, but there is no device and dmesg shows various different errors. Never got the device to show once. Once UTM gave the connection error and the USB device wouldn't show even in System Information unless I rebooted MacOS.

I need this to work. I tried parallels and while the USB works fine (same exact OS: Linux 5.18) but the screen will often freeze and never recover (requires the VM to hard reset). Is there a 3rd VM option or am I screwed?

Configuration

Crash log
No crash

Debug log
Guest Linux dmesg log: [ 25.135311] usb 3-3: new high-speed USB device number 2 using xhci_hcd [ 25.286005] usb 3-3: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= 1.08 [ 25.286020] usb 3-3: New USB device strings: Mfr=16, Product=32, SerialNumber=48 [ 25.286023] usb 3-3: Product: USB2.0 WLAN [ 25.286025] usb 3-3: Manufacturer: ATHEROS [ 25.286027] usb 3-3: SerialNumber: 12345 [ 25.288842] usb 3-3: can't set config #1, error -71 UTM log: Running: -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp: 127.0.0.1:4000,server,nowait -nodefaults -vga none -spice "unix=on,addr=/Users/ball/Library/Group Containers/WDNLXAD4W8.com.utmapp.UTM/36789C18-E6FC-4A58-B549-6B00E11C96AF.spice,disable-ticketing=on,image-compression=off,playback-compression=off,streaming-video=off,gl=off" -device virtio-ramfb -cpu host -smp cpus=4,sockets=1,cores=4,threads=1 -machine virt, -accel hvf -accel tcg,tb-size=256 -drive if=pflash,format=raw,unit=0,file=/Applications/UTM.app/Contents/Resources/qemu/edk2-aarch64-code.fd,readonly=on -drive "if=pflash,unit=1,file=/Users/ball/Library/Containers/com.utmapp.UTM/Data/Documents/ParrotOS arm64 KDE.utm/Images/efi_vars.fd" -boot menu=on -m 1024 -device intel-hda -device hda-duplex -name "ParrotOS arm64 KDE" -device nec-usb-xhci,id=usb-bus -device usb-tablet,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -device usb-kbd,bus=usb-bus.0 -device qemu-xhci,id=usb-controller-0 -chardev spicevmc,name=usbredir,id=usbredirchardev0 -device usb-redir,chardev=usbredirchardev0,id=usbredirdev0,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=usb-controller-0.0 -chardev spicevmc,name=usbredir,id=usbredirchardev2 -device usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=usb-controller-0.0 -device usb-storage,drive=cdrom0,removable=true,bootindex=0,bus=usb-bus.0 -drive if=none,media=cdrom,id=cdrom0 -device virtio-blk-pci,drive=drive0,bootindex=1 -drive "if=none,media=disk,id=drive0,file=/Users/ball/Library/Containers/com.utmapp.UTM/Data/Documents/ParrotOS arm64 KDE.utm/Images/data.qcow2,discard=unmap,detect-zeroes=unmap" -device virtio-net-pci,mac=26:62:F6:DE:8E:59,netdev=net0 -netdev vmnet-shared,id=net0 -device virtio-serial -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -device virtserialport,chardev=charchannel1,id=channel1,name=org.spice-space.webdav.0 -chardev spiceport,name=org.spice-space.webdav.0,id=charchannel1 -uuid 36789C18-E6FC-4A58-B549-6B00E11C96AF -rtc base=localtime -device virtio-rng-pci qemu-aarch64-softmmu: warning: Spice: playback:0 (0x12c8d6140): setsockopt failed, Operation not supported on socket qemu-aarch64-softmmu: warning: Spice: record:0 (0x12c8d61e0): setsockopt failed, Operation not supported on socket

conath commented 1 year ago

Thanks for including the logs! I can see your USB sharing is set to USB 3.0 – is the device you're trying to connect a USB 3 device? If not, please change the USB version in the Sharing config to match the device. A mismatch there has been known to cause issues.

If that doesn't resolve it, please repeat your test with the UTM 4 release candidate, as it includes many bug fixes and might resolve this issue.

As this is a major version change, I strongly recommend you make a backup of all your VMs before opening UTM 4 for the first time!

ballo commented 1 year ago

I don't even see an option to change this setting.

Andy312432 commented 1 year ago

Seems it get fixed in the latest release (4.1.3)} I think you can try it out again?