Skip to content
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

scripting: add import command #6734

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

naveenrajm7
Copy link

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
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.

1 participant