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

59 Posts
Sort by:
Post not yet marked as solved
9 Replies
3.1k Views
The new Virtualization framework (and sample code!) are great. It's a lot of fun to run the sample code and quickly fire up multiple VMs of macOS running as a guest. However, the inability to authenticate with any iCloud services is a significant roadblock. Xcode, for example, is not allowing me to authenticate my developer account. Are there any plans to resolve this issue so that iCloud accounts can be authenticated from within a VM?
Posted
by
Post not yet marked as solved
7 Replies
3.8k Views
My device is MacBook Pro 13-inch, M1, 2020 Use source code provided by article https://developer.apple.com/documentation/virtualization/running_gui_linux_in_a_virtual_machine_on_a_mac When installing Debian, Fedora or Ubuntu, installation process can stuck at any point and cause the installation failed. Even if it is lucky enough to pass the installation phase, stuck could still happen at any time when the virtual machine is started. It seems that there is some low level error that cause the Linux kernel panic, while during this process error seems to be accumulated--it starts with some user level application in Linux starts to behave weirdly, such as sudo does not authenticate a valid user, apt can not run properly, then Linux kernel panic. Sometimes it behaves like the VM get stuck where it is not sure what happened inside it. I can't provide more detail as it happens randomly and the phenomenon differs each time. While generally it appears to be an accumulated error and eventually the VM get stuck.
Posted
by
Post marked as Apple Recommended
3.4k 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
Post not yet marked as solved
2 Replies
1.7k 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
Post not yet marked as solved
2 Replies
3.7k Views
hello developers, First priority I couldn't find a proper title for the question :( The reason why I open a topic here is not to find the answer by direct point shooting; My goal is what do Apple, Developer, Companies and Devops teams think and comments about the subject I'm going to ask here? We use Jenkins as the Devops CI/CD tool at our company, and in Macos/Apple/iOS development, we use a lot of Mac Mini devices. Since we build/compilers on a project-based, version-based basis, we cannot get 100% efficiency from our devices. (For example, because the dependencies of a project are different from other projects; we dedicate only 1 Mac Mini to that project. (As the dependecys of the projects are too many and large, the migration process is very difficult for us, the cost of moving to a lower-level Mac Mini device is high / but this is just an example)) While researching, I saw that there is no docker container image for MacOs X (enterprise or legal) and I know about the Apple EULA. (For virtualization, Apple hardware must be used as a basis. Because the MacOs system is paid for on a device-based basis.) What I want to ask here is can I find or create a MacOs docker container image legally? How is the structure of other companies in their CI processes? If I install MacOs with more than one VMware/VirtualBox on Mac Mini, What harm could it do me in Jenkins? (I'm curious about people's comments on this.)
Posted
by
Post not yet marked as solved
4 Replies
955 Views
Filed as rdar://FB11975037 When macOS Ventura is run as a guest OS within the virtualization framework, the main menu bar items will not be displayed correctly if VZMacGraphicsDisplayConfiguration defines a large resolution. The menu bar titles appear to be using the same color as the menu bar itself. When the Appearance is set to Light, the menu bar items are effectively invisible. When the Appearance is set to Dark, the menu bar items are drawn in what looks like a disabled state. This only affects the menu bar item titles on the left-hand side. The date-time and menu bar icons on the right side are always displayed in the correct color. This appears to be a regression in macOS Ventura as this issue is not present in macOS 12 running as a guest. This bug can be easily reproduced using Apple's own Virtualization sample code titled: "Running macOS in a Virtual Machine on Apple Silicon Macs" Steps to reproduce: Follow the sample code instructions for building and installing a VM.bundle. Before running 'macOSVirtualMachineSampleApp', change the VZMacGraphicsDisplayConfiguration to use: width = 5120, height = 2880, ppi = 144. Run 'macOSVirtualMachineSampleApp' and notice that the menu bar titles on the left side of the screen are not correctly drawn in the guest instance. This has been tested on: Host: macOS 13.1 Guest: macOS 13.x (All versions) Hardware: MBP 14" M1 Pro 32GB/2TB Is there anything that can be done to resolve this issue?
Posted
by
Post marked as solved
3 Replies
1.1k 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
Post not yet marked as solved
5 Replies
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
Post not yet marked as solved
1 Replies
1.2k Views
I am on Ventura 13.3.1 with the M2 and I was trying to set up a Linux VM, following the steps on your website, but after I chose the ISO the following Error in Xcode appeared: GUILinuxVirtualMachineSampleApp[5863:111794] [client] No error handler for XPC error: Connection invalid . There was already a question about the No error handler on this forum, but that still didn't help me fix my Problem. So now my question is how do I fix it, because I have almost no good idea where to start. I can give more informations if needed. Big thanks and regards in advance :). Sincerely, Bieber
Posted
by
Post not yet marked as solved
1 Replies
619 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
Post not yet marked as solved
1 Replies
1.1k 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
Post marked as solved
2 Replies
391 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
by
Post not yet marked as solved
1 Replies
754 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
by
Post not yet marked as solved
0 Replies
490 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
Post not yet marked as solved
1 Replies
478 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 &lt;sys/types.h&gt; #include &lt;sys/socket.h&gt; #include &lt;stdio.h&gt; int main() { int fd = socket(PF_VSOCK, SOCK_STREAM, 0); if (fd &lt; 0 ) { perror("socket"); } return 0; }
Posted
by
Post not yet marked as solved
0 Replies
666 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
Post not yet marked as solved
2 Replies
974 Views
I am trying to run an executable on Rosetta 2 that has been compiled to run on amd64. My current setup is: MacbookPro with M2 Pro chip. Docker that is running an Ubuntu 20.04 container with the virtualization features enabled and the setting on for "Use Rosetta for x86/amd64 emulation on Apple Silicon" enabled. When running the application, I was initially warned about missing libs. I have added these to the container in the relevant directories and the application now has no missing deps that I can see. When running the executable, I am getting the error shown below and I'm unsure how I can get past this or if I have done something wrong in the steps I have mentioned. *** stack smashing detected ***: terminated Aborted As a final attempt to get this to work, I made a very simple hello world C program, this also displayed the error shown above. I think based on the error before all libs are present that Rosetta is being called correctly and that this is not an issue with my Rosetta install. If anyone has any suggestions it would be greatly appreciated.
Posted
by
Post marked as solved
1 Replies
578 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