Run Linux software on the Linux Simulation layer under FreeBSD
From: http://www.linuxdiyf.com/viewarticle.php? Id = 83929
I agree with the BSD Protocol and FreeBSD's responsible development team model, so that I like FB. Of course, OpenBSD is also good. However, for performance and Chinese support, FB is more suitable for desktop.
But an indisputable fact is that with the support of many commercial companies, the current situation of Linux applications is much more optimistic than that of FreeBSD. Maintaining software on a niche operating system is not commercially worthwhile. Therefore, such as realplay and shareread, there is no direct support from FB. Of course, for open-source software, with the omnipotent ports system and diligentProgramThere is no big difference between Linux users and Fb users.
To make FreeBSD users better use the system, FB adds a Linux Simulation layer to the kernel. Note: This is not a traditional simulator. It only provides a Linux program interface so that you can set it in FB, you can use some Linux programs that are not very closely related to the kernel (too close, such as virtual machines, it won't work)
Okay. To enable FB support for Linux, run the following command:
# Kldload Linux. Ko
To load Linux modules. Note that this requires the root permission. Modify/etc/rc. conf and add
Linux_enable = "yes"
One line (recommended), or modify the/boot/loader. conf file to add this line:
Linux_load = "yes"
However, to really execute Linux programs, you need to configure the corresponding libraries for these programs. By default, FB uses the simulation support of Fedora Core 4. Therefore, we use the ports system to install this environment:
# Cd/usr/ports/emulators/linux_base-fc4 & make install clean
Of course, if you directly install the software in ports, for example, because my favorite opera currently does not support the FB amd64 version, so I have to choose Linux, then I will
# Cd/usr/ports/www/Linux-opera & make install clean
This will automatically install the linux_base-fc4 Based on the dependency.
Well, Linux is developing fast, and the application software on Linux is also developing fast. For example, many software systems require at least Kernel support of Linux 2.6 or later versions. The default FB simulation layer is 2.4.2. Therefore, we need to configure this simulation layer to allow FB to support the simulation of Linux 2.6 and later kernel versions, first, make sure that your FB version must be later than 7.0. The 6 series does not support it.
# Sysctl compat. Linux. osrelease = 2.6.16 # (simulate Linux kernel 2.6.16)
Modify the/etc/make. conf file and add:
Override_linux_base_port = fc6
Modify the/etc/sysctl. conf file and add:
Compat. Linux. osrelease = 2.6.16
So that the simulated Linux kernel version can be automatically set at next boot.
Of course, this is also necessary, and the Environment Supporting the Linux 2.6 kernel:
# Cd/usr/ports/emulators/linux_base-fc6 & make install clean
All right, no matter which kernel version is used, the Linux environment has been set up. To use the Linux program correctly, you need to simulate a Linux Process file, modify the/etc/fstab file, and add:
Linproc/compat/Linux/proc linprocfs RW 0 0
Make/etc/fstab effective:
# Mount-
Now, you can try Linux programs, realplay, Thunderbird, and Firefox (because some extensions and plug-ins only support Linux versions, such as CHM reading)
FB also supports direct RPM installation. However, you must be sure of the dependency. If you can rely on the ports system, use ports whenever possible.