Skip to content

Conversation

@naveenrajm7
Copy link
Contributor

Solves (partially) #6612 .

  • Added new function importNewUTM
  • Expose importNewUTM as an import command in Apple Script.

if useful the same function can be exposed via UI (File > Import)

Apple Script usage

tell application "/Users/x../UTM.app"
  set vmFile to POSIX file "/Users/x../Desktop/ubuntu.utm"
  set vm to import new virtual machine from vmFile
end tell

Returns VM UUID

%osascript import_vm.applescript
virtual machine id D9C7A2A9-D1C9-4F8D-A733-2E028C573234

Import is not yet exposed through utmctl , this will be added in future.
Reason: The bridge protocol generator produced a function signature
importNew(_ new_: NSNumber!, from: URL!) -> SBObject , I don't know how to pass 'virtual machine' ObjectClass as NSNumber. While this is being figured out, just having import function (multiple VMs with same utm file) will enable lot of other things (like vagrant box support, see naveenrajm7/vagrant_utm#3).

import new vm from a file
@osy osy added this to the v4.6 milestone Nov 20, 2024
@osy osy merged commit 4c14814 into utmapp:main Nov 20, 2024
27 checks passed
@naveenrajm7 naveenrajm7 deleted the utm-import branch April 13, 2025 21:53
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

Successfully merging this pull request may close these issues.

2 participants