Logging in with my Apple ID anywhere in the system (feedback assistant, Xcode, iCloud, etc.) fails when running under virtualization. Is this a known 'issue'? (networking in general is working fine)
Virtualization
RSS for tagCreate hardware-accelerated virtual machines to run macOS and Linux-based operating systems.
Posts under Virtualization tag
51 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I m trying to identify if my launched process is running on a local mac machine(desktop/laptop) or a virtual macOS X instance like AWS EC2, Azure, MacStadium etc.
I have followed this link which searched for its limited providers in the output, but I m not bound to any limited providers and looking for a general solution which is applicable to all the providers.
Is there some hardware/network/virtualization-related information that can be used to identify if the process is launched on a virtual MacOS instance?
OR is there some system Information that I can use to be sure that my process is running on a local machine?
I'm trying to send various user input events to a virtual machine. The app is built in SwiftUI, so the VZVirtualMachineView is part of a view controller wrapped in NSViewControllerRepresentable. Non-modified keystrokes and mouse clicks work fine, but I can't send modified keystrokes (e.g., ⌘F). These come through without the modifier (e.g., plain F). I also haven't been able to get mouse scroll wheel events to do anything in the VM.
I installed a local event monitor with addLocalMonitorForEvents(matching:handler:). Before the VM boots and the VM view exists, typing myself generates events that I see with the monitor. After the VM boots, though, the monitor does not see any of my keystrokes.
The monitor never sees any of my programmatically generated events. I am sending these all through NSWindow.sendEvent(_:).
Is there anything special about VZVirtualMachineView that might affect how it handles injected events?
It's obvious possible (likely) that I'm doing something wrong with how I build and/or send these events into the application. Can anyone point me to documentation or examples that aren't easily found through search engines?
I have created an Apple silicon macOS Sequoia VM using UTM on my Mac also running macOS Sequoia. As noted in the documentation, I can now sign-in to iCloud in the VM.
I want to update the VM to macOS Sequoia 15.1 beta. (I understand that Apple Intelligence won't be available in the VM. I need to test my software.)
However, when I go to Software Update in the System Settings, I am not offered the opportunity to enroll in the beta. (The "Beta Updates" section never appears.)
Is this intentional?
Every time I attempt to install the macOS Sequoia 15.1 Beta 2 IPSW (UniversalMac_15.1_24B5024e_Restore.ipsw) it fails with the following error in installWithCompletionHandler:
Error Domain=com.apple.MobileDevice.MobileRestore Code=3194 "Declined to authorize this DFU file on this device for this user." UserInfo={NSLocalizedDescription=Declined to authorize this DFU file on this device for this user., NSLocalizedFailureReason=Bei der Installation ist ein unbekannter Fehler aufgetreten.}
I'm running macOS Sonoma 14.6.1, tried with both MobileDevice.pkg from Xcode 16 beta installed and with the official Device Support for macOS 15 beta installed. In either cases it fails with the same error.
The upgrade also fails within a VM for both macOS Sequoia 15.0 Beta 7 and macOS Sequoia 15.1 Beta 2. After pressing Update Now in System Settings › General › Software Update the VM restarts and shows a crash report which unfortunately doesn't contain any useful info (and can't be sent since Apple ID login is only supported with a macOS 15 host...)
Anyone know how to solve this?
Hi team,
I was trying to launch Virtual machine on MacOS 14 using native framework with different Resolutions.
let graphicsConfiguration = VZMacGraphicsDeviceConfiguration()
graphicsConfiguration.displays = [
VZMacGraphicsDisplayConfiguration(widthInPixels: 2700, heightInPixels: 2200, pixelsPerInch: 100),
VZMacGraphicsDisplayConfiguration(widthInPixels: 1920, heightInPixels: 1200, pixelsPerInch: 80)
]
return graphicsConfiguration
}
But I'm getting below error:
Fatal error: 'try!' expression unexpectedly raised an 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.}
Please let me know it is possible to have multiple resolutions in single VM or not.
My use case is to get support of multiple resolutions like 1920x1080, 2048x1536, 1024x728 etc.
Thanks.
Hi Everyone,
I've created a Virtual Machine with configuration of 4 GB RAM and 7 vCPU using native framework on Sonoma hardware.
But on Sonoma Hardware I'm getting 2500MB/sec write iOPS and, on virtual machine it's around 700MB/sec. And, this is affecting the performance.
is there anyway that I can increase the write iOPS on virtual machine?
When running Linux in a VM, if I close the lid of my macbook, when I reopen it, for exemple, two hours later, the Linux VM time has "drifted" and is two hours in the past.
https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine
Microsoft solves this issue on their Hypervisor with a RTC device /dev/ptp_hyperv, and configuring chrony to use it, see https://learn.microsoft.com/en-us/azure/virtual-machines/linux/time-sync#chrony
Linux KVM do the same : https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/chap-kvm_guest_timing_management#sect-KVM_guest_timing_management-Host-guest-time-sync
It seems there is also a virtio_rtc module coming
Virtualizing macOS on macOS has AppleVirtualPlatformRTCPlugin setting time on the guest.
But how to get a Linux time in sync with
I'm working on a multi-platform app (macOS and visionOS for now). In these early stages it’s easier to target the Mac, but I started with a visionOS project. One of the things the template creates is a RealityKitContent package dependency.
I can target macOS 14.5 in Xcode, but when it goes to build the RealiityKitContent, I get this error:
error: Building for 'macosx', but '14.0' must be >= '15.0'
[macosx] info: realitytool ["/Applications/Xcode-beta.app/Contents/Developer/usr/bin/realitytool" "compile" "--platform" "macosx" "--deployment-target" "14.0" …
Unfortunately, I'm unwilling to update this machine to macOS 15, as it's too risky. Running macOS 15 in a VM is not possible (Apple Silicon).
This strikes me as a bug, or severe shortcoming, of realitytool. This was introduced with visionOS 1.0, and should be able to target macOS < 15.
It's not really reasonable to use Xcode 15, since soon enough Apple will require I build with Xcode 16 for submission to the App Store.
Is this a bug, or intentional?
I'm running a MacOS15 beta 3 VM on a MacOS15 beta 3 Host (M2 Pro Mac Mini) using the Apple Virtualization Framework (via https://github.com/s-u/macosvm).
For building my app inside the VM I need Rosetta 2, since flutter still uses some Intel binaries.
But when I want to install Rosetta 2 I'm always getting the message, that installing Rosetta 2 is not allowed on this system.
Digging in the log files I found a message from the installer, that the system is not supported.
Searching online I just find a method for using Rosetta 2 inside Linux VM's using the Virtualization Framework.
Am I missing something or is it not possible to use Rosetta 2 with MacOS guests?
Hey im trying this example:
https://developer.apple.com/documentation/virtualization/running_linux_in_a_virtual_machine
And downloaded the vmlinuz and initrd.img from here
https://download.fedoraproject.org/pub/fedora/linux/releases/40/Everything/aarch64/os/images/pxeboot
but when trying to run i get this error:
The output of: file vmlinuz
is
PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows
I tried to uncompress with gunzip but this did not work
if found this but this did not help eitehr
https://developer.apple.com/forums/thread/709539
Hello,
I want to add virtual serial ports to a macOS VM (host = Sonoma, guest = Sonoma).
Here is what I tried so far:
option 1
I create a VZVirtioConsoleDeviceConfiguration and I add a port to it, with a VZFileHandleSerialPortAttachment connected to two pipes:
let consoleDeviceConfiguration = VZVirtioConsoleDeviceConfiguration()
let guestPort = VZVirtioConsolePortConfiguration()
guestPort.isConsole = false
guestPort.name = "myserialport"
let guestToHostPipe = Pipe()
let hostToGuestPipe = Pipe()
guestPort.attachment = VZFileHandleSerialPortAttachment(
fileHandleForReading: hostToGuestPipe.fileHandleForReading,
fileHandleForWriting: guestToHostPipe.fileHandleForWriting
)
consoleDeviceConfiguration.ports[0] = guestPort
// config is my VZVirtualMachineConfiguration
config.consoleDevices = [consoleDeviceConfiguration]
Then after the VZVirtualMachine is instantiated, I get the runtime VZVirtioConsoleDevice for my device and I set my service as its delegate.
In the guest system, the device is created with the expected name (/dev/cu.myserialport)
When I open it (e.g. screen /dev/cu.myserialport 9600), the consoleDevice(_:,didOpen:) delegate method is called as expected. Then I start sending data to hostToGuestPipe.fileHandleForWriting, but I get nothing in my guest system.
option 2
Instead of using config.consoleDevices, I add a VZVirtioConsoleDeviceSerialPortConfiguration to config.serialPorts and I use the same scheme as above with a VZFileHandleSerialPortAttachment and two pipes.
It works, but:
I can't find a way to rename the devices (/dev/cu.virtio, /dev/cu.virtio1, etc)
I can't detect when the endpoint is opened/closed.
Am I missing something?
My company uses a VPN to provide access to cloud services for development purposes. I am unable to reach these services from VMs or devices using Internet Sharing. In both cases, those instances can reach the Internet just fine.
Here is what the routing table looks like for the VPN:
100.20.x.x 100.65.0.1 UGHS utun1
100.21.x.x 100.65.0.1 UGHS utun1
100.64/10 utun0 Uc utun0
100.65/16 100.65.0.1 UGSc utun1
If I add a custom pf rule, I can get the VM packets routed to the VPN:
nat from 192.168.66.0/24 to 100.65.0.0/16 -&gt; (utun1)
But, inexplicably, a similar rule for 192.168.2.0/24 does nothing. Using Wireshark, I still see packets sent out the default interface, instead of being sent through utun1.
Two questions:
Why doesn't the routing "just work" in this case? I expected that, after the NAT rules installed by the system are applied, the packets destined for 100.64.0.0/15 would be properly routed without the need for any custom rules.
What else should I try, either to gather more data or attempt to fix the routing?
I was looking through the different Core OS announcements from WWDC24 and stumbled upon documentation for USB Device support in the Virtualization Framework. However, I haven't found any mention about it or the virtualization framework from the event or otherwise.
Are there any related release notes, examples or additional material besides the API documentation for the Beta OS?
Last year I remember Apple providing a Device Support download that would allow running macOS 14 in a VM on macOS 13 without needing to install the whole Xcode beta. Is Apple planning on releasing a similar download this year to allow running a macOS 15 VM on macOS 14 without installing the Xcode beta?
Is there any official way to download IPSW files for older versions of macOS like macOS 13 for use with a VM app like Parallels or UTM?
The M2-series and M3-series of processors seem to use the same ARMv8.6-A extension, however nested virtualization is restricted to the M3-series chips. Is there an architectural reason why this is?
Has anyone tried to install macOS 15 (24A5264n) from the downloaded restore image with the sample project RunningMacOSInAVirtualMachineOnAppleSilicon on the latest macOS 14.5?
I am getting a strange error
Fatal error: A software update is required to complete the installation. Installation requires a software update.
System also shows this dialogue
But when I click install it says that the software is not currently available from the Software Update server.
I'm trying with the latest public Xcode 15.4 on an M3 Mac.
I have a virtual machine using apple's sample code on their developer page but i have no audio.
How do i create and setup an audio device for the vm?
i made a virtual machine with the help of the tutorial on the apple developer website running macos on my m2 macbook pro. I am wondering how I can integrate my mouse in the virtual machine instead of it being on top of the app.
When using the sample code included on the Running macOS in a virtual machine on Apple silicon. I am adding the following changes to the swift files:
Added to 'MacOSVirtualMachineConfigurationHelper' file:
static func createAutomountSingleDirectoryShareDeviceConfiguration() -> VZVirtioFileSystemDeviceConfiguration {
let sharedDirectory = VZSharedDirectory(url: directoryURL, readOnly: false)
let singleDirectoryShare = VZSingleDirectoryShare(directory: sharedDirectory)
// Assign the automount tag to this share. macOS shares automounted directories automatically under /Volumes in the guest.
let sharingConfiguration = VZVirtioFileSystemDeviceConfiguration(tag: VZVirtioFileSystemDeviceConfiguration.macOSGuestAutomountTag)
sharingConfiguration.share = singleDirectoryShare
return sharingConfiguration
}
Added to 'path' file:
let directoryURL = URL(fileURLWithPath: NSHomeDirectory() + "Projects")
Added to the 'AppDelegate' file:
virtualMachineConfiguration.directorySharingDevices = [MacOSVirtualMachineConfigurationHelper.createAutomountSingleDirectoryShareDeviceConfiguration()]
When the above is added and the sample app is run, the following error is shown:
macOSVirtualMachineSampleApp/AppDelegate.swift:95: Fatal error: Virtual machine failed to start with Error Domain=VZErrorDomain Code=2 "A directory sharing device configuration is invalid." UserInfo={NSLocalizedFailure=Invalid virtual machine configuration., NSLocalizedFailureReason=A directory sharing device configuration is invalid., NSUnderlyingError=0x600000c343c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
On the host device the directory that is being shared is ~/Projects and it does exist.
What do I need to change to create the shared directory and have it work?
Is there a sample code project for the same configuration that was shown in the demo?
Hello,
I have tried to create a VZVirtualMachine macOS virtual machine on an Apple Silicon Mac.
I have installed Docker Desktop inside this virtual machine.
Docker is not working: I get this error message: "Hyopervisor check failed".
Is there a way to run Docker inside a VZVirtualMachine ?
Thanks a lot