jails Confusion about what FreeBSD version the jail managed by iocage really is at

Hi,

I run FreeBSD 14.0 on the host and have been running iocage for many years. Current installed version of iocage is 1.2.

The jail is running version 13.1 according to iocage:
Code:
root@host:~ # iocage get release webserver-01
13.1-RELEASE

But if I login to the jail:
Code:
root@host:~ # iocage console webserver-01
Last login: Tue Jan  7 15:23:30 on pts/5
FreeBSD 14.0-RELEASE-p3 #0: Mon Dec 11 04:56:01 UTC 2023     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd to change this login announcement.
root@webserver-01:~ #

Now I am confused -- which version is the jail webserver-01 really running?

Thanks in advance!
 
Login on the jail and run freebsd-version -u, that will give you the version of the userland. That said, the MOTD should get updated with the version it is running, and that says it's 14.0-RELEASE. If both freebsd-version -u and MOTD says it's 14.0-RELEASE then that's the version.

Don't use iocage but it might have the same "problem" as bastille. With bastille you create a "bootstrap" jail with a certain version, 14.0-RELEASE for example. When you upgrade that release image ( bastille upgrade 14.0-RELEASE 14.1-RELEASE) it will be upgraded to 14.1-RELEASE, but the image is still named 14.0-RELEASE. Which is super confusing. So I never do a version upgrade of those images, I just bootstrap a new image with the new version and change the "base" jail mountpoint to point to the new release image.
 

root@webserver-01:~ # freebsd-version -u
13.1-RELEASE


Maybe it is actually my own mistake as I some year ago started an upgrade of the jail via iocage upgrade function but was running it remotely over ssh and connection got interrupted.
 
Some things have changed with regards to the MOTD, it now gets generated from a template. Maybe you have a "fixed" /etc/motd that has the 14.0-RELEASE line stuck in it and set update_motd="NO" in rc.conf?

but was running it remotely over ssh and connection got interrupted.
I highly recommend using sysutils/screen or sysutils/tmux when doing this remotely. If you do the upgrade in a screen/tmux session you can simply pick it back up after you reconnect. It also won't break off the process, it'll continue running, when the connection is interrupted.
 
Back
Top