UTM's disk 'location' value does not match MacOS'
- Dominant language
- Swift
- Stars
- 35.5k
- Forks
- 1.8k
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 7
Description
UTM version: 4.7.5 (118)
MacOS: 15.7.7 on Intel
I can attach (pass control) of a disk to UTM with the command line;-
`utmctl usb connect `
The `` is available via the command;-
`utmctl usb list`
However, the 'location' reported by UTM (and used in the `connect` command) does not match what MacOS itself reports. For example, I have a USB-connected disk that UTM reports as having a 'location' of 1310726. Using the following comand, MacOS reports a 'location' for the same device as 0x14600000;-
`system_profiler SPUSBDataType`
Converting 1310726 to hex, we get 0x140006 - as you can see, there is a similarity, but it's not the same. I also have a second USB drive (completely different type) and the issue is identical.
At the moment, I am taking the `system_profiler` value and re-arranging it to make it work for UTM. For the two disks I have, it works, but it seems a very unsatisfactory solution. So my questions are;-
- Why are the values different?
- Am I going to come unstuck at some point by manually jiggling the value round in the way I am (ie, is the pattern in the numbering consistent for all disks)?
And for the curious, the reason for all this is that I want to transfer a disk that is currently mounted in MacOS to UTM, and my handle for the drive is its mount point. `utmctl usb list` does not list the MacOS mount point, so I'm having to use MacOS tools to translate the mount point to a 'location'. I know I can approach the problem differently by following a different breadcumb trail through the various tools' reported values should I find an insurmountable issue with the way I'm doing this, but I'm still curious
Contributor guide
Research direction
Start with the utmctl usb list and utmctl usb connect entry points, then compare their reported location with the value from system_profiler SPUSBDataType. The issue names no source files or tests, so first determine where each location value is produced and how mount points map to USB devices. Done would require an agreed, reliable location representation or a documented explanation of the mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, swift
- Domain
- cli, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100