Re: No USB with qemu+macOS+USB+iPads

2023-02-09 Thread Max Nikulin

On 09/02/2023 01:23, Charles Curley wrote:

On Wed, 8 Feb 2023 22:07:37 +0700
Max Nikulin wrote:


Does it work if you pass a USB device to a Linux
guest (e.g. boot some live image)?


Yes. I can hand a USB memory stick to a Debian guest, Debian installer,
bullseye and bookworm. Host is bullseye. One must still mount it on the
guest.


My question was addressed to stand...@gmx.net with hope to determine if 
the problem is related to qemu configuration or to missing drivers in 
macOSX. Unsure if qemu allows to change the kind of USB bridges (similar 
to e.g. ethernet adapters).


Concerning USB configuration, devices are specified in different ways.
stand...@gmx.net:

 -device usb-host,vendorid=0x8086,productid=0x0808

Charles Curley:

-device usb-host,hostdevice=/dev/bus/usb/002/006,id=hostdev0,bus=usb.0,port=4






Re: No USB with qemu+macOS+USB+iPads

2023-02-08 Thread Charles Curley
On Wed, 8 Feb 2023 21:03:39 +0100
peze  wrote:

> Am 08.02.23 um 19:30 schrieb Charles Curley:
>  [...]  
> 
> If your host is linux, can you show me your qemu-parameters?
> TIA
> 

I was afraid you were going to ask me that. I run qemu via libvirt. So
I will do a bit of detective work.  Here goes.

The XML for libvirt is:

--

  



  
  
  

--

You would have to modify the vendor, product, bus, and device IDs to
suit your device.

The command (imported not wrapped, but possibly wrapped in transport)
line is:

--
root@hawk:/etc/new.virtual# ps aux | grep -i dti386
libvirt+   62108  1.9  3.4 2958008 555240 ?  Sl   Jan27 345:08 
/usr/bin/qemu-system-x86_64 -name guest=dti386,debug-threads=on -S -object 
secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-6-dti386/master-key.aes
 -machine 
pc-q35-5.2,accel=kvm,usb=off,vmport=off,dump-guest-core=off,memory-backend=pc.ram
 -cpu pentium2 -m 1024 -object memory-backend-ram,id=pc.ram,size=1073741824 
-overcommit mem-lock=off -smp 2,sockets=2,cores=1,threads=1 -uuid 
0f0b9d2c-d741-47f0-842b-336fbbc64c12 -no-user-config -nodefaults -chardev 
socket,id=charmonitor,fd=40,server,nowait -mon 
chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global 
kvm-pit.lost_tick_policy=delay -no-hpet -no-shutdown -global 
ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot menu=on,strict=on 
-device 
pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2
 -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 
