Tool for running macOS guest virtual machines in macOS 12 host or higher on M1 arm64 Macs

Related tags

Command Line macosvm
Overview

macosvm

macosvm is a command line tool which allows creating and running of virtual machines on macOS 12 (Monterey) using the new Virtualization framework. It has been primarily developed for running macOS guest opearting systems inside virtual machines on M1-based Macs (arm64) with macOS hosts to support CI/CD such as GitHub M1-based runners and our R builds.

Download

See releases for downloads of released binaries (arm64 macOS 12 and higher only). See NEWS for latest changes.

Build

The project can be built either with xcodebuild or make. The former requires Xcode installation while the latter only requires command line tools (see xcode-select --install).

Quick Start

The tools requires macOS 12 (Monterey) since that is the first system implementing the necessary pieces of the Virtualization framework. To create a macOS guest VM you need the following steps:

## Download the desired macOS ipsw image, e.g.:
curl -LO https://updates.cdn-apple.com/2021FCSFall/fullrestores/002-23780/D3417F21-41BD-4DDF-9135-FA5A129AF6AF/UniversalMac_12.0.1_21A559_Restore.ipsw

## create a new VM with 32Gb disk image and install macOS 12:
macosvm --disk disk.img,size=32g --aux aux.img --restore UniversalMac_12.0.1_21A559_Restore.ipsw vm.json

## start the created image with GUI window:
macosvm -g vm.json

After your started the VM it will go through the Apple Setup Assistant - you need the GUI to get through that. Once done, I strongly recommend going to Sharing system preferences, setting a unique name and enabling Remote Login and Screen Sharing. Then you can shut down the VM (using Shut Down in the macOS guest). Note that the default is to use NAT networking and your VM will show up on your host's network (details below) so you can use Finder to connect to its screen even if you start without the GUI.

After the minimal setup it ts possible to create a "clone" of your image to keep for later, e.g.:

cp -c disk.img master.img

Note the -c flag which will make a copy-on-write clone, i.e., the cloned image doesn't use any actual space on disk (if you use APFS). This allows you to store different modifications of your base operating system without duplicating storage space.

See macosvm -h for a minimal help page. Note that this is an experimental expert tool. There is a lot of debugging output, errors include stack traces etc - this is intentional at this point, nothing horrible is happening, but you may need to read more text that you want to on errors.

See the Wiki for more tips and information.

Details

