Virtualization

RSS for tag

Create hardware-accelerated virtual machines to run macOS and Linux-based operating systems.

Virtualization Documentation

Pinned Posts

Posts under Virtualization tag

60 Posts
Sort by:
Post not yet marked as solved
1 Replies
407 Views
Hi, I'm trying to implement macOS virtualization on the M1 Sonoma mac mini. Configuration: OS- Mac m1 sonoma Build version- 23A5286i ProductVersion- 14.0 Virtulization image- 13.5.2 bulild version IPSW file - /UniversalMac_13.5.2_22G91_Restore.ipsw I'm following the documentation - https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon?language=objc Getting following error while reloading the restore image- MacOSVirtualMachineInstaller.swift:32: Fatal error: The restore image failed to load. Unable to connect to installation service Please help.
Posted
by Jaykam.
Last updated
.
Post not yet marked as solved
1 Replies
516 Views
I have a Mac OS virtual machine (VM) on my Macbook Pro with M1 Pro chip. The VM was set up using Xcode and Apple's sample code in https://developer.apple.com/documentation/virtualization. Both the host and the VM have Mac OS 14. The mouse and trackpad scroll direction is reverse to what I am used to so I need to change the natural scroll setting. However mouse and trackpad settings are missing in my VM. Usually, they are under Keyboard (host has them). The pointing device was set up using the default in the sample code: static func createPointingDeviceConfiguration() -> VZPointingDeviceConfiguration { return VZMacTrackpadConfiguration() } I have been using this setup before without a problem. But now I am not able to change the scroll direction. Does anyone know what is going on? Any suggestion will be appreciated.
Posted Last updated
.
Post not yet marked as solved
5 Replies
1.1k Views
Hello, When building and running the GUILinuxVirtualMachineSampleApp, I immediately get the error : "Failed to retrieve the machine identifier data." The app runs with a black window and an infinite loop icon without the file picker prompt as expected. Hardware : MacBook Pro M2 OS : macOS 13.2.1 Can't understand what's causing it relatively to the VZGenericMachineIdentifier object. Any insight or suggestion would be more than appreciated. Thanks in advance :). Sincerely, hex0x40
Posted
by hex0x40.
Last updated
.
Post marked as solved
3 Replies
2.6k Views
@eskimo Hi! I tried out this new download. I'd installed it on the Ventura host and in the Sonoma VM, but the Sonoma Beta 1 VM does not "see" Beta 2. https://developer.apple.com/download/ How do we update our VM running macOS 14 beta 1 to beta 2? Thanks! Device Support for macOS 14 beta 2 Install Device Support for macOS 14 beta 2 if installing the macOS Seed in a virtual Machine fails on a host Mac. Released June 21, 2023 Build 1700B21 Download Device Support Image Device Support for macOS 14 beta 2 1700B21
Posted
by Bolsinga.
Last updated
.
Post not yet marked as solved
3 Replies
1.8k Views
Trying to get some minimum development working again, I've been waiting to be able to macOS in VMs on M1. Currently both VirtualBuddy, and UTM, can install macOS, I can go to Recovery Boot to disable SIP and enable 3rd party extensions. My M1 runs: ProductVersion: 13.0 BuildVersion: 22A5331f I've tested VM macOS versions of Monterey and Ventura. Here is my old kext (known to be working) loaded on M1 (Ventura) bare-metal 250 0 0xfffffe0006b70000 0x862ac 0x862ac org.openzfsonosx.zfs (2.1.0) BE4DF1D3-FF77-3E58-BC9A-C0B8E175DD97 <21 7 5 4 3 1> The same pkg, using the same steps in the VM, will after clicking Allow, ask to reboot (suspiciously fast), then come up with: System Extension Error: An error occurred with your system extensions during startup and they need to be rebuilt before they can be used. Of course clicking Allow just does the same, reboot, fail, ask to approve again, reboot..fail... Directly on the hardware, the dialog "rebuilding cache" pops up for a few seconds, but with the VMs I do not see it. I'm unfamiliar with the new system, so I'm not sure which log files to look at, but here is the output from kmtuil log, both at Allow and after reboot: https://www.lundman.net/kmutil-log.txt If I was going to make an uneducated guess and pull out some lines by random, maybe: 2022-08-29 20:01:13.169897+0900 0x251 Error 0x0 100 0 kernelmanagerd: Kcgen roundtrip failed with: Boot policy error: Error creating linked manifest: code BOOTPOLICY_ERROR_ACM 2022-08-29 20:01:13.170200+0900 0x251 Error 0x0 100 0 kernelmanagerd: Kcgen roundtrip failed checkpoint saveAuxkc: status:error fatalError:Optional("Boot policy error: Error creating linked manifest: code BOOTPOLICY_ERROR_ACM") 2022-08-29 20:01:13.170201+0900 0x251 Error 0x0 100 0 kernelmanagerd: Kcgen roundtrip failed: missing last checkpoint or errors found 2022-08-29 20:01:13.170242+0900 0x251 Default 0x0 100 0 kernelmanagerd: Deleting Preboot content Any work arounds? Loading kexts on my only M1 is a hard way to develop.
Posted
by lundman.
Last updated
.
Post marked as solved
3 Replies
1.2k Views
Hi. Sorry if this question has been answered in another post, if it has I can't find it. My device is MacBook Pro 16-inch, M1, 2021. So I tried to create a VM using this guide from Apple I followed the guide and used an image of debian. Everything worked fine until the machine appeared stuck at some point of the installation. I chose my languages then I had some other prompt asking me to install something but I can't remember precisely the step at which I thought it was freezed (I think it was the GNOME install) So because the machine was not responding for several minutes (I might have been too hurried) I quitted the process by simply clicking on the Quit button in the VM window. The problem is that from that point onward, I can't load any VM anymore. The build is successful in Xcode, the machine starts but immediately quits with this response from Xcode logs : Virtual machine successfully started. Guest did stop virtual machine. 2023-02-02 22:22:45.413600+0100 GUILinux[22984:380971] [client] No error handler for XPC error: Connection invalid I just can't understand why, I tried to delete and download the guide again but it doesn't work. I will add that it's my first time using Xcode and I might have missed something obivous.
Posted
by Frikilax.
Last updated
.
Post not yet marked as solved
3 Replies
560 Views
Neat, looks like macOS Sonoma has native virtualisation now. You have to build a Swift app, which is a bit weird, but it works, and on an M1 chip. One thing though... here's a screenshot of the Displays screen in Settings: Curious why these two resolutions were decided. My host screen is 1920 x 1080, so one resolution is far too high, and the other is just a bit too small. Something in between would be nice! Here’s the guide if anyone wants to have a go: https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon You’ll need macOS 14 Sonoma and Xcode 15 beta
Posted
by nbolton.
Last updated
.
Post not yet marked as solved
3 Replies
948 Views
I've written a native app for macOS on my MacBook Air (with the Apple M2 chip.) Now I need to test it for an Intel-based CPU. When I build my app in Xcode, it is supposed to cover both ARM64 and x86-64 architectures in a single Mach-O binary, but when I send it to my customer he tells me that the app works on the Apple silicon but it crashes on his Intel-based Mac. So I'm looking for ways to test-run my app on an Intel-based platform and see what is wrong there. (But I obviously don't want to buy a separate Mac just for that.) I know that one can use Azure to spin up a Windows, or a Linux VM and open it via a web browser. But it doesn't seem to support macOS. How can I run an Intel-based macOS in a virtual environment? Or, do you have any other suggestions?
Posted
by dc2999.
Last updated
.
Post not yet marked as solved
0 Replies
792 Views
Hi there-- Ive been trying to recreate an issue with a camera app im developing on a clean install. I can easily start up a new VM with VirtualBuddy, UTM or Parallels but Im having trouble getting a camera device to passthrough. Parallels seems to be the most promising but whenever I try to connect it, there is an error. Does anyone have advice on the best VM provider to use to passthrough usb devices or native cameras? Thanks!
Posted Last updated
.
Post not yet marked as solved
2 Replies
668 Views
I'm used to test all the Beta version on Virtual OS ... With the new framework there is no way to sign with iCloud account. so no way to put an account to update the VM with a new beta who is released. The only solution is to setup a new VM. that is a real limitation as update process is important to test too... Any one have a solution?
Posted
by mnahum.
Last updated
.
Post marked as solved
1 Replies
615 Views
I want to expose a directory to MacOS VM when it is running. Apple's documentation mentions this (here) : The VZDirectoryShare on the configuration defines the host directories to expose to the guest. To limit or expose new directories to the guest while the VM is running, you can update the directory share with VZVirtioFileSystemDevice. But I tried the following when VM is running: Changing the original configuration of directory (saved the config applied, then changed it) Added new directory share in the original configuration Restarted running VM after (1) and (2) None of them are working. Anyone has any idea how to make this work ? Or this is not currently supported ?
Posted
by user_29e.
Last updated
.
Post not yet marked as solved
1 Replies
532 Views
I'm trying to create a vsock socket on the host but it fails with ENODEV. I know I can use a VZVirtioSocketDeviceConfiguration and get one through the Virtualization Framework, but for my use case it would be easier to integrate if I can create the socket myself. This works from inside a VM assuming I've configured a VZVirtioSocketDeviceConfiguration, but not on the host. #include <sys/types.h> #include <sys/socket.h> #include <stdio.h> int main() { int fd = socket(PF_VSOCK, SOCK_STREAM, 0); if (fd < 0 ) { perror("socket"); } return 0; }
Posted
by tzzz.
Last updated
.
Post not yet marked as solved
0 Replies
747 Views
Hello, I am running a virtual machine on my Apple Silicon Mac, using the sample Xcode project provided by Apple last year. I have Ventura 13.4 installed on on the host and the VM. I try to enter my Apple ID credentials in "Sign In with Apple ID" in the VM so I may then update this VM to Sonoma. I am sure I am getting my password correct. I cannot log in. Please see the screen shot. Am I supposed to be able to do this? I can log into developer.apple.com within the VM OK. Thank you. FB12263051
Posted
by Bolsinga.
Last updated
.
Post not yet marked as solved
0 Replies
520 Views
It's important to notice how Virtualization.framework seems to be a work in progress framework. I thank the Apple team to have prioritized the Virtualization features in macOS. This post will be a sum up of personal findings I found while playing with Virtualization.framework and a custom EFI Kernel. The thread will be updated as soon as I find any particular information about building a custom kernel and trying to load in Virtualization.framework. Naturally, it's not endorsed by anyone. Before starting... Before a list of "what to do", it's important to say that there are few details about how Virtualization.framework works under the hood. You might be a little demotivated, and creating a custom kernel for aarch64/x86_64 is very hard. Give a look for resources and do not loose your head! Custom Kernel To boot a custom kernel for Virtualization.framework, you need: UEFI compliant bootloader: pick the one you prefer. Among the popular options, there is GRUB, Limine, BootBoot. It's fundamental to be sure that bootloader is for UEFI and can load your kernel. You might want to try to run qemu for the architecture you're looking for. VirtIO support. This probably is a little bit difficult task. The devices (such as network, graphics, sound) can be retrieved using the PCI bus. Look at Intel or ARM documentation to specifically know how to write to I/O ports (e.g. ARM has its devices memory mapped, while on Intel you need to dig a little bit). Another note is about graphics. Some bootloader such as GRUB or Limine supports the framebuffer protocol and can ask directly to UEFI where the screen device is (returning an address that you can use to write pixel.) The VirtIO support is based on PCI drivers. I can suggest at first to load an hello world kernel, building the fundamental parts of OS for memory, and then start to implement PCI drivers. Once you did that, you can start to think about VirtIO and its queue. How to run it To boot the custom kernel, usually developers prefer to deploy it as a valid ISO image that contains the correct bootloader and kernel, or as a RAW image of the disk. It's important to notice that you need to build a VM machine with VZEFIBootLoader that creates a UEFI bootloader. RAW image of the disk MUST BE a valid APFS image. ISO image should be prepared with xorriso or anything similar: you have to be sure that the ISO respects the DOS format and is bootable. TL;DR: any ISO uefi-compatible should be runnable in Virtualization.framework. In case of any issues, or questions you can post a question in this forum. Resources include: the documentation for Virtualization.framework ARM/Intel assembly manuals
Posted
by seekbytes.
Last updated
.
Post not yet marked as solved
1 Replies
797 Views
I have a vm up and running after following some of the examples in the documentation. One thing I can't quite figure out how to do, is allow the Host to access services running on the VM from localhost. From the documentation it looks like there might be a couple options: Write a function that checks for new broadcasted ports from the guest, and then sets up a socket connection to the host for the port Try to obtain the com.apple.vm.networking entitlement for my application and setup a Bridged network device instead of a NAT Is there anything I am missing like a way to accomplish this easier with NAT, or are those the main options?
Posted Last updated
.
Post marked as solved
2 Replies
419 Views
Hello all, I am trying to setup a socket for communication between the host/guest. According to the documentation after adding a VZVIrtioSocketDeviceConfiguration object to configuration.socketDevices, the resulting virtualMachine object should have an array of VZVirtioSocketDevices with the member function setListener. So I have: let socketConfig = VZVirtioSocketDeviceConfiguration() configuration.socketDevices = [socketConfig] ... let virtualMachine = VZVirtualMachine(configuration: configuration) virtualMachine.socketDevices[0].setSocketListener(<#T##VZVirtioSocketListener#>, forPort: <#T##UInt32#>) but Xcode throws this error Value of type 'VZSocketDevice' has no member 'setSocketListener' Is there something I am missing?
Posted Last updated
.
Post marked as Apple Recommended
3.5k Views
Hi, I use MacVM to install Ventura on a VM. With macOS Ventura beta 2 I have several problems that I would have liked to report via the "Feedback assistant" application. The problem is that the application refuses my Apple ID and display the message "An error occurred during authentication." To verify my Apple ID I logged into my developer account via Safari. I was able to do it with no problem.
Posted
by ZeTof.
Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
Host: Mac Ventura 13.3/m1 Xcode:14.3 My request for access to the com.apple.vm.networking entitlement has been approved. In Xcode I have also enabled the ability to automatically manage signing. Then i followed the steps in the link, focusing on new process part (https://developer.apple.com/forums/thread/663271) I encountered some problems when I was trying to enable "com.apple.vm.networking" Adopt an Explicit App ID I already have an explicit App ID for a macOS target. Configure Your App ID My App ID has the VM Networking option checked. Enable the Entitlement (in the https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon_macs to download sample code) In the sample code macOSVirtualMachineSampleApp.entitlements and InstallationTool.entitlements these two file, I have added the "com.apple.vm.net working", and set the value to YES, but for my build target(InstallationTool-Swift), there is no Personal VPN capability here, so I did not add this capability to update profile, but when I build my target, the terminal always appears the following error. This error caused my virtual machine to not start at all: Message from debugger: no such process. Program ended with exit code: -1 I searched the Internet for this error which may have been caused by my developer account authentication failure, but i'm not sure. Please let me know where I went wrong. Now it seems that "com.apple.vm.networking" does not take effect or authorization is not successful. I also don't know whether there is something wrong with my configuration. Anyway, I hope you can give me some advice.
Posted
by DaisySun.
Last updated
.
Post not yet marked as solved
1 Replies
675 Views
I am not able to power on more than 2 macOS VM on my host Mac Studio with M1 Ultra and 128 GB RAM. I have only 32 GB RAM allocated to each VM. What is causing this issue and is there any workaround to run more VMs? Is this an apple enforced restriction? If so is there any documentation regarding this?
Posted
by govindvi.
Last updated
.