Fedora SelfβHosted Server
Manage from Mac
π Previously on Mac2net β I installed packages on Fedora with a script
There is still a ways to go before we are ready to break out the big bucks for a MiniPC. We can go a long way to understanding how Fedora server works by fiddling with it on a Mac-based VM.
Fedora and Cockpit are aggressively upgraded and updated. Fedora has a new release every six months and Cockpit every two weeks or so.
Much has changed even over the last 18-24 months since I started researching for Mac2net. Setting up Lima VM networking on the Mac has changed a lot with new features and a bit of push βοΈ pull. With Cockpit, we can get around some of the limitations of Lima and open up the VM enough to provide the option of managing a real self-hosted MiniPC with actual production services.
The Lima people have provided a Mermaid flowchart network help you choose the best configuration for the Fedora VM.
<p style='text-align: center;'>https://github.com/mermaid-js/mermaid</p>For initial purposes, the localhost and host options will suffice. The other two options will help someone interested in prototyping several VMs working together in a sort of cluster.
localhost is how the sample YAML was setup and works great for a VM running on your personal machine. I recommend this option for that situation and it can always be upgraded later on.host option requires a bit more configuration with an additional Brew package socket_vmnet that was installed in Add packages with Brew . This config will accept an internal IP address from your networkβs DHCP server allowing access to the VM on a remote machine with VNC, Cockpit or other network services.flowchart
connect_to_vm_via{"Connect to the VM via"} -- "localhost" --> default["Default"]
connect_to_vm_via -- "IP" --> connect_from{"Connect to the VM IP from"}
connect_from -- "Host" --> vm{"VM type"}
vm -- "vz" --> vzNAT["vzNAT (see the VMNet page)"]
vm -- "qemu" --> shared["socket_vmnet (shared)"]
connect_from -- "Other VMs" --> userV2["user-v2"]
connect_from -- "Other hosts" --> bridged["socket_vmnet (bridged)"]socket_vmnetThere is a lot of brouhaha about socket_vmnet and security to the point that there is seemingly conflicting guidance within the Lima project and also with Brew. socket_vmnet is developed by the Lima people and yet there is a discrepancy between the documentation for Lima and for socket_vmnet and also regarding using brew.sh to manage the package or install it directly from Github. What to do?
Actually, I had stopped using the Brew package because the connection between Lima and socket_vmnet was hardcoded by the socket_vmnet version number which meant the configuration broke every time the latter was upgraded. But, alas, this is no longer true and now it is installed in the same place by Brew as it would be if installed directly. So, IMO, it is better to use Brew so it can manage upgrades while if you install it yourself this is more complicated.
# Install socket_vm to run Lima in brdige mode (DHCP address asigned by the router)
$ brew install socket_vmnet
==> socket_vmnet: stable 1.2.1 (bottled), HEAD [keg-only]
Daemon to provide vmnet.framework support for rootless QEMU - https://github.com/lima-vm/socket_vmnet
Installed
/opt/homebrew/Cellar/socket_vmnet/1.2.1 (15 files, 146.7KB)
Poured from bottle using the formulae.brew.sh API on 2025-03-14 at 18:03:12
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/s/socket_vmnet.rb
License: Apache-2.0
==> Requirements
Required: macOS β
==> Options
--HEAD
Install HEAD version
==> Caveats
socket_vmnet requires root privileges so you will need to run
`sudo /opt/homebrew/opt/socket_vmnet/socket_vmnet` or `sudo brew services start socket_vmnet`.
You should be certain that you trust any software you grant root privileges.
socket_vmnet is keg-only, which means it was not symlinked into /opt/homebrew,
because it should not be in Homebrew's bin directory, which is often writable by a non-admin user.
If you need to have socket_vmnet first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/socket_vmnet/bin:$PATH"' >> ~/.zshrc
To start socket_vmnet now and restart at startup:
sudo brew services start socket_vmnet
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /opt/homebrew/var/run/socket_vmnet
==> Downloading https://formulae.brew.sh/api/formula/socket_vmnet.json
==> Analytics
install: 187 (30 days), 532 (90 days), 4,130 (365 days)
install-on-request: 187 (30 days), 532 (90 days), 4,126 (365 days)
build-error: 0 (30 days)Now enter the following commands and that should enable a VM to acquire a proper IP address for your internal network from the DHCP server and allow most services to be reachable with it.
$ echo 'export PATH="/opt/homebrew/opt/socket_vmnet/bin:$PATH"' >> ~/.zshrc
$ sudo brew services start socket_vmnet