UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Apple Virtualization: only update shared directories if they changed to avoid unnecessary virtiofs reconnections

Open evan314159 opened this issue 1 month ago • 1 comments

For Apple Virtualization, only update shared directories if they changed to avoid unnecessary virtiofs reconnections.

Although this issue existed prior to v4.5.4, following v4.5.4, UTM introduced dynamic resolution. Resizing the window with dynamic resolution is a repeatable way to cause a registry update. updateConfigFromRegistry() updates the shared directories on every call, causing the virtiofs to reconnect. As the virtiofs disconnects and reconnects, file and directory handles on the share are invalidated causing guest application errors.

To reproduce bug:

  • Apple Virtualization, Linux guest, Dynamic resolution enabled
  • Open terminal
  • $ cd {shared_directory}
  • Resize the window
  • $ ls
  • Result: ls: cannot open directory '.': No such file or directory

Thank you to @kraju for the hint that the issue started in v4.5.4.

evan314159 avatar Nov 21 '25 19:11 evan314159

Fixes #7488

evan314159 avatar Nov 21 '25 19:11 evan314159