Connecting an iPhone to a libvirt virtual machine running OSX - ios

I have created an OSX Mojave virtual machine and am attempting to pass an iPhone to it, so that I can use XCode. I have tested passing a keyboard through to the guest, and this works fine. However, the iPhone does not.
When I use virt-manager to add the USB Host Device, the iPhone makes a sound to indicate it has been connected, however, it does not appear to be connected to the guest.
Some things I have noticed that may help with resolving this:
If I add the USB Host Device, and then very quickly switch to the VM and run system_profiler SPUSBDataType, the iPhone is shown as connected. This only lasts for a few seconds though. Running system_profiler SPUSBDataType after a few seconds shows the iPhone is no longer connected.
I have tested passing the iPhone to a Linux guest. When passing it to a Linux guest, it does seem to stay connected.
People have reported success passing an iPhone to a VMWare virtual machine by adding usb.quirks.device0 = "0x05ac:0x12a8 skip-reset, skip-refresh, skip-setconfig" to their VMWare VMX file, I mention this as I think replicating these settings in libvirt somehow may resolve the issue.
When I add the USB Host Device, I get this in dmesg on the host:
[178165.281031] audit: type=2501 audit(1540468134.413:1654): pid=604 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=cgroup reason=allow vm="macos-high-sierra" uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 cgroup="/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2d34\x2dmacos\x2dhigh\x2dsierra.scope/" class=path path="/dev/bus/usb/003/050" rdev=BD:131 acl=rw exe="/usr/bin/libvirtd" hostname=? addr=? terminal=? res=success'
[178165.284135] audit: type=2501 audit(1540468134.417:1655): pid=604 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=dev reason=attach vm="macos-high-sierra" uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 bus=usb device="003.050" exe="/usr/bin/libvirtd" hostname=? addr=? terminal=? res=success'
[178165.562355] usb 3-11: reset high-speed USB device number 50 using xhci_hcd
[178165.702290] usb 3-11: device firmware changed
[178165.702489] usb 3-11: USB disconnect, device number 50
[178165.825523] usb 3-11: new high-speed USB device number 51 using xhci_hcd
[178165.966944] usb 3-11: New USB device found, idVendor=05ac, idProduct=12a8, bcdDevice= 6.01
[178165.966946] usb 3-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[178165.966948] usb 3-11: Product: iPhone
[178165.966949] usb 3-11: Manufacturer: Apple Inc.
[178165.966950] usb 3-11: SerialNumber: 71e8245949fde7db02fa88199e22c939196f3ec1
It seems like the iPhone is reconnecting (maybe it's changing connection mode?) and that libvirt is then not passing it back to the guest?

Related

Windows dns-sd (Bonjour/ZeroConf) did not discover iPhone service via USB

I have a Bonjour _http._tcp. service published on iPhone. With the iPhone Wifi Off; running the following dns-sd command on MacBook's terminal:
dns-sd -B _services._dns-sd._udp
then connect the iPhone to MacBook with USB Lighting cable, dns-sd would discover the following iPhone service:
Timestamp A/R Flags if Domain Service Type Instance Name
19:22:45.126 Add 3 5 . _tcp.local. _http
disconnect the USB Lighting cable from the MacBook would show:
Timestamp A/R Flags if Domain Service Type Instance Name
19:22:45.126 Add 3 5 . _tcp.local. _http
19:23:53.924 Rmv 1 5 . _tcp.local. _http
However, repeating the above steps (running dns-sd, connect and disconnect USB Lighting to PC) on Windows 10 PC, dns-sd did not discover the service.
With the iPhone Wifi On, dns-sd on PC would discover the iPhone service:
Timestamp A/R Flags if Domain Service Type Instance Name
19:32:36.238 Add 2 13 . _tcp.local. _http
when the iPhone Wifi Off, dns-sd on PC would show:
Timestamp A/R Flags if Domain Service Type Instance Name
19:32:36.238 Add 2 13 . _tcp.local. _http
19:33:38.471 Rmv 0 13 . _tcp.local. _http
I had Bonjour SDK v333.10 installed from https://developer.apple.com/download/more/?=Bonjour%20SDK%20for%20Windows; and iTunes is working fine (can show the iPhone) on the PC too.
Why dns-sd (Bonjour/ZeroConf) on PC did not discover the iPhone service via USB?
Many thanks.
Bounjour communication is Socket base. When the iPhone is connected to the MacBook via USB cable, MacBook assigns a private IP address (169.254.x.x) to the iPhone.
Using Discovery - DNS-SD Browser on MacBook, when the iPhone's wifi is Off, Discovery shows the discovered Bonjour service via USB, with the private IP address:
When the iPhone's wifi is On, Discovery will show the discovered Bonjour service with two IP addresses (one wifi's, and one USB's):
Therefore, dns-sd on MacBook was able to discover the service on iPhone without wifi.

NodeMCU flash fails - "Connecting to HW-BELTLINE-01"

I have a NodeMCU dev board based on the ESP 12E chipset that does not want to flash. I've tried with both NodeMCU-PyFlasher-4.0 and exptool.py v2.7.
Here's the output from NodeMCU when attempting to flash a firmware:
Command: esptool.py --port /dev/cu.SLAB_USBtoUART --baud 115200 --after no_reset write_flash --flash_mode dout 0x00000 /Volumes/Users/troy/Downloads/tasmota.bin --erase-all
esptool.py v2.6
Serial port /dev/cu.SLAB_USBtoUART
Connecting........_____....._____....._____.....___
Connecting to the serial port using screen /dev/tty.SLAB_USBtoUART 115200 and resetting the device gives the following:
�#�p~�o�lNo���cp��l{l{lp�o��$��co�|l����#�|~�o�l��$`�2oN$`Ns���o��l r��n���l �N�
Connecting to HW-BELTLINE-01
...........................
The . continue on for ever.
The same results occur when using a discrete FTDI USB to UART device connected to the relevant TX/RX headers and powering the board via headers as well (so, taking the USB to UART chip out of the equation).
Video of flashing attempt and serial console output: https://youtu.be/83wZuDMUBXc
Any suggestions on how to get some firmware onto this device, or is it DOA with something not connected properly?
Default firmware tries to connect to the HW-BELTLINE-01 ssid wlan, open or protected with HKHK123HW password. If it succeeds, you can call /gpio/0 or /gpio/1 to test your device.

Unable to connect Rainbow Hat/Raspberry pi3 with Android Things using adb

I'm using Pimoroni Rainbow-Hat Raspberry pi3 kit. I have loaded android things image on sdcard. I have power cable and ethernet cable connected.
I can see Android things boot screen on display but i don't see the IP.
When i try to connect with adb connect Android.local it's not working(getting unknow host). I tried the ethernet cable from pi3 ethernet port to laptop , i can see the lan ip when i do ipconfig /all but when i try adb connect <-ip-:5555, still connection gets refused. but am able ping to the ip.
I am using Windows 7 OS.
Tried turning off IP v6, Windows Firewall, rebooting host etc, still not able to connect.
My main problem is getting the Aot device recognised on the host and load the app onto it.
I'm aware but haven't tried usb to ttl serial cable option mentioned here
I'm familiar with Android but new to iot/Aot , any help about where i am going wrong would be appreciated.
When i try to connect with adb connect Android.local it's not working(getting unknow host).
I tried the ethernet cable from pi3 ethernet port to laptop
The Raspberry Pi is a computer in its own right.
You need to connect the ethernet cable from the Pi3 to your router aka to the local network (not into your computer directly)
The follow the steps from the docs here and setup wifi to avoid further cable issues.

iPhone Personal Hotspot not discoverable

I'm building an application which allows to connect an other device to my iPhone's hotspot. After enabling the "Personal Hotspot" in the iPhone settings, my other device detects the hotspot...
I use this command to check if the hotspot is on the network:
$> sudo iwlist wlan0 scanning | grep MyDeviceName;
ESSID:"MyDeviceName"
But if I leave this setting view (on my iPhone) and I open any other app that need internet (example: Safari), the hotspot is not any more discoverable ... until I go back on the "Personal Hotspot" setting page.
$> sudo iwlist wlan0 scanning | grep MyDeviceName;
(no result)
I've tested this command on ubuntu 14.10 and Raspbian, but my macbook and iPhone don't see the hotspot the network list.
I is created with iPhone5(iOs8.3) and iPhone6(iOs8.4) on iOS 8.
From Apples official Get help with Personal Hotspot in iOS support page:
Your device will stop broadcasting Wi-Fi if you put it to sleep or if 90 seconds elapse and no connected devices use Wi-Fi. To share your Wi-Fi network again, tap Settings > Personal Hotspot.
But my experience is that the devices stops broadcasting the Wi-Fi directly when you leave the Personal Hotspot settings page.

Is it possible to scan while running hostapd?

I am using hostapd to create an adhoc WPA secured wifi network, everything is working fine. From another machine I can connect with no issues.
However when hostapd is running the command:
iwlist wlan0 scan
returns:
wlan0 Interface doesn't support scanning : Operation not supported
If I kill the hostapd process and bring up the wlan0 interface then scan works correctly and returns the ssids of nearby networks.
I want to be able to scan while hostapd is running. How to do this?
This capability depends on your wireless chipset. Some support this and others do not.

Resources