Each virtual machine requires one auxiliary storage (specified with --aux) and at least one root device (specified with --disk). You can specify multiple disk images for additional devices. The --disk option has the form --disk [, . Valid options are: ro = read-only device, size= allocate empty disk with that size. The argument allows k, m and g suffix for powers of 1024 so 32g means 32*(1024^3).

You can specify the number of CPUs with -c and the available memory (RAM) with -r . If not specified, --restore uses the image's minimal requirements (for macOS 12 that is 2 CPUs and 4Gb RAM).

During the macOS installation (--restore) step a unique machine identifier (ECID) is generated. The resulting images only work with that one identifier. This identifier is stored in the configuration file (as machineId entry) and the VM won't boot without it. Since macosvm version 0.1-2 this information can be extracted from the auxiliary file if a configuration file is not present.

This is what the configuration file looks like generated by the above example:

{
  "hardwareModel":"YnBsaX[...]AAAAABt",
  "storage":[
    {"type":"disk", "file":"disk.img", "readOnly":false},
    {"type":"aux", "file":"aux.img", "readOnly":false}
  ],
  "ram":4294967296,
  "machineId":"YnBsaXN0MDDRAQJURUN[...]AAAACE=",
  "displays":[{"dpi":200, "width":2560, "height":1600}],
  "version":1,
  "cpus":2,
  "networks":[{"type":"nat"}],
  "audio":false
}

You can edit the file if you want to change the parameters (like CPUs, RAM, ...), but keep a copy in case you break something. The "hardwareModel" is just the OS/architecture spec from the image. (FWIW both hardwareModel and machineId are base64-encoded binary property lists so you can look at the payload with base64 -d | plutil -p - )

Note that the virtualization framework imposes some restrictions on what is allowed, e.g., you have to define at least one display even if you don't intend to use it (the displays entry is added automatically by --restore).

Unless run with -g/--gui the tool will run solely as a command line tool and can be run in the background. Terminating the tool terminates the VMs. However, if the GUI is used closing the window does NOT terminate the VM. Note that currently the macOS guest systems don't support VM control, so even though it is in theory possible to request VM stop via the VZ framework, it is not actually honored by the macOS guest (as of 12.0.1), so you should use guest-side shutdown (e.g. sudo shutdown -h now works). When the guest OS shuts down the tool terminates with exit code 0.

Networking

The default setup is NAT networking which means your host will allocate a separate local network for the VM. You can use --net [: ] so specify different network adapters and different types. macosvm currently implements nat and bridge where the latter requires the name of the host interface to bridge to (if left blank the first interface is used). Note, however, that bridging requires a special entitlement so may not work with SIP enabled for security reasons.

If you are not running any discovery/bonjour services in the guest to find the IPs, you can typically find the IP addresses of your VMs using arp -a. Currently macOS VMs in NAT mode will be on the interface bridge100, typically with 192.168.64.x IP address (where x=1 is the host so the other numbers are VMs). There doesn't seem to be any direct control over the networking, but apparently the guests can talk to the host and NAT out, but can't talk to each other even though they appear on the same subnet.

Comments
  • Serial Port Access from Host

    Serial Port Access from Host

    Thank you very much for the great application. I have seen that it has support for serial adapters in the code for Linux Guests. I have now released this code for macOS as well. In macOS I see /dev/cu.virtio device which is great. How can I access the serial adapter of the VM from the host OS (/dev/tty?)? Thanks a lot!

    opened by giezi 8
  • Add support for UNIX domain sockets

    Add support for UNIX domain sockets

    In some client setups, neither the NAT nor the Bridge network targets work. However, QEMU works fine in these because it uses slirp to implement network access through BSD socket calls.

    This patch adds support for a UNIX domain socket target which can be used in combination with slirp_unix to implement the user space networking backend. If considered useful, I'm happy to also build direct integration of libslirp into macosvm in addition.

    Signed-off-by: Alexander Graf [email protected]

    opened by agraf 5
  • Question: The VZ limit number of VM vs. VM shutdown

    Question: The VZ limit number of VM vs. VM shutdown

    Hi, first let me thank for this brilliant tool!

    Sometimes, I'm experiencing troubles that after several ephemeral VM startups and shutdowns the next startup ends with the The maximum supported number of active virtual machines has been reached. error.

    At that point none of the macosvm or com.apple.Virtualization.VirtualMachine processes are running.

    I've tried both terminating the macosvm process and sudo shutdown -h now from within the VM.

    I cannot confidently reproduce this problem, it happens quite randomly and the only solution seems to reboot the host machine.

    Is there a way of better VM management, maybe a list of running VMs, or somehow refresh the VZ framework so it doesn't indicate the limit?

    Or more reliable option to shutdown the VM?

    Any idea would be much appreciated :)

    opened by honzajerabek 3
  • Possible to set or determine IP or MAC address for ephemeral instances?

    Possible to set or determine IP or MAC address for ephemeral instances?

    I am using the --ephemeral flag when running for macosvm in a GitLab Runner custom executor. If 2 jobs start at the same time, is there a trick to mapping the process ID with the IP or MAC address that gets assigned to the instance?

    Is it possible to specify a MAC address via config file or command line argument? (Then I could identify the IP using arp -a.)

    Thanks for your work on this project!

    opened by getchardy 3
  • The bridge network does not work even when sip is off

    The bridge network does not work even when sip is off

    Thanks a lot for the great application. I have a problem when I try to use the bridge network instead of nat.

    I must define the interface name manually because when I use a blank parameter then I get an error with listing available interfaces, but this is not a problem to define the interface manually.

    If I used bridge with a manually set interface name then I got an error with missing entitlement com.apple.vm.networking even when the sip is off

    Do you have any suggestions on how to solve this problem?

    This problem is occurred on these version of systems:

    • 12.3
    • 12.4

    This is output from console

    ./macosvm --disk /Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-disk.img,size=64g --aux /Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-aux.img --restore /Volumes/MacVMs4/UniversalMac_12.4_21F79_Restore.ipsw --net bridge:"en0" /Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge.json
    INFO: creating new disk image /Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-disk.img with size 68719476736 bytes
    INFO: add storage '/Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-disk.img' type 'disk' read-write 
    INFO: add storage '/Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-aux.img' type 'aux' read-write 
    INFO: restore from /Volumes/MacVMs4/UniversalMac_12.4_21F79_Restore.ipsw
    INFO: add bridged network on interface en0
    2022-06-21 10:45:30.595 macosvm[911:17777] Restoring from /Volumes/MacVMs4/UniversalMac_12.4_21F79_Restore.ipsw
    2022-06-21 10:45:30.689 macosvm[911:17777]   image load: OK
    2022-06-21 10:45:30.689 macosvm[911:17777] Creating instance ...
    2022-06-21 10:45:30.689 macosvm[911:17777] <VMSpec: 0x600002394000> - configure for restore, OS: macos
    2022-06-21 10:45:30.689 macosvm[911:17777] configure with restore, minimum requirements: 2 CPUs, 4294967296 RAM
    2022-06-21 10:45:30.693 macosvm[911:17777]  + Bridged network to Ethernet (en0)
    2022-06-21 10:45:30.693 macosvm[911:17777]  + display: 2560 x 1600 @ 200
    2022-06-21 10:45:30.693 macosvm[911:17777]  + disk image file:///Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-disk.img (read-write)
    2022-06-21 10:45:30.693 macosvm[911:17777]  + new aux storage /Volumes/MacVMs4/VMS/OSX12-1/osx12-1-bridge-aux.img
    2022-06-21 10:45:30.693 macosvm[911:17777]  + 2 CPUs
    2022-06-21 10:45:30.693 macosvm[911:17777]  + 4294967296 RAM
    2022-06-21 10:45:30.693 macosvm[911:17777] validateWithError = Error Domain=VZErrorDomain Code=2 "Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement.}
    2022-06-21 10:45:30.693 macosvm[911:17777] Exception in VM init: Error Domain=VZErrorDomain Code=2 "Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement.}
    
    opened by NW90 3
  • Network connect issue

    Network connect issue

    Can not connect to network by nat (ethernet), it shows following errors:

    2022-08-10 14:17:57.073 macosvm[13593:402196] validateWithError = Error Domain=VZErrorDomain Code=2 "Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement.}
    2022-08-10 14:17:57.073 macosvm[13593:402196] Exception in VM init: Error Domain=VZErrorDomain Code=2 "Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=Using VZBridgedNetworkDeviceAttachment in a process that lacks the “com.apple.vm.networking” entitlement.}
    
    opened by zenkarsha 2
  • Recovery

    Recovery

    Virtualization.Framework has a few private APIs that can come handy when debugging issues: A PL011 emulator so you can get iBoot & kernel debug output and forcing parameters to get the VM to boot in RecoveryOS or DFU mode.

    This PR adds support for all 3 of them: The PL011 configuration can be stored permanently as part of the vm config. Recovery and DFU are only command line switches, because they will only be useful during manual recovery.

    opened by agraf 2
  • Possibility to run more than 2 VMs on same host

    Possibility to run more than 2 VMs on same host

    Is it possible to somehow overcome the limitations of the 2 VM per host machine limit and run more VMs on the same host machine?

    When I try to run three times ./macosvm vm.json --ephemeral then I get an error

    2022-08-12 09:04:06.328 macosvm[13625:684496] start completed err=Error Domain=VZErrorDomain Code=6 "The maximum supported number of active virtual machines has been reached." UserInfo={NSLocalizedFailure=No value exists in nvram for the provided key., NSLocalizedFailureReason=The maximum supported number of active virtual machines has been reached.}
    2022-08-12 09:04:06.328 macosvm[13625:684496] *** Terminating app due to uncaught exception 'VMStartError', reason: 'Error Domain=VZErrorDomain Code=6 "The maximum supported number of active virtual machines has been reached." UserInfo={NSLocalizedFailure=No value exists in nvram for the provided key., NSLocalizedFailureReason=The maximum supported number of active virtual machines has been reached.}'
    
    opened by kurochenko 1
  • Issues building from master branch

    Issues building from master branch

    Hit this issue when trying to build from master branch (revision f044ad8ba58df6529b49aaf132045164b790a03b).

    Thanks!

    Using xcodebuild:

    pmoore@Peters-MacBook-Pro:~/git/macosvm master $ xcodebuild 
    2022-08-05 05:35:30.350 xcodebuild[90375:7223177] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-08-05 05:35:30.350 xcodebuild[90375:7223177] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
    
    User defaults from command line:
        IDEPackageSupportUseBuiltinSCM = YES
    
    note: Using new build system
    note: Planning
    Analyze workspace
    
    Create build description
    Build description signature: a37167f2ce8cd2707ce805f47b4e7d39
    Build description path: /Users/pmoore/git/macosvm/build/XCBuildData/a37167f2ce8cd2707ce805f47b4e7d39-desc.xcbuild
    
    note: Build preparation complete
    note: Building targets in dependency order
    CreateBuildDirectory /Users/pmoore/git/macosvm/build
        cd /Users/pmoore/git/macosvm/macosvm.xcodeproj
        builtin-create-build-directory /Users/pmoore/git/macosvm/build
    
    CreateBuildDirectory /Users/pmoore/git/macosvm/build/Release
        cd /Users/pmoore/git/macosvm/macosvm.xcodeproj
        builtin-create-build-directory /Users/pmoore/git/macosvm/build/Release
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources/Entitlements.plist (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources/Entitlements.plist
    
    ProcessProductPackaging /Users/pmoore/git/macosvm/macosvm/macosvm.entitlements /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm.xcent (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        
        Entitlements:
        
        {
        "com.apple.security.app-sandbox" = 0;
        "com.apple.security.device.usb" = 1;
        "com.apple.security.get-task-allow" = 1;
        "com.apple.security.network.client" = 1;
        "com.apple.security.network.server" = 1;
        "com.apple.security.virtualization" = 1;
    }
        
        builtin-productPackagingUtility /Users/pmoore/git/macosvm/macosvm/macosvm.entitlements -entitlements -format xml -o /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm.xcent
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm.hmap (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm.hmap
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-project-headers.hmap (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-project-headers.hmap
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-all-target-headers.hmap (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-all-target-headers.hmap
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-own-target-headers.hmap (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-own-target-headers.hmap
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/all-product-headers.yaml (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/all-product-headers.yaml
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-generated-files.hmap (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-generated-files.hmap
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-all-non-framework-target-headers.hmap (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-all-non-framework-target-headers.hmap
    
    WriteAuxiliaryFile /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/macosvm.LinkFileList (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        write-file /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/macosvm.LinkFileList
    
    CompileC /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/main.o /Users/pmoore/git/macosvm/macosvm/main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        export LANG\=en_US.US-ASCII
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target arm64-apple-macos12.0 -fmessage-length\=245 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -std\=gnu11 -fobjc-arc -fobjc-weak -fmodules -gmodules -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/var/folders/kc/p5r32hgd42xcwxhc9lyfxtwm0000gn/C/org.llvm.clang/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wquoted-include-in-framework-header -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DNS_BLOCK_ASSERTIONS\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility\=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -iquote /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-generated-files.hmap -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-own-target-headers.hmap -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-all-target-headers.hmap -iquote /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-project-headers.hmap -I/Users/pmoore/git/macosvm/build/Release/include -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources-normal/arm64 -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources/arm64 -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources -F/Users/pmoore/git/macosvm/build/Release -MMD -MT dependencies -MF /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/main.d --serialize-diagnostics /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/main.dia -c /Users/pmoore/git/macosvm/macosvm/main.m -o /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/main.o
    In file included from /Users/pmoore/git/macosvm/macosvm/main.m:3:
    /Users/pmoore/git/macosvm/macosvm/VMInstance.h:31:40: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
    /Users/pmoore/git/macosvm/macosvm/VMInstance.h:31:40: note: insert '_Nullable' if the pointer may be null
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
                                             _Nullable 
    /Users/pmoore/git/macosvm/macosvm/VMInstance.h:31:40: note: insert '_Nonnull' if the pointer should never be null
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
                                             _Nonnull 
    /Users/pmoore/git/macosvm/macosvm/main.m:94:7: warning: extra tokens at end of #endif directive [-Wextra-tokens]
    #endif;
          ^
          //
    /Users/pmoore/git/macosvm/macosvm/main.m:93:19: error: expected ';' after expression
        fflush(stdout)
                      ^
                      ;
    2 warnings and 1 error generated.
    
    CompileC /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/VMInstance.o /Users/pmoore/git/macosvm/macosvm/VMInstance.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'macosvm' from project 'macosvm')
        cd /Users/pmoore/git/macosvm
        export LANG\=en_US.US-ASCII
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -target arm64-apple-macos12.0 -fmessage-length\=245 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fcolor-diagnostics -std\=gnu11 -fobjc-arc -fobjc-weak -fmodules -gmodules -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/var/folders/kc/p5r32hgd42xcwxhc9lyfxtwm0000gn/C/org.llvm.clang/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wquoted-include-in-framework-header -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DNS_BLOCK_ASSERTIONS\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -fvisibility\=hidden -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -iquote /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-generated-files.hmap -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-own-target-headers.hmap -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-all-target-headers.hmap -iquote /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/macosvm-project-headers.hmap -I/Users/pmoore/git/macosvm/build/Release/include -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources-normal/arm64 -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources/arm64 -I/Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/DerivedSources -F/Users/pmoore/git/macosvm/build/Release -MMD -MT dependencies -MF /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/VMInstance.d --serialize-diagnostics /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/VMInstance.dia -c /Users/pmoore/git/macosvm/macosvm/VMInstance.m -o /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/VMInstance.o
    In file included from /Users/pmoore/git/macosvm/macosvm/VMInstance.m:1:
    /Users/pmoore/git/macosvm/macosvm/VMInstance.h:31:40: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
    /Users/pmoore/git/macosvm/macosvm/VMInstance.h:31:40: note: insert '_Nullable' if the pointer may be null
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
                                             _Nullable 
    /Users/pmoore/git/macosvm/macosvm/VMInstance.h:31:40: note: insert '_Nonnull' if the pointer should never be null
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
                                             _Nonnull 
    /Users/pmoore/git/macosvm/macosvm/VMInstance.m:326:20: warning: unused variable 'slavefd' [-Wunused-variable]
                int masterfd, slavefd;
                              ^
    2 warnings generated.
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
    	CompileC /Users/pmoore/git/macosvm/build/macosvm.build/Release/macosvm.build/Objects-normal/arm64/main.o /Users/pmoore/git/macosvm/macosvm/main.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'macosvm' from project 'macosvm')
    (1 failure)
    

    Using make:

    pmoore@Peters-MacBook-Pro:~/git/macosvm master $ make
    make -C macosvm macosvm
    clang -I/opt/homebrew/opt/ruby/include -Wall -c main.m
    In file included from main.m:3:
    ./VMInstance.h:31:40: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
    ./VMInstance.h:31:40: note: insert '_Nullable' if the pointer may be null
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
                                             _Nullable 
    ./VMInstance.h:31:40: note: insert '_Nonnull' if the pointer should never be null
    @property (strong) VZMacOSRestoreImage *restoreImage;
                                           ^
                                             _Nonnull 
    main.m:94:7: warning: extra tokens at end of #endif directive [-Wextra-tokens]
    #endif;
          ^
          //
    main.m:93:19: error: expected ';' after expression
        fflush(stdout)
                      ^
                      ;
    2 warnings and 1 error generated.
    make[1]: *** [main.o] Error 1
    make: *** [all] Error 2
    pmoore@Peters-MacBook-Pro:~/git/macosvm master $ 
    
    opened by petemoore 1
  • Number of pointing devices is greater than the maximum number supported

    Number of pointing devices is greater than the maximum number supported

    % ../macosvm/macosvm -g linux.json 2022-12-24 20:41:54.450 macosvm[56871:2611793] Creating instance ... 2022-12-24 20:41:54.450 macosvm[56871:2611793] <VMSpec: 0x120f041a0> - configure for run, OS: linux 2022-12-24 20:41:54.450 macosvm[56871:2611793] + Linux kernel vmlinuz-5.10.70 -- file:///Projects/macosvm/linux/ 2022-12-24 20:41:54.450 macosvm[56871:2611793] + kernel boot parameters: console=hvc0 root=/dev/vda1 2022-12-24 20:41:54.450 macosvm[56871:2611793] + inital RAM disk: initrd -- file:///Projects/macosvm/linux/ 2022-12-24 20:41:54.450 macosvm[56871:2611793] + NAT network 2022-12-24 20:41:54.450 macosvm[56871:2611793] + network: ether 2a:04:4a:5d:0d:bf 2022-12-24 20:41:54.450 macosvm[56871:2611793] + display: 2560 x 1600 @ 200 2022-12-24 20:41:54.450 macosvm[56871:2611793] + disk image debian-rootfs-aarch64.img -- file:///Projects/macosvm/linux/ (read-write) 2022-12-24 20:41:54.451 macosvm[56871:2611793] + 2 CPUs 2022-12-24 20:41:54.451 macosvm[56871:2611793] + 4294967296 RAM 2022-12-24 20:41:54.453 macosvm[56871:2611793] validateWithError = Error Domain=VZErrorDomain Code=2 "Number of pointing devices is greater than the maximum number supported." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=Number of pointing devices is greater than the maximum number supported.} 2022-12-24 20:41:54.453 macosvm[56871:2611793] Exception in VM init: Error Domain=VZErrorDomain Code=2 "Number of pointing devices is greater than the maximum number supported." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailure Reason=Number of pointing devices is greater than the maximum number supported.}

    linux.json.zip

    opened by rtfmoz2 4
  • Request for clipboard support

    Request for clipboard support

    First of all a very big "THANK YOU" for creating this wrapper to virtualization framework. In fact, this wrapper has good number of features (including changing of screen resolution, storage size, CPU, memory etc...) that I was not able to find in other commercial applications.

    When you get a chance, please look at the possibility of sharing the clipboard from the host mac os to guest mac os.

    Thank you so much in advance, Guru R.

    opened by guru-irvine 3
Releases(0.2-0)
  • 0.2-0(Nov 10, 2022)

    0.2-0

    • command line parameters are now parsed after the specified configuration file is loaded and will cause the settings to be added to the configuration. This allows the use of pre-specified configurations which can be supplemented by command line arguments. This behavior is more intuitive, but different from 0.1 versions which is why we chose to increase the version.
    • added --save <path> which will write the resulting configuration after all arguments were parsed into a JSON file specified by <path>. Note that --restore already creates the configuration file without this option, so --save should only be used when it is desired to update an existing configuration augmented with command line options to create a new configuration file.
    • optional capabilities that depend on the host environment are listed as Capabilities: in the output of --version
    Source code(tar.gz)
    Source code(zip)
    macosvm-0.2-0-arm64-darwin21.tar.gz(46.49 KB)
  • 0.1-4(Nov 10, 2022)

    0.1-4

    • --net unix:<socket>[,mac=<mac>][,mtu=<mtu>] creates a network interface which routes network traffic to a unix socket <socket> on the host. The default (and minimum) MTU is 1500, but it can be increased (only on macOS 13 and higher). A temporary socket is created in the temporary directory by default, but the directory can be overridden by the TMPSOCKDIR environment variable.
    • ephemeral files are now also removed on SIGABRT which can happen if the Virtualization framework raises an execption
    • added support for usb disk type (macOS 13 and above only)
    • added support for Mac trackpad if both the guest and host are macOS 13
    • added --spice which will enable clipboard shaing between the host and guest using the SPICE protocol (experimental). Requires macOS 13 host and spice-vdagent in the guest. Due to an issue in the Apple VZ framework this currently only works with Linux guests (macOS guests crash).
    Source code(tar.gz)
    Source code(zip)
    macosvm-0.1-4-arm64-darwin21.tar.gz(45.80 KB)
  • 0.1-3(Oct 26, 2022)

    See NEWS

    • added --vol for virtiofs shared volumes/directories (macOS 13 recommended)
    • added network interface MAC address reporting and options (see --net nat:<MAC> and --mac <MAC>)
    • added serial console support for macOS guests (use --no-serial to disable)
    • added --pty support

    Note: the (signed) binary only requires macOS 12 target, but uses macOS 13 SDK for optional features such as guest auto-mount.

    Source code(tar.gz)
    Source code(zip)
    macosvm-0.1-3-arm64-darwin21.tar.gz(40.89 KB)
  • 0.1-2(Nov 21, 2021)

Owner
Simon Urbanek
Simon Urbanek
Swift utilities for running commands.

Swift Commands Swift utilities for running commands. The Commands module allows you to take a system command as a string and return the standard outpu

Phil 41 Jan 2, 2023
A nifty command-line tool to customize macOS icons

iconset A nifty command line tool to manage macOS icons iconset is a new command line tool for macOS that allows you to change icons for macOS apps (e

aarnav tale 32 Nov 17, 2022
CLI tool for macOS that transcribes speech from the microphone using Apple’s speech recognition API, SFSpeechRecognizer. (help.)

CLI tool for macOS that uses SFSpeechRecognizer to transcribe speech from the microphone. The recognition result will be written to the standard output as JSON string.

Thai Pangsakulyanont 23 Sep 20, 2022
A Mac command-line tool that automatically downloads macOS Installers / Firmwares.

MIST - macOS Installer Super Tool A Mac command-line tool that automatically downloads macOS Installers / Firmwares: Features List all available macOS

Nindi Gill 483 Jan 8, 2023
macOS command line tool to return the available disk space on APFS volumes

diskspace Returns available disk space With the various APFS features the value for free disk space returned from tools such as du or df will not be a

Armin Briegel 131 Nov 14, 2022
A CommandLine tool for managing the Pasteboard on macOS

boardutil A CommandLine tool for managing the Pasteboard on macOS Options --set

Serena 0 Jan 20, 2022
RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync

Hi there ?? RsyncOSX and RsyncUI are GUI´s on the Apple macOS plattform for the command line tool rsync. It is rsync which executes the synchronize ta

Thomas Evensen 1.1k Dec 23, 2022
A Mac command-line tool that generates kick-ass Jamf Pro reports.

KMART - Kick-Ass Mac Admin Reporting Tool A command-line utility generating kick-ass Jamf Pro reports: Features Reporting on the following Jamf Pro ob

Nindi Gill 86 Dec 15, 2022
ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

Majd Alfhaily 3k Dec 30, 2022
iOS command-line tool that allows searching and downloading ipa files from the iOS App Store

ipatool for iOS This is a port of Majd Alfhaily's ipatool adapted to run on iOS Build / Installation To build this, make sure you have AppSync install

dan 21 Sep 13, 2022
🕳 A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image.

HolePunch NAME holepunch -- A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image. SYNOPSIS holepu

Yoshimasa Niwa 15 Nov 24, 2022
The best command-line tool to install and switch between multiple versions of Xcode.

The best command-line tool to install and switch between multiple versions of Xcode.

Robots and Pencils 2.3k Jan 9, 2023
Command Line Tool for interacting with MachO binaries on OSX/iOS

inject inject is a tool which interfaces with MachO binaries in order to insert load commands. Below is its help. ➜ ./inject -h OVERVIEW: inject v1.0.

<script>alert('1')</script> 36 Dec 23, 2022
Swift tool to generate Module Interfaces for Swift projects.

ModuleInterface Swift tool to generate Module Interfaces for Swift projects. What is a Module Interface A Module Interface is what we commonly get usi

Jorge Revuelta 75 Dec 21, 2022
CookCLI is provided as a command-line tool to make Cook recipe management easier

CookCLI is provided as a command-line tool to make Cook recipe management easier, and enable automation and scripting workflows for the CookLa

null 523 Dec 29, 2022
A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project.

SwiftPackageList A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project. This includes all the Package.resolved

Felix Herrmann 14 Jan 8, 2023
A powerful command line tool for performing stoichiometry calculations on checmicals and chemical equations.

Stoichiometry Stoichiometry is a powerful command line tool for preforming stoichiometry chemicals and chemical equations. Its subcommands are listed

null 3 Jul 15, 2022
A tool to restore iOS Devices on versions they're already on, based on the original Succession

SuccessorCLI A CLI tool to restore iOS devices on the version they're already on, inspired by the original Succession GUI Application, rewritten from

Serena 11 Dec 26, 2022
A command-line tool to sort Xcode's `.xcodeproj` file.

XcodeProjSorter A command-line tool to sort Xcode's .xcodeproj file. It sorts following sessions: PBXGroup PBXResourcesBuildPhase PBXSourcesBuildPhase

Nelson 7 Apr 27, 2022