FreeBSD is a Unix-like operating system that features advanced networking and high performance, security, and compatibility. This topic describes the compatibility of various versions of the FreeBSD operating system with Alibaba Cloud platforms. This topic also describes how to upgrade FreeBSD across major releases.
Support for the setting or changing of passwords or key pairs in the Elastic Compute Service (ECS) console by different versions of FreeBSD
Version | Image ID | Setting of passwords during instance creation | Setting of key pairs during instance creation | Changing of passwords in the ECS console | Changing of key pairs in the ECS console | |
FreeBSD 13.0 | freebsd_13_0_x86_30G_alibase_20220324.vhd | Not supported | Supported | Not supported | Not supported | |
FreeBSD 12.3 | freebsd_12_3_x64_30G_alibase_20220331.vhd | Not supported | Supported | Not supported | Not supported | |
FreeBSD 12.1 | freebsd_12_1_x64_30G_alibase_20201022.vhd | Not supported | Supported | Not supported | Not supported | |
FreeBSD 11.4 | freebsd_11_4_x64_30G_alibase_20210319.vhd | Supported | Supported | Supported | Supported | |
FreeBSD 11.3 | freebsd_11_3_x64_30G_alibase_20200803.vhd | Supported | Supported | Supported | Supported | |
FreeBSD 11.2 | freebsd_11_02_64_30G_alibase_20190806.vhd | Supported | Supported | Supported | Supported |
The following section provides examples on support for the setting or changing of passwords or key pairs in the ECS console by different versions of FreeBSD.
FreeBSD 11.4
This version supports the setting of passwords or key pairs during instance creation.
This version supports the changing of passwords after instance creation.
FreeBSD 13.0
This version supports the setting of key pairs during instance creation. You cannot set a password when you create an instance that runs this FreeBSD version.
This version does not support the changing of key pairs after instance creation.
FreeBSD 11 and 12
If you want to run FreeBSD 11 or 12 on a fifth-generation or later ECS instance, you must install the required kernel patches in the operating system. Otherwise, the system disk cannot be found and the system cannot start as expected. The required kernel patches are installed in Alibaba Cloud FreeBSD public images to meet the startup requirements of fifth-generation or later instance families. You can call the DescribeInstanceTypeFamilies operation and configure the Generation
parameter to query fifth-generation or later instance families.
You can use FreeBSD kernel source code to install kernel patches and compile the kernel to resolve and prevent instance startup failures in the following scenarios:
If you use a FreeBSD image that is not provided by Alibaba Cloud or a custom image that is derived from the FreeBSD image to create an instance of a fifth-generation or later instance family, the instance may fail to start.
If you use a FreeBSD public image to create an instance of a fifth-generation or later instance family and use the freebsd-update command to update the kernel with new patches, the instance may fail to start.
NoteYou can use the freebsd-update command to update the kernel version to a kernel version of FreeBSD 13. For more information, see the "Upgrade FreeBSD across major releases" section of this topic.
The following example shows how to install patches and compile kernels on FreeBSD by compiling the source code of FreeBSD 12.4:
Download and decompress the FreeBSD kernel source code package.
wget https://mirrors.aliyun.com/freebsd/releases/amd64/12.4-RELEASE/src.txz -O /src.txz cd / tar -zxvf /src.txz
Download patches.
In this example,
0001-virtio.patch
for the virtio driver is downloaded.cd /usr/src/sys/dev/virtio/ wget https://ecs-image-tools.oss-cn-hangzhou.aliyuncs.com/0001-virtio.patch patch -p4 < 0001-virtio.patch
Copy the kernel files and compile and install the kernel.
N in the
make -j<N>
command specifies the number of jobs that run in parallel. Specify N based on your compiling environment. For example, for a single-vCPU environment, we recommend that you set -j<N> to-j2
.The ratio of the number of vCPUs to the value of N is1:2
.cd /usr/src/ cp ./sys/amd64/conf/GENERIC . make -j2 buildworld KERNCONF=GENERIC make -j2 buildkernel KERNCONF=GENERIC make -j2 installkernel KERNCONF=GENERIC
Delete the source code after you compile the kernel.
rm -rf /usr/src/* rm -rf /usr/src/.*
FreeBSD 13
You do not need to install kernel patches on FreeBSD 13 or later. FreeBSD 13 includes the following kernel patches that are required by fifth-generation or later ECS instances:
Before FreeBSD 13 can run as expected, you must run the following command to add the kern.maxphys
kernel parameter and set the parameter to 65536:
echo "kern.maxphys=65536" >>/boot/loader.conf
The kernel version of FreeBSD 13 that is provided by Alibaba Cloud is 13.0-Release-p8
, which is a ready-to-use version that includes more than two patches and is configured with the required kernel parameters.
Upgrade FreeBSD across major releases
This section describes how to upgrade FreeBSD across major releases. In this example, FreeBSD is upgraded from 12.3 to 13.1.
Run the following internal upgrade command:
freebsd-update upgrade -r 13.1-RELEASE
Expected output:
Run the following installation command as prompted:
/usr/sbin/freebsd-update install
Expected output:
Run the following command to configure the loader.conf file:
echo "kern.maxphys=65536" >>/boot/loader.conf
Run the following command to restart the instance:
WarningThe restart operation stops the instance for a short period of time and may interrupt services that are running on the instance. We recommend that you restart the instance during off-peak hours.
reboot
Run the following command to check the FreeBSD version:
uname -r
If the following information is returned, FreeBSD is upgraded to 13.1.
References
For more information about FreeBSD, see About FreeBSD.