FreeBSD 15.1, vmnet-related fixes#156
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the networking configuration for FreeBSD guests, allowing them to use vmnet (via vmnet-helper) instead of forcing gvproxy. It removes the os_override logic that previously forced gvproxy on FreeBSD, updates the default FreeBSD image to 15.1, and updates the integration tests to explicitly request gvproxy where needed. Additionally, vmproxy is updated to configure /etc/resolv.conf and /etc/hosts on FreeBSD. Feedback on the changes suggests a safer way to append entries to /etc/hosts in vmproxy to prevent potential file corruption if the file lacks a trailing newline.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for parallel integration testing, adds a randomized subnet selection mechanism for vmnet-helper, upgrades the default FreeBSD image to 15.1, and refactors VM configuration to use memory-based overlay files instead of writing temporary files to the host. Feedback on these changes highlights a potential underflow panic in the new random network selection logic when prefix_len exceeds 32. Additionally, several instances in netutil.rs, cmd_mount.rs, and vmproxy/src/main.rs violate the repository style guide by using the ? operator without chaining .context(...) first.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
Updates anylinuxfs to default to FreeBSD 15.1 and improves vmnet/vmnet-helper behavior (including parallel-test friendliness), plus hardens the BATS integration test harness for parallel execution without global teardown conflicts.
Changes:
- Add and default-select a
freebsd-15.1image configuration; reduce ambiguity in FreeBSD image selection for tests. - Improve vmnet-related behavior on macOS (optional random CIDR selection) and adjust FreeBSD networking defaults/flows across host + guest.
- Make the BATS test suite more parallel-safe (explicit unmount targets, mount-point resolution via
status, retry-on-lock for mount/shell, optional parallel jobs runner).
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vmproxy/src/main.rs | FreeBSD guest network setup now writes resolv.conf and adds host/guest name mappings. |
| tests/test_helper/common.bash | Introduces retry-on-lock wrapper, explicit unmount semantics, mount-point discovery via anylinuxfs status, and safer teardown of attached devices. |
| tests/run-tests.sh | Adds --jobs support and logic to split serial-only vs parallel-safe BATS files; optional pre-warming of images. |
| tests/23-qcow2-image-partition.bats | Updates labels and teardown/unmount strategy for parallel safety; uses status-derived mount paths. |
| tests/22-raid.bats | Updates label and switches to explicit teardown/unmount and status-derived mount paths. |
| tests/21-mount-options.bats | Makes action name/label unique; updates teardown/unmount to avoid global cleanup and uses status-derived mount path for diskless action. |
| tests/20-subcommands.bats | Marks file as serial-only via behavior; uses do_unmount_all and records attached devices for teardown. |
| tests/18-image-partition.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths. |
| tests/17-keyfile.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths including ZFS dataset paths. |
| tests/16-freebsd-zfs-multi.bats | Updates labels, teardown/unmount behavior, and forces gvproxy for ZFS mounts; uses status-derived mount paths. |
| tests/15-multi-instance.bats | Updates labels and makes teardown/unmount explicit; uses status-derived mount paths for status assertions and I/O. |
| tests/14-multi-disk-btrfs.bats | Updates label and makes teardown/unmount explicit; uses status-derived mount paths. |
| tests/13-attach-image.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths and records attached devices. |
| tests/12-luks.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths (incl. LVM-on-LUKS). |
| tests/11-lvm.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths for LVM volumes. |
| tests/10-partitioned-disk.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths. |
| tests/07-ufs.bats | Updates label and teardown/unmount behavior; uses status-derived mount paths. |
| tests/06-zfs.bats | Updates pool name and teardown/unmount behavior; uses status-derived mount paths for ZFS dataset shares. |
| tests/05-ntfs.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths; records attached devices for remount test. |
| tests/04-f2fs.bats | Updates label and teardown/unmount behavior; uses status-derived mount paths. |
| tests/03-exfat.bats | Updates label and teardown/unmount behavior; uses status-derived mount paths. |
| tests/02-btrfs.bats | Updates label and teardown/unmount behavior; uses status-derived mount paths. |
| tests/01-ext4.bats | Updates labels and teardown/unmount behavior; uses status-derived mount paths (incl. root-owned image case). |
| GEMINI.md | Updates architecture documentation to reflect vmnet-helper option and helper-provided subnet. |
| etc/anylinuxfs.toml | Adds freebsd-15.1 image config and sets FreeBSD default image to 15.1. |
| common-utils/src/lib.rs | Removes NetHelper::os_override helper (and associated behavior). |
| anylinuxfs/src/vm.rs | Adjusts FreeBSD network defaults and disk read-only handling; switches Linux krun config injection to overlay-file approach. |
| anylinuxfs/src/vm_network/darwin.rs | Adds optional random vmnet CIDR selection controlled by ANYLINUXFS_RANDOM_VMNET_CIDR. |
| anylinuxfs/src/vm_image.rs | Forces gvproxy for FreeBSD image setup/bootstrap flows explicitly. |
| anylinuxfs/src/settings.rs | Updates unit tests to reflect removal of os_override and simplified net-helper selection logic. |
| anylinuxfs/src/netutil.rs | Adds random available-network picker for macOS vmnet pool selection and unit tests for it. |
| anylinuxfs/src/main.rs | Adjusts FreeBSD root disk read-only prefix handling and updates net-mode selection logic. |
| anylinuxfs/src/cmd_mount.rs | Propagates FreeBSD disk-prefix read-only logic; updates net-helper selection closure; changes unmount wait flag to accept optional seconds. |
| anylinuxfs/src/cli.rs | Changes unmount -w/--wait-for-vm to accept optional SECONDS and adds parsing tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.