TIL: macOS Serial Console Login

When using Virtualization.framework to virtualize macOS VMs, I occasionally have no use for the GUI, and even get frustrated at the slowness (especially when scrolling in Terminal.app). Since Virtualization.framework supports adding a VirtIO serial device, I decided to try doing that, but when I booted the VM, nothing showed up. After some searching, I found that I needed to modify /etc/gettytab and add a file to LaunchDaemons to start a getty on the serial console from this answer....

TIL: Programmatic Sparse Copying for APFS

If you’ve been using and/or developing on macOS for some time, it’s possible that you’ve heard that macOS uses the Apple File System (APFS). You’ve possibly also heard of its numerous benefits over traditional filesystems, such as copy on write, cloning (where unchanged blocks can be shared between multiple files), and, the topic of this post, sparse files. Sparse files are files with blank sections, and are used for virtual machines with Apple’s Virtualization....

TIL: SSH Remote Port Forwarding for Virtual Machines

When using virt-manager to create virtual machines, by default it uses a NAT network which can’t be accessed from outside the host machine. It is possible to use bridge interfaces for that, but it seems that bridging is not supported on wlan0 on my Thinkpad. I decided to try and use SSH Port Forwarding to make a server running on the VM be accessible from the host’s IP address. At first, I tried local port forwarding from the host, but that only allowed the server to be accessible from the host’s localhost....