Virtualization

RSS for tag

Create hardware-accelerated virtual machines to run macOS and Linux-based operating systems.

Posts under Virtualization tag

49 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

install macOS 15 as virtual machine with Virtualisation framework
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.
5
1
1.5k
Jun ’24
Shared directories configuration not running on macOS virtual machine
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?
2
0
762
Apr ’24
Fan Speed on Fedora Asahi Remix
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
1
0
654
Mar ’24
Rosetta fail on shared memory in Sonoma 14.3
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
5
2
2.1k
Feb ’24
Build signing on Sonoma virtual runner
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 (
1
0
587
Feb ’24
Any virtual machine software on M1/arm?
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.
2
0
1.6k
Jul ’24
Any plans for Bluetooth device pass thru with Apple Virtualization Framework
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
1
0
485
Feb ’24
Camera usage inside 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?
1
1
623
Jan ’24
Configuring virtual linux devices for save/restore
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/
1
0
526
Jan ’24
Running Linux in a Virtual Machine on ARM
I am following the Running Linux in a Virtual Machine guide on MacOS 14 w/ ARM. Fedora kernel and RAM disk images were acquired for aarch64. I opened LinuxVirtualMachine.xcodeproj from the example; selecting 'LinuxVirtualMachine' under 'Targets', and navigating to 'Signing and Capabilities', I linked my Personal Team (needed to connect my Apple ID) under 'Signing->Team'. Clicking 'run' outputs the following: Usage: /Users/shea/Library/Developer/Xcode/DerivedData/LinuxVirtualMachine-baalsbzvoxxbspgicozzllxbyqmh/Build/Products/Debug/LinuxVirtualMachine <kernel-path> <initial-ramdisk-path> Program ended with exit code: 64 So I execute the following in Terminal from a directory containing the two images from Fedora: % /Users/shea/Library/Developer/Xcode/DerivedData/LinuxVirtualMachine-baalsbzvoxxbspgicozzllxbyqmh/Build/Products/Debug/LinuxVirtualMachine ./vmlinuz ./initrd.img And receive the output: Failed to start the virtual machine. Error Domain=VZErrorDomain Code=1 "The virtual machine failed to start." UserInfo={NSLocalizedFailure=Internal Virtualization error., NSLocalizedFailureReason=The virtual machine failed to start.} An old thread seems to imply this may be because the kernel image used to be compressed but is no longer? Another commenter suggests it is because vmlinuzis a gz file and to extract it, but file vmlinuzoutputs vmlinuz: PE32+ executable (EFI application) Aarch64 (stripped to external PDB), for MS Windows and gzip won't work even with the .gz extension. Did I miss a step?
1
0
777
Jan ’24
Issue with 802.1q VLAN on guests with vmnet
My environment is a router with OpenWRT, a laptop connected to the router via patch cable and an untagged VLAN with VID 5 configured on that port in the router, and a MacBook M1 Pro connected via Wi-Fi to the router. On the macbook, I created a VLAN interface by specifying en0 (AirPort) as the parent interface, then created a VM using QEMU with hvf accelerator or lima/UTM with VZ and I observe a strange situation: using arping, packets from the laptop sometimes reach the VM connected to the VLAN interface on the macbook, but arping running on the VM only sends requests but does not receive replies from the laptop. If I assign an IP address to the VLAN interface in macOS, packets are transmitted over either protocol without any problems. The problem is delivering packets to the virtual machine. With tcpdump on the laptop I can see that it reply to arp requests, I can also see on the router that replies to arp requests passed through the Wi-Fi interface, but I don't see them in tcpdump on en0 on the macbook, which is also strange. But as I wrote before, if I assign an address from the same network on the macbook's VLAN interface, any packets are delivered between the laptop and macbook. Laptop: 192.168.24.50 MacBook: 192.168.24.20 (vlan5 interface). VM: 192.168.24.10 With lima-vm I use socket_vmnet in bridge mode. With QEMU I use vmnet-bridged. ➜ ~ ifconfig vlan5 vlan5: flags=8943&lt;UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST&gt; mtu 1496 options=6063&lt;RXCSUM,TXCSUM,TSO4,TSO6,PARTIAL_CSUM,ZEROINVERT_CSUM&gt; ether f0:2f:4b:xx:xx:xx inet 192.168.24.20 netmask 0xffffff00 broadcast 192.168.24.255 vlan: 5 parent interface: en0 media: autoselect status: active ➜ ~ ping 192.168.24.50 -c2 PING 192.168.24.50 (192.168.24.50): 56 data bytes 64 bytes from 192.168.24.50: icmp_seq=0 ttl=64 time=5.241 ms 64 bytes from 192.168.24.50: icmp_seq=1 ttl=64 time=5.429 ms --- 192.168.24.50 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 5.241/5.335/5.429/0.094 ms ➜ ~ sudo arping -c 5 -i vlan5 192.168.24.50 ARPING 192.168.24.50 60 bytes from 10:e7:c6:xx:xx:xx (192.168.24.50): index=0 time=6.061 msec 60 bytes from 10:e7:c6:xx:xx:xx (192.168.24.50): index=1 time=6.084 msec 60 bytes from 10:e7:c6:xx:xx:xx (192.168.24.50): index=2 time=5.945 msec 60 bytes from 10:e7:c6:xx:xx:xx (192.168.24.50): index=3 time=3.092 msec 60 bytes from 10:e7:c6:xx:xx:xx (192.168.24.50): index=4 time=3.848 msec --- 192.168.24.50 statistics --- 5 packets transmitted, 5 packets received, 0% unanswered (0 extra) rtt min/avg/max/std-dev = 3.092/5.006/6.084/1.278 ms ➜ ~ ifconfig bridge100 bridge100: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1496 options=3&lt;RXCSUM,TXCSUM&gt; ether f2:2f:4b:xx:xx:xx Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200 root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0 ipfilter disabled flags 0x0 member: vlan5 flags=3&lt;LEARNING,DISCOVER&gt; ifmaxaddr 0 port 22 priority 0 path cost 0 member: vmenet0 flags=3&lt;LEARNING,DISCOVER&gt; ifmaxaddr 0 port 23 priority 0 path cost 0 Address cache: 10:e7:c6:xx:xx:xx Vlan1 vlan5 326 flags=0&lt;&gt; 52:55:55:ae:36:b4 Vlan1 vmenet0 1172 flags=0&lt;&gt; nd6 options=201&lt;PERFORMNUD,DAD&gt; media: autoselect status: active [root@VM1 ~]# arping 192.168.24.50 -c5 ARPING 192.168.24.50 from 192.168.24.10 lima0 Sent 5 probes (5 broadcast(s)) Received 0 response(s) [root@VM1 ~]# [root@laptop ~]# arping 192.168.24.10 -c5 ARPING 192.168.24.15 from 192.168.24.10 lima0 Unicast reply from 192.168.24.10 [52:55:55:AE:36:B4] 2.492ms Unicast reply from 192.168.24.10 [52:55:55:AE:36:B4] 1.791ms Unicast reply from 192.168.24.10 [52:55:55:AE:36:B4] 3.059ms Sent 5 probes (1 broadcast(s)) Received 3 response(s) [root@laptop ~]# What could be the reason for this behavior?
2
0
909
Dec ’23