-device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 
-device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 
-device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 
-device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 
-device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 
-device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 -device 
virtio-scsi-pci,id=scsi0,bus=pci.4,addr=0x0 -device 
virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 -blockdev 
{"driver":"file","filename":"/var/lib/libvirt/images/firmware-testing-i386-netinst.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}
 -blockdev 
{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}
 -device ide-cd,bus=ide.0,drive=libvirt-2-format,id=sata0-0-0,bootindex=2 
-blockdev 
{"driver":"file","filename":"/var/lib/libvirt/images/dti386.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}
 -blockdev 
{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage","backing":null}
 -device ide-hd,bus=ide.1,drive=libvirt-1-format,id=sata0-0-1,bootindex=1 
-netdev tap,fd=45,id=hostnet0,vhost=on,vhostfd=46 -device 
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:6f:aa:6a,bus=pci.1,addr=0x0 
-chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 
-chardev socket,id=charchannel0,fd=47,server,nowait -device 
virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0
 -chardev spicevmc,id=charchannel1,name=vdagent -device 
virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0
 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice 
port=5902,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on
 -device 
qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1
 -device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b -device 
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev 
spicevmc,id=charredir0,name=usbredir -device 
usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -chardev 
spicevmc,id=charredir1,name=usbredir -device 
usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 -device 
usb-host,hostdevice=/dev/bus/usb/002/006,id=hostdev0,bus=usb.0,port=4 -device 
virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 -object 
rng-random,id=objrng0,filename=/dev/urandom -device 
virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.6,addr=0x0 -sandbox 
on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg 
timestamp=on
charles   124050  0.0  0.0  12232  2396 pts/6S+   Jan28   0:00 ssh 
root@dti386.virtual
root  209851  0.0  0.0  12104  1928 pts/32   Ss+  Jan30   0:00 ssh -o 
ControlMaster=auto -o ControlPath=tramp.%C -o ControlPersist=no -e none 
dti386.virtual
charles   507969  0.0  0.0  12108  6684 pts/38   Ss+  15:04   0:00 ssh -o 
ControlMaster=auto -o ControlPath=tramp.%C -o ControlPersist=no -e none 
dti386.virtual
charles   508029  0.0  0.0  12108  6784 pts/39   Ss+  15:06   0:00 ssh -l root 
-o ControlMaster=auto -o 

Re: No USB with qemu+macOS+USB+iPads

2023-02-08 Thread peze

Am 08.02.23 um 19:30 schrieb Charles Curley:

Yes. I can hand a USB memory stick to a Debian guest, Debian installer,
bullseye and bookworm. Host is bullseye. One must still mount it on the
guest.


If your host is linux, can you show me your qemu-parameters?
TIA



Re: No USB with qemu+macOS+USB+iPads

2023-02-08 Thread Charles Curley
On Wed, 8 Feb 2023 11:23:04 -0700
Charles Curley  wrote:

> Yes. I can hand a USB memory stick to a Debian guest, Debian
> installer, bullseye and bookworm. Host is bullseye. One must still
> mount it on the guest.

And do not mount it on the host.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/



Re: No USB with qemu+macOS+USB+iPads

2023-02-08 Thread Charles Curley
On Wed, 8 Feb 2023 22:07:37 +0700
Max Nikulin  wrote:

> Does it work if you pass a USB device to a Linux 
> guest (e.g. boot some live image)?

Yes. I can hand a USB memory stick to a Debian guest, Debian installer,
bullseye and bookworm. Host is bullseye. One must still mount it on the
guest.

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/



Re: No USB with qemu+macOS+USB+iPads

2023-02-08 Thread Max Nikulin

On 08/02/2023 01:15, stand...@gmx.net wrote:

Max Nikulin schrieb am Montag, 6. Februar 2023 um 13:30:06 UTC+1:

sudo -A setfacl -m u:`id -un`:rw /dev/bus/usb/002/007


I think running as root doesn't requirte this change, or?


Then I have no idea. Does it work if you pass a USB device to a Linux 
guest (e.g. boot some live image)?




Re: No USB with qemu+macOS+USB+iPads

2023-02-07 Thread stand...@gmx.net
Max Nikulin schrieb am Montag, 6. Februar 2023 um 13:30:06 UTC+1:
...
> 
> sudo -A setfacl -m u:`id -un`:rw /dev/bus/usb/002/007 
> 

I think running as root doesn't requirte this change, or?



Re: No USB with qemu+macOS+USB+iPads

2023-02-07 Thread stand...@gmx.net


> If you're using a recent version of macOS, a different method may be 
> required than the one I enumerated, such as employing the "usbmuxd" 
> library to connect your device. 

I need an actuell version for the Apple Configurator.

> 
> It's probably best consulting Apple's official documentation and the 
> developer community for more precise info. Good luck.
thanks.



Re: No USB with qemu+macOS+USB+iPads

2023-02-06 Thread Curt
On 2023-02-05, stand...@gmx.net  wrote:
> Curt schrieb am Donnerstag, 2. Februar 2023 um 18:20:06 UTC+1:
>> On 2023-01-31, stand...@gmx.net  wrote: 
>> 
>> Look for file "AppleMobileDevice.kext". 
>
> Sorry for the delay.
>
> "Apple no longer recommends using kexts with your macOS device. To
> make thing worse, macOS Big Sur doesn’t even support some kexts; "

You're correct that Apple has discontinued use of kernel extension
(kexts). 

If you're using a recent version of macOS, a different method may be
required than the one I enumerated, such as employing the "usbmuxd"
library to connect your device.

It's probably best consulting Apple's official documentation and the
developer community for more precise info.  Good luck.



Re: No USB with qemu+macOS+USB+iPads

2023-02-06 Thread Max Nikulin

On 02/02/2023 23:00, stand...@gmx.net wrote:


(qemu) info usbhost
   Bus 2, Addr 4, Port 9, Speed 480 Mb/s
 Class 00: USB device 058f:6387, Mass Storage
   Bus 2, Addr 3, Port 3, Speed 1.5 Mb/s
 Class 00: USB device 046d:c34b, USB Keyboard
   Bus 2, Addr 2, Port 2, Speed 12 Mb/s
 Class 00: USB device 046d:c52b, USB Receiver


Does the user running VM have read/write access to the usb device? The 
docs mention chown, I used


sudo -A setfacl -m u:`id -un`:rw /dev/bus/usb/002/007

and in qemu monitor

device_add usb-host,hostbus=2,hostport=7,id=usbcam

However it was with linux guest.



Re: No USB with qemu+macOS+USB+iPads

2023-02-06 Thread didier gaumet

Le 31/01/2023 à 21:36, stand...@gmx.net a écrit :

Hi from Germany.
Sorry, I found no other way/group to ask.

I want to use macOS to maintain some iPads for my school.

[...]

That is not exactly what you want but there is the irecovery CLI utility 
that is packaged in Debian. I you don't have already discarded it as 
irrelevant, perhaps it could be useful in your case.


Upstream website has a presentation:
https://libimobiledevice.org/




Re: No USB with qemu+macOS+USB+iPads

2023-02-06 Thread didier gaumet

Le 02/02/2023 à 17:00, stand...@gmx.net a écrit :
[...]

- in your guest (MacOSX) VM Virtmanager window menu, click on "Virtual
Machine", then "redirect a USB peripheral",


This is greyed, I can not click it.


- if this happens while the VM is open but not started, it's normal: the 
VM has to started before this feature being available.


- if this happens while the VM is already started, it could (this is a 
mere hypothesis) be due to the lack of a guest agent in a MacOS X guest 
forbidding dynamic USB redirection.
 Then you could try to (guest being stopped, Ipad starded and Ipad USB 
cable plugged into your Debian host) to manually create your USB Ipad 
device in the guest setup, doing something like (sorry, my VirtManager 
is in french, I try to guess an english translation):
 [right click on your MacOS X guest VM] > Open > Display > Details > 
Add Hardware > USB Host Peripheral > here add your Ipad hopefully being 
listed.

Then when you start the MacOS X guest VM it would perhaps display your Ipad.

If the Ipad appears in the guest but as a USB mass storage, perhaps you 
can solve the problem with usb-modeswitch





Re: No USB with qemu+macOS+USB+iPads

2023-02-05 Thread stand...@gmx.net
Curt schrieb am Donnerstag, 2. Februar 2023 um 18:20:06 UTC+1:
> On 2023-01-31, stand...@gmx.net  wrote: 
> 
> Look for file "AppleMobileDevice.kext". 

Sorry for the delay.

"Apple no longer recommends using kexts with your macOS device. To make thing 
worse, macOS Big Sur doesn’t even support some kexts; "



Re: No USB with qemu+macOS+USB+iPads

2023-02-02 Thread Curt
On 2023-01-31, stand...@gmx.net  wrote:
> Hi from Germany.  Sorry, I found no other way/group to ask.
>
> I want to use macOS to maintain some iPads for my school. I have not
> found a way to address them via USB in the VM. Even a simple stick
> does not appear.
>

It seems you have to install the relevant drivers on the VM.

Connect the iPad to the Linux host via USB.

Start the VM.

Open the Finder and click on the "Go" menu.

Look for file "AppleMobileDevice.kext".

If the file exists, the machine has the necessary drivers installed
(in which case I'm stumped). If not, you'll have to install them by
following the appropriate steps for your MacOS version.



Re: No USB with qemu+macOS+USB+iPads

2023-02-02 Thread stand...@gmx.net
didier...@gmail.com schrieb am Donnerstag, 2. Februar 2023 um 09:50:07 UTC+1:
> Le 02/02/2023 à 00:15, stand...@gmx.net a écrit : 
> 
> And beware, in Qemu terminoly, an Ipad is not a tablet, it's a computer. 
> To Qemu, tablets are pointing/drawing devices (think Wacom and such) 

Not even an usb-stick appears in macOS.

In qemu:
info usb
  Device 1.1, Port 1, Speed 480 Mb/s, Product QEMU USB Keyboard
  Device 1.2, Port 2, Speed 480 Mb/s, Product QEMU USB Tablet
  Device 1.0, Port 3, Speed 1.5 Mb/s, Product USB Host Device

(qemu) info usbhost
  Bus 2, Addr 4, Port 9, Speed 480 Mb/s
Class 00: USB device 058f:6387, Mass Storage
  Bus 2, Addr 3, Port 3, Speed 1.5 Mb/s
Class 00: USB device 046d:c34b, USB Keyboard
  Bus 2, Addr 2, Port 2, Speed 12 Mb/s
Class 00: USB device 046d:c52b, USB Receiver

In the VM there is only visible:
USB 2.0 Bus
USB 3.0 Bus
QEMU USB Tablet
QEMU USB Keyboard


> - in your guest (MacOSX) VM Virtmanager window menu, click on "Virtual 
> Machine", then "redirect a USB peripheral", 

This is greyed, I can not click it.

Thanks for thinking ;-)



Re: No USB with qemu+macOS+USB+iPads

2023-02-02 Thread didier gaumet

Le 02/02/2023 à 00:15, stand...@gmx.net a écrit :


Thanks, I know it, but nothing of these works for me. I also tred virt-manager 
without success.

I think there ist another  problem which I don't see.


I do not use Qemu (directly) nor MacOS X nor Ipads so I cannot assure 
you what you want is feasible


And beware, in Qemu terminoly, an Ipad is not a tablet, it's a computer. 
To Qemu, tablets are pointing/drawing devices (think Wacom and such)


What I would verify with Virtmanager:

- start virtmanager, open and start MacOSX VM
- I could not say if it is strictly necessary in your case, but verify 
that you have a guest spice agent or a Qemu guest agent installed in 
your MacOSX guest. Install it if it's not the case and if you find a 
guest agent to install (Qemu and Spice guest agents seem available for 
Linux and Windows guests, MacOS I don't know).
- plug (USB) your Ipad to the host (linux), wait until it is detected by 
the host
- in your guest (MacOSX) VM Virtmanager window menu, click on "Virtual 
Machine", then "redirect a USB peripheral", then you are offered a 
choice: tick the box of the desired USB device. Even if your Ipad 
appears in your MacOSX guest, I do not know if will appear in a 
manageable way for MacOS to help you maintain this Ipad or if it will 
appear as an external disk, for example.
 When you say you fail to see your Ipad in the guest, do you mean you 
are not offered the choice to redirect it or that is is detected by the 
guest but you cannot maintain it from your MacOSX guest?




Re: No USB with qemu+macOS+USB+iPads

2023-02-01 Thread stand...@gmx.net
didier...@gmail.com schrieb am Dienstag, 31. Januar 2023 um 23:10:05 UTC+1:
> Hello, 
> 
> You will probably find the dedicated Qemu doc helpful: 
> https://www.qemu.org/docs/master/system/devices/usb.html 

Thanks, I know it, but nothing of these works for me. I also tred virt-manager 
without success.

I think there ist another  problem which I don't see.



Re: No USB with qemu+macOS+USB+iPads

2023-01-31 Thread stand...@gmx.net
missed grub cmdline:
[0.00] Command line: 
vfio-pci.ids=8086:8cb1,1458:5007,8086:8cad,1458:5006,8086:8ca6,1458:5006



Re: No USB with qemu+macOS+USB+iPads

2023-01-31 Thread didier gaumet

Hello,

You will probably find the dedicated Qemu doc helpful:
https://www.qemu.org/docs/master/system/devices/usb.html

I don't use Qemu directly, I use virtmanager, so I am not familiar with 
Qemu syntax and howto.
But I would launch qemu with the "-device qemu-xhci" parameter (you only 
need xhci, not ehci, uhci, ohci, it seems)
and then I would carefully follow instructions that figure in the "Using 
host USB devices on a Linux host" paragraph.