utmapp / utmapp/UTM

directory shares not returned through scripting interface for macos vm

Open
#7,174 0 comments 0 reactions 0 assignees View on GitHub
enhancement scripting
Dominant language
Swift
Stars
35.5k
Forks
1.8k
Avg merge
5d 5h
Merged PRs (30d)
7

Description

When running the following applescript against a macOS vm that has a directory share:

```
tell application "UTM"
set vm to virtual machine named "macOS"
set config to configuration of vm
get config
end tell
```
I receive the following output:

```
displays:dynamic resolution:true
id:7528B231-7752-4D2D-A76A-3C5C9C9C95CE
icon:mac
network interfaces:index:0
host interface:
mode:shared
address:c6:b3:ae:01:2d:69
name:macOS
memory:8192
serial ports:
notes:
cpu cores:4
drives:host size:31731
id:2F4683CD-ED2E-408D-AFB0-EDE86B4CFE91
removable:false
```

Notice that `directory shares` are omitted from the list of properties. I have found the root cause of this to be that within the UTM.sdef file under the `qemu configuration` no property `directory shares` exists. i.e. all the of the apple configuration properties that get returned from the scripting interface exist within the qemu configuration as well. If a property only exists within the apple configuration, then it will not get displayed. I added the following property into qemu configuration:

```xml









```

```
icon:mac
serial ports:
notes:
cpu cores:4
memory:8192
displays:id:453AE1F1-B28D-4988-85A7-1AD6EAED6468
dynamic resolution:true
name:macOS
directory shares:index:0 read only:true
network interfaces:address:c6:b3:ae:01:2d:69
index:0
mode:shared
host interface:
drives:host size:31731
id:2F4683CD-ED2E-408D-AFB0-EDE86B4CFE91
removable:false
```

My question is, should a dummy property be added to the qemu configuration in order to get directory shares to be returned? Or is there something else that can be done to ensure that properties unique to the apple configuration get returned.

**Configuration**
UTM Version: 4.6.5
MacOS: 15.4.1
Mac Chip: M4 Pro

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.