khaost / macvm Goto Github PK
View Code? Open in Web Editor NEWmacOS VM for Apple Silicon using Virtualization API
License: Apache License 2.0
macOS VM for Apple Silicon using Virtualization API
License: Apache License 2.0
Hi.
Is possible copy a file from device and send to VM?
Does anybody know if this virtualization api has support for clipboard sharing between host and guest? If so that would be a helpful addition.
On Monterey Beta 3. When I try to install after setting the IPSW file I get:
-[VZMacOSInstaller initWithVirtualMachine:restoreImage:]: unrecognized selector sent to instance
VMInstance line 125.
Seems odd since the Swift to Obj-C bridge seems to be there. Not too expert at Swift though.
Host OS: Monterey Beta 9
Model: 13" Macbook Pro M1
Error message(s):
`2021-10-06 20:45:03.505441-0500 MacVM[22434:192301] Error: Error Domain=VZErrorDomain Code=1 "Installation service connection unexpectedly terminated." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=Installation service connection unexpectedly terminated.}
2021-10-06 20:45:08.688250-0500 MacVM[22434:192779] [logging-persist] cannot open file at line 45340 of [d24547a13b]
2021-10-06 20:45:08.688828-0500 MacVM[22434:192779] [logging-persist] os_unix.c:45340: (0) open(/var/db/DetachedSignatures) - Undefined error: 0
`
Steps to reproduce:
Hi,
Is there an option to expand the disk size for already configured Mac VM?
Thanks!
Please make a build release
Hi
thank you for your project .
is there a way to connect to the VM microphone and camera .
thank you.
Hello, thank you for this project. I am unable to build project and no technical knowledge, do you please know how to fix this?
Running Monterey 12.6 with Xcode 14.0.1 on M1.
Errors / warnings:
I am receiving the following message inside XCode when I try to open the .macosxvm
file:
2022-01-05 11:06:24.442236-0600 MacVM[61795:1484276] Error: Error Domain=VZErrorDomain Code=2 "A storage device configuration is invalid." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=A storage device configuration is invalid., NSUnderlyingError=0x6000001c52f0 {Error Domain=VZErrorDomain Code=2 "The storage device attachment is invalid." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=The storage device attachment is invalid.}}}
2022-01-05 11:06:26.513352-0600 MacVM[61795:1484276] [Document] Popover failed to show
Before that it was running fine until I needed to expand the drive size. I hadn't realized that maybe the right way to do it was to edit the metadata
file, and instead I had tried the resize mentioned in one of the Issues on here. (#19)
$ hdiutil resize -size 80g -imageonly disk.img
hdiutil: resize: failed. Resource temporarily unavailable (35)
I had shutdown the VM before that.
Essentially I can no longer use the VM, which unfortunately is my work "computer". ๐ฑ
Any thoughts on how to recover?
metadata
file:
{
"hardwareModelData": "YnBsaXN0MDDTAQIDBAUGXxAZRGF0YVJlcHJlc2VudGF0aW9uVmVyc2lvbl8QD1BsYXRmb3JtVmVyc2lvbl8QEk1pbmltdW1TdXBwb3J0ZWRPUxQAAAAAAAAAAAAAAAAAAAABEAKjBwgIEAwQAAgPKz1SY2VpawAAAAAAAAEBAAAAAAAAAAkAAAAAAAAAAAAAAAAAAABt",
"cpuCount": 4,
"identifier": "D94C024E-51B0-4DF8-82D3-F35F0DA84871",
"machineIdentifierData": "YnBsaXN0MDDRAQJURUNJRBNuPkK7jq7GlQgLEAAAAAAAAAEBAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAZ",
"diskSize": 32,
"installed": true,
"memorySize": 17179869184,
"audio": true
}
I'd like to change the size to 80GB
----- Additional Info -----
$ hdiutil resize -size 80g -imageonly disk.img -verbose
DIBackingStoreInstantiatorProbe: interface 0, score 100, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface 1, score -1000, CBundleBackingStore
DIBackingStoreInstantiatorProbe: interface 2, score -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface 3, score -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface 4, score -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: interface 5, score -1000, CVectoredBackingStore
hdiutil: resize: failed. Resource temporarily unavailable (35)
Is there a way to change virtual machine serial number and hardware model identifier? So it could be enrolled in an MDM such as Intune? If so please tell me how.
Thanks
Kristian
I'd reset my macvm password to empty pwd, after restart vm, it can not login by simply press enter button.
But it can pass the recovery choose disk asking permission password dialog.
Hi. How do you hide the window title in full screen?
When my 2 monitors are connected and my laptop lid is closed (probably even when it's not) I can't press install and no error is shown this is also happening when I trying to start the VM
I found out in the Console app, the error was
Error: Error Domain=VZErrorDomain Code=2 "More than one display is configured." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=More than one display is configured.}
I plugged the 2nd external screen and pressed install and return it and it worked
First, thanks again for putting this project together. I'm wondering if there are ways to reduce the size of the VM by removing unneeded or unwanted software?
The smallest usable sized VM I was able to create was about 30GB. This didn't leave a lot of room to install other tools. However, macOS comes with all kinds of software by default which is not needed. If I could delete GarageBand, Keynote, Pages, and Numbers, that would save approximately 3GB in disk size.
I learned that these programs are kept on a different partition on a read-only drive. The only way I have thought to remove them is to disable the system integrity protection via the recovery partition. However, on Mac M1 computers, this requires powering down the machine and holding the power button until the options menu appears. I'm not sure how to do this on a VM since the VM has no physical keyboard with a power button.
Is there any known way or other ideas for creating macOS virtual machines that have a smaller disk footprint? We won't necessarily need every piece of software if we're just looking to test a specific product. Thank you again!
Or only Monterey can be virtualised?
Thanks so much for this project! Wondering if its possible to start a few VMs via launchctl on boot? I'm able to start multiple VMs manually but I can't figure out the CLI equivalent.
I've got an odd issue; after building on 12.0.1 in Xcode 13.1, the install of UniversalMac_12.0.1_21A559_Restore.ipsw goes fine, until I need to type. While the mouse works perfectly, I get a beep with every keystroke, and nothing appears on the screen.
I recently saw that there is a way to use an Internal IP instead of a NAT one in VMs with Apple Silicon.
I don't know it's implemented but it's working with Parallels .. any chance to have it here too?
Great project!
Each time I turned on the VM the IP is increasing by one (e.g. from 192.168.64.4
to 192.168.64.5
) and I'm afraid that there are some forgotten cleaning that when it reaches 192.168.4.254
it would no longer be able to turned on
Any plan to have an early version to support macOS Ventura as host for the new settings?
maybe an option for the Unix VM too ( the sample code provided by Apple is light and don't include the Rosseta part ...)
Similar to #12, I was confused on how to use this code due to the file picker dialog.
I think a short documentation can help to get this working for users unfamiliar to the specifics of MacOS virtualisation.
I haven't found a way to get the VM into recovery mode so that I can disable SIP. Anyone any idea?
BTW: Great work and thank you, @KhaosT!!!
The macOS 12.1 installer freezes about 5 seconds (e.g. in the "select language" screen) after the start of the VM. No log messages are shown in the console.
I'm fighting with command line since yesterday to resize the disk to apply the macOS 12.1 update.
with "hdiutil resize -size 80g -imageonly disk.img" I was able to increase the size but inside the VM I don't find the good command to extend the APFS partition
I was betting on "diskutil apfs resizeContainer disk0s2 0" but it's not working ...
any idea?
Has anyone had an issue with Menu's and Hover States not working? Basically the area affected just blanks out. This is most notable in Chrome, making it nearly unusable.
Safari works pretty well so far. Sadly, we use a set of custom chrome extensions for daily work, so switching to Safari isn't an option right now.
I get these 2 errors when I try to build the project:
"There are no accounts registered with Xcode. Add your developer account to Xcode"
and
"No signing certificate 'Mac Development' found: No 'Mac Development' signing certificate matching team ID '7C2EXSD3YV' with a private key was found."
If I edit MacVM.xcodeproj/project.pbxproj and change the 2 instances of "DEVELOPMENT_TEAM = 7C2EXSD3YV;" to 'DEVELOPMENT_TEAM = "";' then it builds and runs without error.
So, just read the API docs and I see vague information regarding machine identifier and hardware model but nothing specific about the serial. Are you aware of any means of specifying the serial of the VM?
When I run this project on my Xcode, I got an error as: "Could not attach to pid : โ36574. the platform is not currently connected". I'm using Macbook Pro 14 (M1 Pro).
System Information
macOS Version 13.2.1 (Build 22D68)
Xcode 14.2 (21534) (Build 14C18)`
Did you find any other documentation than just this and same for the other classes? (This from https://developer.apple.com/documentation/virtualization/vzmacosinstaller)
class VZMacOSInstaller : NSObject
init(virtualMachine: VZVirtualMachine, restoringFromImageAt: URL)
var progress: Progress
var restoreImageURL: URL
var virtualMachine: VZVirtualMachine
func install(completionHandler: (Result<Void, Error>) -> Void)
I have a developer account and wanted to try to create a VM with the macOS Ventura support with the ipsw. It doesn't seem to do anything as the install process is stuck at 0%.
Also noticed that nothing is written to the image file either.
0+0 records in
0+0 records out
0 bytes transferred in 0.000006 secs (0 bytes/sec)
Is it because I'm running macOS Monterey and creating and running a Ventura VM requires me to also run the same OS? I don't want to do that since of compatibility issues and I kind of want to try to run it in a VM first. Anyone experiencing the same issue?
Getting the "Verification failed" error when trying to sign-in an Apple ID, which I think is required to install Rosetta 2? It's certainly required to grab anything out of the Mac App Store or install updates, I believe.
It looks like FN key is not being forwarded to the guest OS: pressing FN + Back key on my host OS correctly deletes one character to the right of the cursor, but this action has no effect in the guest OS. Also Keyboard configuration in the guest OS is missing "Use F1, F2, etc. as standard function keys" option.
This means the "Delete" key on my Logitech keyboard does not work in the VM, neither do the "Back"/"Forward" buttons on my mouse. It seems like the VZUSBKeyboardConfiguration is not working correctly, so it might be Apple issue...
hi. i am trying to build the project and i was watching the video and tried on both xcode beta and xcode 13 full and instead of the vm image i get a finder window and then in xcode i see a line [org.oltica.MacVM] copy_read_only: vm copy failed: status 1. I did not get any prompts for access to disk and this machine is a brand new M1 with Monterey and nothing else on it. any ideas?
Will this become possible on Intel-based Macs too? Or does it depend on virtualization functions only the ARM-based processors offer?
When I run the project in XCode, a file picker dialog pops up. Can someone please tell me what am I supposed to select at this point?
I'm running XCode 13 on macOS 12.0.1 Monterey.
I did get a Monterey VM created using Ming's repository here, which is based on Khaos's work, and thanks to Mr. Macintosh's walkthrough of Ming's instructions, but I want to give it a try with Khaos's original solution as well.
I should also add I'm on an ARM64 Mac M1.
Hi, is there a way to programatically get the IP of the VM so i can SSH into it?
I can't see a way to configure the network connectivity for the VM.
Currently, It's showing a "connected" Ethernet adapter but there's no connection to the network, bridged or NAT, doesn't receive DHCP and even with manual config, it doesn't communicate.
How do i fix this?
I upgraded my operating system to Mac OS Monterey v12.0.1 and also updated Xcode to v13.1. While the compile errors I was facing before have all been resolved, I'm now faced with these errors about the signing certificate and developer account.
Do I need to pay for a developer account with Apple? I'm just wanting to compile this and run it and try it out. Thank you.
This is not an issue, but rather a question: why is there no alternative to virtualizing macOS Big Sur on M-Series machines? I've seen that even Parallels cannot virtualize operative systems under Monterrey; why isn't it possible when this is an arm-based system?
I need to keep a scenario set up to test apps in controlled environments, would it be possible to think about version control?
I failed with Git LFS used.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.