For the complete documentation index, see llms.txt. This page is also available as Markdown.

18.4 Arch Linux Compatibility Layer

The Arch Linux compatibility layer is built based on the Arch bootstrap image.

Arch Linux Compatibility Layer
Arch Linux System

The Google Chrome browser is running in the background in the screenshot, so the Arch Linux compatibility layer uses slightly more system resources than the Ubuntu compatibility layer.

Building the Base System

Building the Arch Linux compatibility layer requires handling necessary services and settings first.

Handling Required Services

Linux Service

D-Bus

The desktop environment usually has the D-Bus service already configured. If not installed, please install D-Bus first.

Set the D-Bus service to start on boot:

Start the D-Bus service:

Adjusting the Default Kernel Version of the Linux Compatibility Layer

For rolling distributions, the default kernel version of the Linux compatibility layer is usually low. If built directly, the Arch Linux compatibility layer will prompt FATAL: kernel too old during chroot. Therefore, you need to adjust the declared Linux kernel version in the Linux compatibility layer to a higher version (such as 7.0.11).

View the current kernel version of the Linux compatibility layer:

Note

You must start the linux service before you can view the current Linux kernel version.

Adjust to a newer version number:

References

  • Kernel.org. The Linux Kernel Archives[EB/OL]. [2026-03-26]. https://www.kernel.org/. Refer to this entry for the required Linux kernel version number

Mounting File Systems

You also need to mount the necessary file systems. Point the Linux compatibility layer default path to /compat/arch to enable automatic mounting of the relevant file systems.

Take effect immediately:

Permanent setting:

Restart the Linux compatibility layer service:

Installing the Bootstrap System

--strip-components=1 removes the outer path root.x86_64 when extracting the archlinux-bootstrap-x86_64.tar.zst file, extracting directly to the specified path.

Basic Configuration

Initializing the pacman Keyring

Switching Software Sources

A newly installed Arch does not have a text editor installed; you need to edit the relevant files in FreeBSD to configure Arch Linux's pacman to use the Tsinghua University mirror:

Enabling DisableSandbox

FreeBSD does not implement the landlock sandbox mechanism; you need to enable DisableSandbox for pacman, otherwise it will trigger the error error: restricting filesystem access failed because landlock is not supported by the kernel!.

Uncomment the DisableSandbox option in the pacman.conf file:

Check whether it was enabled successfully by searching for the DisableSandbox line and its line number in pacman.conf:

References

archlinuxcn Repository Configuration

Configure the Arch Linux CN repository to use the Tsinghua University mirror:

Install the Arch Linux CN repository keyring:

Tip

The step ==> Locally signing trusted keys in keyring... may take ten minutes or longer. Please be patient.

Use pacman to install the base system, development tools, text editor nano, AUR helper yay, and WenQuanYi font wqy-zenhei:

You also need to uninstall fakeroot and install fakeroot-tcp, otherwise AUR cannot be used. This defect is documented in Problem with fakeroot and qemu.

Install the fakeroot-tcp tool using pacman:

Locale Settings

Hint

Without this setting, graphical programs in Arch Linux will not be able to use Chinese input methods.

Edit the /etc/locale.gen file and remove the comment # in front of zh_CN.UTF-8 UTF-8.

Generate the system locale:

Shell Script

The script content is as follows:

References

Last updated