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
60 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?
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 -> (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
We have developing an app that uses Linux VM virtualization and com.apple.security.virtualization entitlement.
Question: do we need any approval from Apple to release this app that uses com.apple.security.virtualization entitlement?
Hi there,
I have got a question but I don't know if this is the right place. I am using an M1 Mac mini and have installed Fedora Asahi Remix for certain developing Tasks next to MacOS. How is the fan speed controlled? Does Fedora turn on the fan when the CPU gets warm or does the hardware firmware set the fan speed?
Thank you for your answers!
Laurin
I use UTM.app for virtualisation.
I have full virtualise "Fedora 38-aarch64" in UTM.app with rosetta enabled.
After upgrading Sonoma to 14.3 it stop properly virtualised shared memory.
I have this test file:
#include <stdio.h>
#include <sys/shm.h>
#include <sys/stat.h>
int main ()
{
int segment_id;
char* shared_memory;
struct shmid_ds shmbuffer;
int segment_size;
const int shared_segment_size = 0x6400;
/* Allocate a shared memory segment. */
segment_id = shmget (IPC_PRIVATE, shared_segment_size,
IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR);
/* Attach the shared memory segment. */
shared_memory = (char*) shmat (segment_id, 0, 0);
printf ("shared memory attached at address %p\n", shared_memory);
/* Determine the segment's size. */
shmctl (segment_id, IPC_STAT, &shmbuffer);
segment_size = shmbuffer.shm_segsz;
printf ("segment size: %d\n", segment_size);
/* Write a string to the shared memory segment. */
sprintf (shared_memory, "Hello, world.");
/* Detach the shared memory segment. */
shmdt (shared_memory);
/* Reattach the shared memory segment, at a different address. */
shared_memory = (char*) shmat (segment_id, (void*) 0x5000000, 0);
printf ("shared memory reattached at address %p\n", shared_memory);
/* Print out the string from shared memory. */
printf ("%s\n", shared_memory);
/* Detach the shared memory segment. */
shmdt (shared_memory);
/* Deallocate the shared memory segment. */
shmctl (segment_id, IPC_RMID, 0);
return 0;
}
Command to compile it is
gcc -Wall a.c && ./a.out
When I compile it in virtualised Fedora work properly show this:
shared memory attached address
segment size:
shared memory reattached address
Hello, world.
When I compile directly on M1 mac id it die
shared memory attached address
segment size:
shared memory reattached address
Segmentation fault:
I'm try it also in docker x86 in virtualised fedora and also show error
In "Fedora 38-aarch64 virtualised" run x86 docker "docker run -it --platform linux/amd64 oraclelinux:7.9 bash"
Install gcc in docker shell "yum install -y gcc"
After compile and run it die with
shared memory attached address
segment size:
shared memory reattached address
Hello, world.
assertion failed [rem_idx != ]: Unable find existing allocation shared memory segment to unmap
(VMAllocationTracker.cpp remove_shared_mem)
Trace/breakpoint (core dumped)
How can I fix it?
On previous version of Sonoma works properly.
Thank you
I am running on Sonoma 14.X and I need to download and install VM of older OS (Ventura).
Whatever the value I change in deployment target it downloads VM of Sonoma OS. I am from QA and need older OS to test app compatibility.
https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon_macs
I've tried to implement the steps suggested for configuring code signing https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development on runners
However, I could not sign my app build when I was using Virtual Runner.
Is it a limitation coming from the Apple virtualization framework restriction (for signing in with Apple ID), or did I miss some configuration for Xcode?
I was trying both manual and automatic signing but never succeeded (
I used to run VirtualBox on macOS to run Windows guests for some reasons.
Recently I bought a new Mac mini M1, now I have a problem - VB does not have a stable release for arm (yet).
What other options do I have?
BTW, I came across this doc article (https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon). I read thru it, but could not conclude if it offers the same functionalities as a full-blown VM suite; and more specifically I want to run Windows guests.
With Apple Virtualization Framework, we can create virtual machines and run macOS and Linux-based operating systems and pass thru USB devices like mice and keyboards. Are there any plans to be able to pass thru bluetooth or bluetooth devices to the Virtual Machine so that the VM OS could connect to bluetooth devices?
Related docs: https://developer.apple.com/documentation/virtualization
I'm trying to use the host camera from inside a virtual machine created using the Virtualization framework in Swift. I can't seem to figure out how to achieve this though, and unlike audio devices, keyboards, displays etc there doesn't seem to be a corresponding class and docs page for cameras or generic usb devices.
Is there any way to connect a built in Apple camera to a mac virtual machine created with the Virtualization framework?
When I call either of
VZVirtualMachineConfiguration.validateSaveRestoreSupport(..)
VZVirtualMachine.saveMachineStateTo(URL)
I get the error:
NSLocalizedFailure=Invalid virtual machine configuration.
NSLocalizedFailureReason=Unsupported graphics device in configuration
For Linux there seems to be only vanilla size configuration (at least 1 scanout is required):
let graphicsDevice = VZVirtioGraphicsDeviceConfiguration()
graphicsDevice.scanouts = [
VZVirtioGraphicsScanoutConfiguration(widthInPixels: 1920, heightInPixels: 1080)
]
I've tried valid sizes and aspect ratios.
I've otherwise removed console and audio devices provoking similar errors, but I can't find an acceptable graphics configuration.
I believe it should work because my code is substantially similar to the open-source tart application that supports suspend.
I'm running Sonoma 14.2.1 on an M1 Studio with an HP24mh external monitor via a third-party HDMI/USB-C adapter.
I see nothing in the Console (except some ...wakeups_resource.diag common to other applications).
So I'm looking for help with
How to get more information for this failure
How to configure suspendable/resumable devices: graphics for sure, but also console, audio, keyboard, etc.
Thanks!
GUI Linux guest: https://developer.apple.com/documentation/virtualization/running_gui_linux_in_a_virtual_machine_on_a_mac
macos guest: https://developer.apple.com/documentation/virtualization/running_macos_in_a_virtual_machine_on_apple_silicon
wwdc-2022: https://developer.apple.com/videos/play/wwdc2022/10002/
wwdc-2023: https://developer.apple.com/videos/play/wwdc2023/10007/