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

61 Posts
Sort by:
Post not yet marked as solved
4 Replies
349 Views
I have an M3 MacBook Pro, running macOS Sonoma 14.1.1. A tester of our app is running Monterrey, and is experiencing something we can't reproduce, so I need to set up a Monterrey environment. I searched for information here about VMs, and found an article about using VM Frameworks and Xcode, but I am not a programmer in any way. I used to use VMware years ago to host Windows and Linux machines on my Mac, but Google searching leads me to a 2 year old post about Parallels https://www.reddit.com/r/MacOS/comments/tuxfzq/how_can_i_run_macos_monterrey_in_a_virtual/ Can I get a suggestion for how to create and use VMs on Apple Silicon to test older OSs? Thank you.
Posted
by wesplate.
Last updated
.
Post not yet marked as solved
2 Replies
573 Views
I created a macOS 14 VM using https://github.com/s-u/macosvm which uses the Virtualization Framework. I want to check if I can use paravirtualized graphics for tensorflow workloads. I followed the steps from https://developer.apple.com/metal/tensorflow-plugin/ but when I run the script from step 4. Verify, I get a segmentation fault (see below). Did anyone try to get this kind of GPU compute in a VM and succeed? /Users/teuf/venv-metal/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( 2023-11-20 07:41:11.723578: I metal_plugin/src/device/metal_device.cc:1154] Metal device set to: Apple Paravirtual device 2023-11-20 07:41:11.723620: I metal_plugin/src/device/metal_device.cc:296] systemMemory: 10.00 GB 2023-11-20 07:41:11.723626: I metal_plugin/src/device/metal_device.cc:313] maxCacheSize: 0.50 GB 2023-11-20 07:41:11.723700: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support. 2023-11-20 07:41:11.723968: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>) zsh: segmentation fault python3 ./tensorflow-test.py Thread 0 Crashed:: Dispatch queue: metal gpu stream 0 MPSCore 0x1999598f8 MPSDevice::GetMPSLibrary_DoNotUse(MPSLibraryInfo const*) + 92 1 MPSCore 0x19995c544 0x199927000 + 218436 2 MPSCore 0x19995c908 0x199927000 + 219400 3 MetalPerformanceShadersGraph 0x1fb696a58 0x1fb583000 + 1129048 4 MetalPerformanceShadersGraph 0x1fb6f0cc8 0x1fb583000 + 1498312 5 MetalPerformanceShadersGraph 0x1fb6ef2dc 0x1fb583000 + 1491676 6 MetalPerformanceShadersGraph 0x1fb717ea0 0x1fb583000 + 1658528 7 MetalPerformanceShadersGraph 0x1fb717ce4 0x1fb583000 + 1658084 8 MetalPerformanceShadersGraph 0x1fb6edaac 0x1fb583000 + 1485484 9 MetalPerformanceShadersGraph 0x1fb7a85e0 0x1fb583000 + 2250208 10 MetalPerformanceShadersGraph 0x1fb7a79f0 0x1fb583000 + 2247152 11 MetalPerformanceShadersGraph 0x1fb6602b4 0x1fb583000 + 905908 12 MetalPerformanceShadersGraph 0x1fb65f7b0 0x1fb583000 + 903088 13 libmetal_plugin.dylib 0x1156dfdcc invocation function for block in metal_plugin::runMPSGraph(MetalStream*, MPSGraph*, NSDictionary*, NSDictionary*) + 164 14 libdispatch.dylib 0x18e79b910 _dispatch_client_callout + 20 15 libdispatch.dylib 0x18e7aacc4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 16 libmetal_plugin.dylib 0x1156dfd14 metal_plugin::runMPSGraph(MetalStream*, MPSGraph*, NSDictionary*, NSDictionary*) + 108 17 libmetal_plugin.dylib 0x115606634 metal_plugin::MPSStatelessRandomUniformOp<float>::ProduceOutput(metal_plugin::OpKernelContext*, metal_plugin::Tensor*) + 876 18 libmetal_plugin.dylib 0x115607620 metal_plugin::MPSStatelessRandomOpBase::Compute(metal_plugin::OpKernelContext*) + 620 19 libmetal_plugin.dylib 0x1156061f8 void metal_plugin::ComputeOpKernel<metal_plugin::MPSStatelessRandomUniformOp<float>>(void*, TF_OpKernelContext*) + 44 20 libtensorflow_framework.2.dylib 0x10b807354 tensorflow::PluggableDevice::Compute(tensorflow::OpKernel*, tensorflow::OpKernelContext*) + 148 21 libtensorflow_framework.2.dylib 0x10b7413e0 tensorflow::(anonymous namespace)::SingleThreadedExecutorImpl::Run(tensorflow::Executor::Args const&) + 2100 22 libtensorflow_framework.2.dylib 0x10b70b820 tensorflow::FunctionLibraryRuntimeImpl::RunSync(tensorflow::FunctionLibraryRuntime::Options, unsigned long long, absl::lts_20230125::Span<tensorflow::Tensor const>, std::__1::vector<tensorflow::Tensor, std::__1::allocator<tensorflow::Tensor>>*) + 420 23 libtensorflow_framework.2.dylib 0x10b715668 tensorflow::ProcessFunctionLibraryRuntime::RunMultiDeviceSync(tensorflow::FunctionLibraryRuntime::Options const&, unsigned long long, std::__1::vector<std::__1::variant<tensorflow::Tensor, tensorflow::TensorShape>, std::__1::allocator<std::__1::variant<tensorflow::Tensor, tensorflow::TensorShape>>>*, std::__1::function<absl::lts_20230125::Status (tensorflow::ProcessFunctionLibraryRuntime::ComponentFunctionData const&, tensorflow::ProcessFunctionLibraryRuntime::InternalArgs*)>) const + 1336 24 libtensorflow_framework.2.dylib 0x10b71a8a4 tensorflow::ProcessFunctionLibraryRuntime::RunSync(tensorflow::FunctionLibraryRuntime::Options const&, unsigned long long, absl::lts_20230125::Span<tensorflow::Tensor const>, std::__1::vector<tensorflow::Tensor, std::__1::allocator<tensorflow::Tensor>>*) const + 848 25 libtensorflow_cc.2.dylib 0x2801b5008 tensorflow::KernelAndDeviceFunc::Run(tensorflow::ScopedStepContainer*, tensorflow::EagerKernelArgs const&, std::__1::vector<std::__1::variant<tensorflow::Tensor, tensorflow::TensorShape>, std::__1::allocator<std::__1::variant<tensorflow::Tensor, tensorflow::TensorShape>>>*, tsl::CancellationManager*, std::__1::optional<tensorflow::EagerFunctionParams> const&, std::__1::optional<tensorflow::ManagedStackTrace> const&, tsl::CoordinationServiceAgent*) + 572 26 libtensorflow_cc.2.dylib 0x28016613c tensorflow::EagerKernelExecute(tensorflow::EagerContext*, absl::lts_20230125::InlinedVector<tensorflow::TensorHandle*, 4ul, std::__1::allocator<tensorflow::TensorHandle*>> const&, std::__1::optional<tensorflow::EagerFunctionParams> const&, tsl::core::RefCountPtr<tensorflow::KernelAndDevice> const&, tensorflow::GraphCollector*, tsl::CancellationManager*, absl::lts_20230125::Span<tensorflow::TensorHandle*>, std::__1::optional<tensorflow::ManagedStackTrace> const&) + 452 27 libtensorflow_cc.2.dylib 0x2801708ec tensorflow::ExecuteNode::Run() + 396 28 libtensorflow_cc.2.dylib 0x2801b0118 tensorflow::EagerExecutor::SyncExecute(tensorflow::EagerNode*) + 244 29 libtensorflow_cc.2.dylib 0x280165ac8 tensorflow::(anonymous namespace)::EagerLocalExecute(tensorflow::EagerOperation*, tensorflow::TensorHandle**, int*) + 2580 30 libtensorflow_cc.2.dylib 0x2801637a8 tensorflow::DoEagerExecute(tensorflow::EagerOperation*, tensorflow::TensorHandle**, int*) + 416 31 libtensorflow_cc.2.dylib 0x2801631e8 tensorflow::EagerOperation::Execute(absl::lts_20230125::Span<tensorflow::AbstractTensorHandle*>, int*) + 132
Posted
by teuf.
Last updated
.
Post not yet marked as solved
1 Replies
348 Views
Hello, I am working with Virtualization framework in an Xcode swift project. I have also installed Parallels Desktop on my mac (Apple Silicon). I would like to convert a Parallels Desktop hard drive (hds file) to an image compatible with my Virtualization framework project. My goal is to run my Parallels Desktop virtual machine in my Xcode project. Is there a way to do that ? Thanks
Posted Last updated
.
Post not yet marked as solved
1 Replies
291 Views
Hello I have looked at Virtualization framework samples source code provided by Apple. There is something strange: For a linux guest OS, i can see a variable store: let variableStore = try VZEFIVariableStore(creatingVariableStoreAt: xxxx) ... let bootloader = VZEFIBootLoader() ... bootloader.variableStore = variableStore It seems this variable store is linked with NVRAM. For a macOS guest OS, there is no variable store. (The bootloader is created with VZMacOSBootLoader) My question is why macOS guest doesn't need variable store ? Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
307 Views
Hello, I am downloading macOS restore image with VZMacOSRestoreImage, in order to deploy virtual machines. I have just upgraded my host mac to last Sonoma version. So, macOS restore image has just been downloaded on my computer during upgrade procedure. Is there a way to avoid a second download and ask VZMacOSRestoreImage to fetch my last local macOS image ? I think this image is still stored somewhere on my computer... Thanks
Posted Last updated
.
Post not yet marked as solved
1 Replies
294 Views
For some reason when I try to archive an app, which is using saveMachineStateTo function, it fails with this error: Value of type 'VZVirtualMachine' has no member 'saveMachineStateTo' It works fine when running as debug from Xcode. Also fails if I change run destination to release. I have project set to macOS 14. What can cause this?
Posted
by DDudycz.
Last updated
.
Post not yet marked as solved
3 Replies
457 Views
Hello, I am setting up a Linux virtual machine with Virtualization framework. It works fine. Here is how i am creating a network interface: let network_device = VZVirtioNetworkDeviceConfiguration() network_device.attachment = VZNATNetworkDeviceAttachment() vm_config.networkDevices = [network_device] As you can see, this is a NAT network. I would like to know the IP address assigned to this interface. macOS emulates a DHCP server and i would like to know the IP in my Xcode program. How can i do that ? Thanks
Posted Last updated
.
Post not yet marked as solved
0 Replies
328 Views
Good day , thank you very much for the #virtualization article I have now managed to create a linux(#debian 12/bookworm) virtual machine I now have the following questions. How can i increase the size of the GUI Linus VM.bundle from 68.72G to 150G? Unable to obtain an IP V4 address to a bridge (have intall brige-utils package) - can get IP v6 address without any problem. my #bridge setup is auto br0 iface br0 inet dhcp bridge_ports enp0s1 bridge-stp on bridge-fd 0 Unable to ping the host from the virtual machine , but able to ping vms from the host - no firewalls are running, how can i enable icmp from vm to host and host to other containers. my target is to run lxd/incus containers to test few of my applications in apple silicon I am now able to run lxd/incus without any problem. however i am not able to access the application that are running in the containers, provided I am logged into the linux vm which beats the purpose of publishing the my apps, few of the services are IBM informix REST API / Nginx . My #requirement is 1, increase the size of the vm image.(#GUI Linux vm.bundle) 2. Obtain #ip address V4 for br0 3. Run #lxd / #incus containers 4. #icmp comms between host / vm / containers Please let me know if there are possibilities to achieve my requirement. Thank you
Posted Last updated
.
Post marked as solved
1 Replies
447 Views
I'm aware signing in to an Apple ID on a macOS Virtual Machine is not supported, unfortunately. But is there a way to download Xcode from within the VM? I know the developer website used to have links where you could directly download Xcode outside the Mac App Store but I can't seem to find it?
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.1k 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 tpx_ww.
Last updated
.
Post not yet marked as solved
1 Replies
342 Views
Hi, I am running GUI Linux using Apple provided reference examples.I would like to know if there is api which supports hot plug of devices and visible on my GUI Linux. I see VZDiskBlockDeviceStorageDeviceAttachment in the docs, but here we need to provide the /dev/* to get it visible in the Linux system, Would like to know the dynamic device detection capability api support if any.
Posted Last updated
.
Post not yet marked as solved
2 Replies
307 Views
Can you explain me why it is not possible to work with VZVirtualMachine on iOS ? iPad is working with the same ARM chips than mac. It would be great to create a Linux VM on an iPad pro for example... I am tossing a bottle into the sea... Thanks
Posted Last updated
.
Post not yet marked as solved
2 Replies
976 Views
Hello, I am trying to understand how macOS virtualization framework and Virtualization products work on M1 chips. I have tried Parallels Desktop. There are no third party kernel extensions (kext) installed with this product. When i plug an USB device on my mac, i get a popup asking me if i want to plug this device to my host mac or to the current Parallels virtual machine. How can this be possible without kext ? Device management is handled at kernel level... and there are no virtualization framework API for that... I have create a Linux virtual machine with Virtualization framework (similar to GNULinuxVirtualMachineSampleApp project): It works but I don't understand why i can't run Windows Virtual machines. Parallels Desktop seems to work with Virtualization framework too and this product can run ARM Windows Virtual Machine. How can they do that ? Is there a way to simulate key sending with Virtualization framework ? I have create a 64Gb disk (VZDiskImageStorageDeviceAttachment). I have a 64Gb file on my host mac, but i am using only 10Gb on the virtual machine at this moment. Is there a way to optimize the disk image file size ? VZVirtualMachine provides a "pause" method. I don't understand where the virtual machine state (RAM memory, ...) is saved on the host. Thanks a lot
Posted Last updated
.
Post not yet marked as solved
9 Replies
3.2k 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 kennyc.
Last updated
.
Post not yet marked as solved
4 Replies
465 Views
Im using VZVirtualMahcine with Linux guest system. Every once in a while, for no apparent reason, VM just freezes completely (screen just freezes at current state), and CPU usage of the process on host is using 100%. I need to force quit the app then. This happens even if guest os is just running doing nothing. Anyone else experienced this kind of behavior? It was like that on Ventura, and now also on Sonoma. Xcode 14 and 15.
Posted
by DDudycz.
Last updated
.
Post not yet marked as solved
7 Replies
3.9k 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 mark07.
Last updated
.
Post not yet marked as solved
1 Replies
442 Views
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 am using the below check for this: 1 . If running on native Apple hardware, the returned value contains the model name of the hardware: $ sysctl -n hw.model Macmini8,1 On virtualized hardware, the value may contain the hypervisor name: $ sysctl -n hw.model VMware7,0 If the command output doesn't contain the "Mac" substring, the malware considers that it is running in a virtual machine. 2. Checking USB device vendor names The commands used: ioreg -rd1 -c IOUSBHostDevice | grep "USB Vendor Name" Sample output on native Apple hardware: "USB Vendor Name" = "Apple Inc." "USB Vendor Name" = "Apple Inc." "USB Vendor Name" = "Apple, Inc." On virtualized hardware, the value may contain the hypervisor name: "USB Vendor Name" = "VirtualBox" "USB Vendor Name" = "VirtualBox" A virtual machine can be detected by checking if the command output contains a hypervisor name, for example "VirtualBox", "VMware", etc. 3 . Checking the "IOPlatformExpertDevice" registry class The command used: ioreg -rd1 -c IOPlatformExpertDevice The following fields of the IOPlatformExpertDevice class can be checked in order to detect a virtual machine: I wanted to know can a combination of these be used to identify a process running on a Cloud VM with certainity?
Posted Last updated
.
Post not yet marked as solved
1 Replies
564 Views
I installed Gentoo in virtual machine using Apple Virtualization framework. In linux then I installed avahi, configured the network in Bridge mode. Now I want to connect from this virtual machine to other computer in local network. I can see other computers on the local network, and connect with them using local IP address. But for some reason these are not detected using .local domain. I run avahi-browse -at|grep PS3 and it detected 4 entries for this computer: IPV4 _ssh._tcp local IPV6 _ssh._tcp local IPV4 _sftp-ssh._tcp local IPV6 _sftp-ssh._tcp local Also avahi-resolve -n PS3.local correctly detects IPv6 address of this machine. So why cannot I connect with the computer using PS3.local name?
Posted
by DDudycz.
Last updated
.
Post marked as solved
3 Replies
631 Views
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?
Posted Last updated
.
Post not yet marked as solved
2 Replies
402 Views
I am following example on Apple docs: GUILinuxVirtualMachineSampleApp I am able to create GUI VM first time but from second time onwards it throws error Guest did stop virtual machine. 2023-10-01 20:45:08.991551+0530 GUILinuxVirtualMachineSampleApp[6417:1426889] [client] No error handler for XPC error: Connection invalid Thought some permission error, app cannot access the VM bundle, tried giving all perms, but didn't help, also the error is not specific as to why did guest stop the VM. Please let me know what might be the cause and how to move forward. Deleting VM bundle and restarting works but that's not the solution I am looking forward too.
Posted Last updated
.