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

18.10 Troubleshooting and Remaining Issues

This section summarizes common issues and solutions for the Linux compatibility layer.

Sound in the Linux Compatibility Layer

If there is no sound output inside the Linux compatibility layer entered via chroot, you usually need to run the Linux program directly in FreeBSD rather than using chroot.

Ubuntu compatibility layer:

Edit the /compat/ubuntu/etc/asound.conf file and write the following two lines. Please note the distinction between the English exclamation mark ! and the number 1.

pcm.!sysdefault pcm.plug:oss
pcm.!default pcm.sysdefault

Running Software from the FreeBSD Command Line (Based on Ubuntu Compatibility Layer)

A method to run software directly from the FreeBSD command line without chroot:

Method 1

# sysctl compat.linux.emul_path=/compat/ubuntu # Takes effect immediately
# echo compat.linux.emul_path=/compat/ubuntu >> /etc/sysctl.conf # Persistent

Method 2

Warning

This operation will move and replace ld-linux-x86-64.so.2, which may cause the Ubuntu compatibility layer to fail to start or run properly. Before executing, please ensure that you have backed up the relevant files and fully understand the impact of this operation. This operation is irreversible; please proceed with caution.

# mv /compat/ubuntu/lib64/ld-linux-x86-64.so.2  /compat/ubuntu/lib64/ld-linux-x86-64.so.2.back
# ln -s /compat/ubuntu/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /compat/ubuntu/lib64/ld-linux-x86-64.so.2

Without chroot, you can run Linux programs directly in the terminal (only some programs), but you must specify the absolute path.

Arch and openSUSE compatibility layers only require Method 1; Method 2 is not needed.

References

Running QQ with Regular User Privileges

There is a UID mapping relationship between compatibility layer users and FreeBSD users.

Assuming the regular username on FreeBSD is ykla with UID 1001 (normally the default is 1001):

Warning

After creating the user ykla in Arch, this user cannot be used to install software with yay; you still need to use the test user created by default in the Shell script.

Launching Programs from Icons

  • Edit the QQ.desktop file and write the following content (using the Ubuntu compatibility layer as an example):

  • Edit the Chrome.desktop file and write the following content (using the Ubuntu compatibility layer as an example):

After granting executable permissions to the above files, they will display as normal icon styles and can be clicked to launch the corresponding software.

Running Chrome (Using Ubuntu Compatibility Layer as an Example)

Download Chrome:

Install Chrome:

Launch Chrome:

Linux Compatibility Layer Networking (Linux QQ Has No Network)

When the machine has both an Ethernet card em0 and a wireless card wlan0, but only wlan0 is actually in use, the Linux compatibility layer may not be able to connect to the network properly. FreeBSD's em0 corresponds to the compatibility layer's eth0, wlan0 corresponds to eth1, and so on. The Linux compatibility layer cannot automatically detect which interface has network access and defaults to using eth0.

When using wlan0 instead of em0, you need to assign an unused IP to em0:

  • Temporary setting (lost on reboot): # ifconfig em0 192.168.11.1

  • Permanent setting: add the following to the FreeBSD /etc/rc.conf file (this does not affect the normal operation of this network card):

The above 192.168.11.1 is an unused IP; you can set it to any other value.

Chinese Input Method

Place the .profile file from the /home path into the / directory of the compatibility layer:

If you encounter an error like "sh: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)", you should install the missing language packs and re-enter the compatibility layer after exiting. For other systems, you can search for similar packages; for example, for the Rocky Linux compatibility layer, you should install glibc-locale-source and glibc-langpack-zh.

sysctl Variables

This can list commonly used variables.

403 Forbidden Prompt When Downloading Software Using Command Line

Some domestic mirror sites may, for reasons such as traffic restrictions, only allow software packages to be obtained through the specified package manager. When using other methods to fetch packages, a "403 Forbidden" error will be displayed.

This is typically implemented by restricting the package manager's UA (User-Agent). In this case, the simplest method is to switch to an unrestricted mirror site, such as TUNA/USTC Mirror.

systemd and Wine

systemd is not available, but the service xxx start command can be used as a replacement.

Additionally, attempts were made to use the https://github.com/zq1997/deepin-wine repository to install software such as deepin-qq and deepin-wechat, but all resulted in "segmentation fault" errors. All Wine programs fail to run properly. If readers can solve this problem, please submit an issue or PR.

Last updated