Skip to content

directory shares not returned through scripting interface for macos vm #7174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ekolve opened this issue May 6, 2025 · 0 comments
Open

Comments

@ekolve
Copy link

ekolve commented May 6, 2025

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:

       
          <property name="directory share mode" code="DrSm" type="qemu directory share mode"
            description="Mode for directory sharing."/>
          
         <!-- dummy property to allow apple configuration directory shares to appear -->
          <property name="directory shares" code="DiRs" description="List of directory share configuration." type="list" />
            
          <property name="drives" code="DrVs"
            description="List of drive configuration.">
            <type type="qemu drive configuration" list="yes"/>
          </property>
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant