Following the presentation from 2022 https://developer.apple.com/videos/play/wwdc2022/10002/ that show how to create a MacOs virtual machine, I was wondering if there was a way to share the clipboard between the host and the VM create?
Virtualization
RSS for tagCreate hardware-accelerated virtual machines to run macOS and Linux-based operating systems.
Posts under Virtualization tag
55 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
We are currently utilizing VZ with Lima (details: Lima VM and VZ) for our development environment. However, we're encountering a critical issue with the com.apple.Virtualization.VirtualMachine process leading to open file handle exhaustion.
When mounting our programming languages dependency cache folder (Which can have a lot of files) into the VZ VM, we encounter an operating system error related to open file limits:
/gomodcache/github.com/go-git/go-git/v5@v5.4.2/plumbing/object/patch.go:14:2: open /gomodcache/github.com/go-git/go-git/v5@v5.4.2/plumbing/format/diff/unified_encoder.go: too many open files in system
Further investigation revealed an abnormally high number of open files associated with the com.apple.Virtualization.VirtualMachine process. A significant portion of these files are not actively used but remain open.
Example Case:
A file (/Users/rcurrah/test.txt) created on the Mac host and listed (ls) in the VM remains open even 20 minutes later, as evidenced by the following command output:
❯ lsof | grep 11208 | grep test.txt
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
com.apple 11208 rcurrah 4823r REG 1,13 0 46200882 /Users/rcurrah/test.txt
Steps to Reproduce the Issue:
To reproduce the file handle exhaustion follow the below steps. This process will create a large number of files on the Mac host, listing them on the VZ VM, and then verifying their open status using lsof.
Setup the VZ Environment with Sharing:
Create a VZ VM with your home directory shared to the VM.
Create a Test Directory on the Mac Host:
Create a new directory on your Mac host, e.g., mkdir ~/test-file-exhaustion.
Generate a Large Number of Files:
Navigate to the created directory: cd ~/test-file-exhaustion.
Use a loop to create a large number of files, e.g., for i in {1..10000}; do touch "file_${i}.txt"; done. This will create 10,000 files named file_1.txt, file_2.txt, etc.
List Files in the VM:
Access the VZ VM shell.
Navigate to the mounted directory and list the files using the ls command, e.g., ls /path/to/mounted/test-file-exhaustion.
Check Open Files on Mac Host:
Exit the VM and return to your Mac host terminal.
Use the lsof command to check for open files related to the com.apple.Virtualization.VirtualMachine process: lsof | grep "$(pgrep com.apple.Virtualization.VirtualMachine)" | grep 'test-file-exhaustion' | wc -l.
Document the Output:
Record the output of the lsof command. Note the number of open files.
Verify File Closure (or Lack Thereof):
After a certain period, e.g., 20 minutes, repeat the lsof command to see if the files are still open, indicating that they haven’t been closed properly by the process.
Given these observations, we have a couple of questions:
Is this behavior of com.apple.Virtualization.VirtualMachine retaining open file handles a known issue or a bug?
Should VZ be managing the closure of these file handles more efficiently, especially when they are no longer in use?
This issue is impacting our development workflow significantly. Any guidance or insights on resolving this would be highly appreciated.
Thank you for your attention to this matter.
Best regards,
Ryan
Hi,
It seems that on M4 devices any virtual machine with macOS version older than 13.4 fail to boot, they stuck with a black screen. This is regardless of the virtualization software used (UTM, VirtualBuddy, Viable, etc...). After talking to many people everyone experiences the same.
At least for me, this is a massive limitation of the platform, I really hope this is a bug which can be fixed.
Thanks,
Csaba
I'm curious if there is a way to add a programmatically controlled keyboard and pointing device to a virtual machine created using Virtualization.framework (for the purposes of sandboxed automation). All of the types I've found in that framework have very little in the way of configurability and seem to be uniquely intended for use with a VZVirtualMachineView.
On the other hand, Hypervisor.framework seems extremely low-level so I'm wondering if there is something in between the two I can use to achieve this.
Hi, I'm new to the forum, trying to learn Swift by doing a small CLI application that helps running Linux VMs on Apples Virtualization Framework. I've posted this question almost verbatim from the forums on swift.org, and was kindly directed here.
My intention is to create VMs with ISO files, but enable output only via serial console, without a virtual graphics card. I know this might not be feasible, but it was the idea I had and I wanted to see if it is doable. So far I have managed to boot an Alpine Linux via kernel and ramdisk and the VZLinuxBootLoader. One crucial step is to provide VZLinuxBootLoader.commandLine to tell the kernel to activate output on the virtual console port, like console=hvc0. But booting an ISO with VZLinuxBootLoader is not possible if I'm not mistaken and the other option is VZEFIBootLoader, which doesn't support kernel parameters.
Now, I'd like to try and mix both boot loaders by subclassing VZLinuxBootLoader and implementing all that is required to boot an ISO file. But if I look at the implementation these two classes are relatively sparse:
@available(macOS 11.0, *)
open class VZLinuxBootLoader : VZBootLoader {
public init(kernelURL: URL)
open var kernelURL: URL
open var commandLine: String
open var initialRamdiskURL: URL?
}
and
@available(macOS 13.0, *)
open class VZEFIBootLoader : VZBootLoader {
public init()
open var variableStore: VZEFIVariableStore?
}
I've cut out comments to keep it brief.
I expected to find some implementation details for what makes these classes distinct from each other (as they both inherit VZBootLoader), hoping to be able to copy/paste a few methods here and there and try my luck passing some kernel args into the ISOs kernel.
Is something similar possible? Am I in the right spot? I'd really appreciate some feedback and maybe some pointers to the right direction. Maybe someone can also give me some details or links to documentation why the two classes contain practically no implementation code?
Thanks in advance, and have a great day.
Hello!
I am currently experiencing a problem similar to what was reported here: https://developer.apple.com/forums/thread/767673
The account information is most certainly not the problem, but I am still getting the error:
There was a failure decoding response: (HTTP 401, 60 bytes)
The data couldn't be read because it isn't in the correct format
Is the mentioned problem still not resolved? If it is not, could you please provide an estimated date for a fix?
Are there any workarounds for this issue?
Dear Support Team,
I constantly get a 401 unauthorised error, when I try to add my Developer account in Xcode while running a virutalised macOS using https://developer.apple.com/documentation/virtualization. So I can't use signing, entitlements, etc when building within a virutalised macOS.
The error shown is below:
There was a failure decoding response: (HTTP 401, 60 bytes) The data couldn’t be read because it isn’t in the correct format.
I've found probably the same issue here https://developer.apple.com/forums/thread/759877 Unfortunately, I can't find any updates.
Are you aware of this problem? Are there any planned fixes in upcoming macOS updates?
15.0 (24A335)
Version 16.1 (16B40)
Apple M1 Pro, 16 GB Ram
Best regards, Evgenii
I am using Mac Mini M2 with Sequoia 15.1 OS with Virtual Machine (Virtualization.Framework) with same OS.
(almost same as here: https://developer.apple.com/forums/thread/767673)
When adding my account in Xcode there is error with:
Decoding Error.
There was a failure decoding response: (HTTP 401, 60 bytes) The data couldn’t be read because it isn’t in the correct format.
Please fix that
I can't see information like teams and so on
I'm working with a MacMini M1 running Sequoia 15.1 OS, and I've configured a Virtual Machine on this device using the Virtualization.Framework to operate with the same OS version.
While I can sign into my account through System Settings without any problems, I encounter difficulties when trying to add my account to Xcode 16.2. Initially, the login appears to succeed, but Xcode quickly presents a "Decoding Error":
There was an issue decoding the response: (HTTP 401, 60 bytes) The data couldn’t be read because it is not in the correct format. As a result, I'm unable to access any account details or team information.
I found a similar issue but I don't think it was resolved, even if it's marked as such:
https://developer.apple.com/forums/thread/767673
Is there an existing workaround?
Hello!
I'm running MacOS 15.1.1 virtual machine on MacBook M2 Sequoia 15.1.1.
While trying to add Apple account in Xcode 16.1 and it fails with error:
Decoding Error
There was a failure decoding response: (HTTP 401, 60 bytes)
The data couldn't be read because it isn't in the correct format.
Account information is valid, it's the same account as I used to login in host system.
It seems like issue reported here:
https://developer.apple.com/forums/thread/767673
Is there any chance to fix this and get it working?
Hi,
please see detailed findings on:
https://github.com/utmapp/UTM/discussions/6799
basically apps that runned via Rosetta Linux now fail in kernels>=6.11 like the included in Ubuntu 24.10 with:
/media/rosetta/rosetta hello
assertion failed [hash_table != nullptr]: Failed to find vdso DT_HASH
(Vdso.cpp:78 get_vdso_dynamic_data)
Trace/breakpoint trap
the issue seems to be due to this commit.
https://github.com/torvalds/linux/commit/48f6430505c0b0498ee9020ce3cf9558b1caaaeb
Hello!
I am wondering about the status of Nested Hyper-V Support for VM's?
This is specifically regarding this issue with Parallels Desktop, which claims the issue is on Apple's side:
Parallels Article: https://kb.parallels.com/en/116239
Within the Article, the no longer accessible previous Apple discussion post for this issue (at least I cannot access it): https://discussions.apple.com/thread/255546412
Is this something that will be fixed and supported soon?
Thank you!
(If this should be posted somewhere else please just let me know where!)
The VM gets a NAT IP just fine, but it doesn't have access through the proxy so I'm guessing 15.x macOS setup has a bug where it can't break out of a loop trying to phone home back to macOS.
FBID: FB15689777
This is not an issue for 14.x VMs. It's also seen across different Virtualization tools.
https://feedbackassistant.apple.com/feedback/15645457
Metal passthrough on intel VMs causes com.apple.screensharing.menuextra to crash and screensharing to exit
Create a 15.1 VM with metal passthrough on 15.0.1 or 15.1 host, enable Screen Sharing, then try connecting to with VNC after restarting the machine. I'm using Anka to create the VM. You'll see VNC work (open vnc://192.168.64.3:5900), then a few seconds in show "Reconnecting...", then work, then go to "Reconnecting..." for ~5m until it eventually works consistently.
You'll see launchd showing exits/failures (see screenshots)
You'll see diagnostic reports showing things like:
Thread 0 Crashed:: Dispatch queue: com.apple.RenderBox.Encoder
0 libsystem_kernel.dylib 0x7ff801da5b52 __pthread_kill + 10
1 libsystem_pthread.dylib 0x7ff801ddff85 pthread_kill + 262
2 libsystem_c.dylib 0x7ff801d00b19 abort + 126
3 libsystem_c.dylib 0x7ff801cffddc __assert_rtn + 314
4 Metal 0x7ff80d045d72 MTLReportFailure.cold.1 + 41
5 Metal 0x7ff80d01fa2a MTLReportFailure + 513
6 Metal 0x7ff80cfb74e0 +[MTLLoader sliceIDForDevice:legacyDriverVersion:airntDriverVersion:] + 200
7 Metal 0x7ff80cf265c9 +[_MTLBinaryArchive(MTLBinaryArchiveInternal) deserializeBinaryArchiveHeader:fileData:device:] + 89
8 Metal 0x7ff80cf10f0c -[_MTLBinaryArchive loadFromURL:error:] + 537
9 Metal 0x7ff80cf10288 -[_MTLBinaryArchive initWithOptions:device:url:error:] + 844
10 RenderBox 0x7ff9041a15fd RB::(anonymous namespace)::load_library_archive(NSBundle*,
We're creating macOS VMs on both 15.x and 14.x hosts and only the 14.x created VMs can run on both 15 and 14 hosts. If we create the VMs on 15.x, something is done by Virtualization that prevents it from running on 14.x. We've tried digging in and don't see anything that our code is doing that's special.
What is Apple doing to the VMs created on 15.x hosts that's special here?