Post

Replies

Boosts

Views

Activity

Problem with starting Gentoo Linux in Virtualization
Im playing a bit with Virtualization framework. I have problem starting Gentoo Linux on x86_64 machine. It shows EFI boot device selection screen, and after that black screen with just carriage (not blinking). Not sure how to check what is going on. I tried with different settings and devices. I think probably something is missing from Gentoo installer iso, that I need to add to the kernel? How would I learn what is missing?
1
0
879
Dec ’22
VZStorageDeviceAttachment compression
I was wondering if there is any possibility to somehow implement compression of VZStorageDeviceAttachment like VZDiskImageStorageDeviceAttachment used for the VZVirtioBlockDeviceConfiguration. I know that APFS is doing some work here, but I would also wanto to be able to store attachments on other filesystems and still keep them use only the space required. From what I searched there is no other attachment that can be used instead, but maybe there are some clever tricks that could be done to achieve this? I don't think its possible to write own implementation of VZStorageDeviceAttachment correct?
1
1
1.2k
Dec ’22
VZVirtualMachineView disable mouse capture
I would like to use VZVirtualMachineView to display grid of previews for multiple Virtual Machines. The problem is that VZVirtualMachineView always captures mouse events, and hired host cursor when it's on top of it. Is it possible to somehow disable these behaviors for VZVirtualMachineView? So that cursor of the host is not hiding and guest on this view is not receiving any mouse events?
1
1
919
Nov ’22
Rendering NSView inside another NSView
Im looking for a way to have one NSView draw inside another NSView, to make a preview of that view. To be exact Im using VZVirtualMachineView and want to have a preview only in a grid. I would just use VZVirtualMachineView but there is one issue with it - it captures mouse cursor (can hide it) and reacts to clicks and mouse movement over it. And in this case I want to have only the preview with no interaction and no cursor hiding. So I thought I might try rendering it inside another NSView using vmView.layer?.render(in: context.cgContext), or some other similar mechanism. The question is how to do this properly? And how to make it refresh with correct time? Should I use something like CADisplayLink? Do I need to add this view first somewhere or can I draw it without adding? Also I would like to not use something like creating image (unless this would be efficient method) Here is very simple first try, but Im not happy with that code, so Please suggest some approaches that I should try. class VMPreview: NSView { let vmView: VZVirtualMachineView var timer: Timer? init(virtualMachine: VZVirtualMachine) { self.vmView = .init() self.vmView.virtualMachine = virtualMachine super.init(frame: .zero) addSubview(self.vmView) dr() } func dr() { self.setNeedsDisplay(bounds) DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { self.dr() } } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override var frame: NSRect { didSet { self.vmView.frame = bounds.offsetBy(dx: 0, dy: bounds.height) } } override func draw(_ dirtyRect: NSRect) { guard let context = NSGraphicsContext.current else { return } vmView.layer?.render(in: context.cgContext) self.setNeedsDisplay(bounds) } }
0
0
770
Nov ’22
Passing @SceneStorage to new window
I have a simple WindowGroup based application. Main view have two @SceneStorage values: @SceneStorage("entriesDisplayScale") private var entriesDisplayScale = 0.5 @SceneStorage("listMode") private var listMode = false State is stored for every window correctly. Now I would want that when I create a new window, it could use either the default settings if none available; or settings of the window that was selected when I created the new one; or settings of the last window closed. What would be the best way to achieve this?
0
0
616
Nov ’22
Virtualization framework, linux environment
Im learning about Virtualization framework from Apple, and Im currently trying to create an Arch Linux environment to run on top of it. Im still a bit confused about few concepts regarding how this works, so I gathered them into 3 sections. Kernel and Initial Ram Disk (initrd) usage. From what I learned to start Virtual Machine, I need to have extracted linuz and initrdfiles, and use them to create a bootloader. This is kind of different approach from other VMsolutions, but I think I get why it is. But to make sure few questions: Since Im loading the kernel and initramdisk at this step, I can extract exact files from my linux distribution disk image, and remove them from linux /boot folder right? And going forward since this is a bootloader, I don’t really need to install Grub to run it, right? Kernel and inited capabilities and format. Until now I was only able to run a single kernel and initrd - some Ubuntu cloud 20.04images downloaded from the internet. I tried also other versions of Ubuntu, and my own Arch build, but it usually ends with either some error or sometimes virtualMachine.start()returns success but after that nothing is happening. I think I need either to compile some required features into the kernel (but have no idea which) or have these files with some specific format. I noticed that when using file command on initrd I get different information about these files. For example, the one from Ubuntu that works for me is: LZ4 compressed data (v0.1-v0.9). The other one I tried, but didn’t work was Zstandard compressed data (v0.8+), Dictionary ID: None. Does that play a role here? If so how to prepare initrd in correct format? Virtual disk format. After booting into the environment I would like to perform Arch Linux installation on separate virtual disk, and later switch to use this disk as the main one. How should I prepare .img empty file to use? From Disk utility Im only able to prepare .dmg format. Can I use some other formats as well? And later how should I partition this disk? I was planning to create GTP partition table with just a single Linux ext4 partition. On other Virtual Machine I was also creating a 1MB partition for Grub, but I think this can be skipped here. Is that correct? Do I need initrd? I think that I will need to compile my own kernel to achieve nicely working environment. And this might be the good solution for me. If that's the case do I really need initrd at all? Would it be possible to create fully prepared kernel that boots without it? If so what features do I need to use in kernel config?
1
1
2k
Oct ’22