-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for FreeBSD guests ? #1508
Comments
Example: os: "FreeBSD"
images:
- location: https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.0-CURRENT/amd64/Latest/FreeBSD-14.0-CURRENT-amd64.qcow2.xz
arch: "x86_64"
- location: https://download.freebsd.org/ftp/snapshots/VM-IMAGES/14.0-CURRENT/aarch64/Latest/FreeBSD-14.0-CURRENT-arm64-aarch64.qcow2.xz
arch: "aarch64"
video:
display: "default" |
It is supposed to have support for OCI runtime: https://github.com/samuelkarp/runj There should be support, since containerd 1.5: https://samuel.karp.dev/blog/2021/05/running-freebsd-jails-with-containerd-1-5/ |
Hi! I was the original requestor on Slack. My need is to run a Puppet module acceptance tests on a FreeBSD. Lima is really attractive here because it's headless and scriptable. People are using VirtualBox (with or w/o vagrant) to do this usually. But after I got the M1-based Macbook I lost the ability to do this. In my case there is no real urgency but it'd be really nice to have. I'll try it on a coming week and will share the experience here. |
The support for linux containers (on freebsd) seems to have merged as well, in 1.7. https://productionwithscissors.run/2022/09/04/containerd-linux-on-freebsd/ |
Short list of portability issues:
And of course: s/linux/freebsd/ The LocalPorts support for guestagent can be implemented using The Not sure if But otherwise, it seems to be working:
Created the user manually, for now. $ limactl shell freebsd uname
To see the output from when your computer started, run dmesg(8). If it has
been replaced with other messages, look at /var/run/dmesg.boot.
-- Francisco Reyes <[email protected]>
FreeBSD Probably want to disable those "tips"...
|
Asked this some time ago: #1096 Also, since QEMU 8.0 there is a guest agent support for *BSD systems: |
Thanks for the reminder. I used QEMU 4 |
The support is quite rough, but nerdctl and friends (containerd and runj) are available in the default [anders@freebsd ~]$ sudo nerdctl version
WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
WARN[0000] unable to determine runc version: exec: "runc": executable file not found in $PATH
Client:
Version: v1.2.1
OS/Arch: freebsd/amd64
Git commit: <unknown>
buildctl:
Version:
Server:
containerd:
Version: 1.7.0
GitCommit: unknown
runc:
Version:
[anders@freebsd ~]$ runj --version
runj version v0.0.1-dev ()
go: go1.20.3
[anders@freebsd ~]$ sudo nerdctl info
Client:
Namespace: default
Debug Mode: false
Server:
Server Version: 1.7.0
Storage Driver: native
Logging Driver: json-file
Cgroup Driver:
Cgroup Version:
Plugins:
Log: fluentd journald json-file syslog
Storage: zfs native
Security Options:
Kernel Version: 14.0-CURRENT
Operating System: FreeBSD 14.0-CURRENT
OSType: freebsd
Architecture: amd64
CPUs: 0
Total Memory: 0B
Name: freebsd
ID: ebcf5f96-01a3-4f40-a063-e3f64163c948
You can run native (freebsd) containers, but so far I have not been able to run linux containers (issues mounting the fake |
This comment was marked as outdated.
This comment was marked as outdated.
https://www.freebsd.org/status/report-2023-01-2023-03/#_freebsd_as_a_tier_1_cloud_init_platform One could probably do a simple |
Here is an example of a freebsd container image:
|
Currently the workaround for missing cloud-init is to open a GUI console. video:
display: "default" From there, it should be possible to log in as The template is using FreeBSD 14.0-CURRENT which is the upcoming release. Telling lima that the ssh setup is complete: Instructions for adding additional users: Instructions for adding containerd packages: Instructions for setting up a ZFS disk pool: |
Similar work for Podman: |
Hi @afbjorklund, are there any updates on this? I think this would be a great way to tinker with FreeBSD. |
I don't have any further updates, but could do a rebase of the existing branch (#1509) if it helps anyone? I guess 14.0 is out now, but I don't know if runj is more mature... Or if it is going to be in containerd 2.0 https://www.freebsd.org/releases/14.0R/announce/ (2023-11-20) https://www.freebsd.org/status/report-2024-01-2024-03/cloud-init/ |
I'm pretty excited about this idea but... what do you think about adding support for netbsd as well? |
Not sure there are any official cloud images, would need to use e.g. https://bsd-cloud-image.org/ What would a NetBSD image be used for? For FreeBSD, there was the concept of testing If it is just to run a virtual machine with BSD, then you could use https://mac.getutm.app/gallery/ |
I realize there may not be an OCI-compatible runtime native/exclusive to NetBSD and that, therefore, it may fall outside the purview of this project... I am interested, however, in NetBSD's veriexec functionality as it could relate to running containerized apps. Similarly, a lock-down mechanism like securelevel. I don't know.. just a thought. |
Just found some time to try FreeBSD in lima finally. My current goal is to be able to ssh into the VM in plain mode. Tried BASIC-CLOUDINIT with UFS from here: https://download.freebsd.org/releases/VM-IMAGES/14.2-RELEASE/aarch64/Latest/. It stuck on waiting for ssh. Console shows login prompt but no input from keyboard was accepted. Though, I was able to login via serial console. Network was good, ssh port was forwarded. But user was not created. Later I found there is no cloud-init at all in this image 🤔 Will check other images later. |
Apparently FreeBSD has started to use a cloud-init replacement called It should be able to read the https://github.com/freebsd/freebsd-src/tree/main/libexec/nuageinit (using lua) Using ZFS instead of UFS, since it seems that it will be required for containers? For now, from freebsd podman testing
|
Ah, that's interesting! I should try it on the weekend! |
@jay7x : I rebased the branch (guestagent-freebsd) - updated to lima master, with FreeBSD 15 using ZFS It boots, but it looks like the custom lua parser is struggling with the cloud-config that Lima is generating... The good news is that you can probably troubleshoot that (nuageinit) without needing the whole round-trip? EDIT: Without the write_files, the user does get created. But the key is not added, since it doesn't support legacy*. * lima still uses it needs to use The file sharing works too, but the kernel module is not loaded by default. https://reviews.freebsd.org/D41844
The packages for nerdctl and friends are available in the system, [anders@lima-freebsd ~]$ sudo nerdctl version
WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
WARN[0000] unable to determine runc version: exec: "runc": executable file not found in $PATH
Client:
Version: v2.0.3
OS/Arch: freebsd/amd64
Git commit: <unknown>
buildctl:
Version:
Server:
containerd:
Version: 2.0.2
GitCommit: unknown
runc:
Version: |
Here is a reproducer: local yaml = require("yaml")
local f, err = io.open("user-data")
if err then
nuage.err("error parsing nocloud user-data: " .. err)
end
local obj = yaml.eval(f:read("*a"))
f:close()
if not obj then
nuage.err("error parsing nocloud user-data")
end For debugging https://github.com/freebsd/freebsd-src/blob/main/libexec/nuageinit/yaml.lua
Bug report, with patch: (parser still has other bugs, like skipping over The other bug is that the parser treats everything starting with This means that it will mangle the contents of write_files, even when handling indent. |
Refactored the regular Makefile, to make adding FREEBSD next to LINUX be a smaller change... Similar to adding the OS field to the regular template, even if there is only one OS on There are some other hardcoded items, like $HOME.linux for home or GNU bash for the shell.
|
Getting the boot scripts (i.e. non-plain) to work in FreeBSD will be a bit of a struggle... Currently they are all using The above configuration is only for the user login shell, not for the system scripts. Porting all the boot scripts from GNU bash to plain |
Description
There was some question in Slack, about supporting also FreeBSD guests.
I guess it would be "freema" or something, and not just "lima", but it is doable...
There are qcow2 images for all architectures, but it does involve adding OS.
I was just doing some experiments, so thought I would raise the question first.
The text was updated successfully, but these errors were encountered: