Panduan menyiapkan emulasi Linux di FreeBSD

I - Pendahuluan

Panduan ini menunjukkan cara menyiapkan emulasi Linux di FreeBSD. Ada banyak alasan mengapa Anda ingin melakukannya:

  • Menjalankan perangkat lunak Linux sumber tertutup

  • Keamanan

  • Penelitian

  • Hanya untuk bersenang-senang / karena Anda bisa

II - Persiapan

1) Memuat modul kernel

Muat modul kernel Linux:

root@bsdbox:/root # kldload linux

III - Instalasi

1) Instal emulasi Linux dari ports

Kami memilih Fedora Core 10:

root@bsdbox:/root # cd /usr/ports/emulators/linux_base-f10/
root@bsdbox:/usr/ports/emulators/linux_base-f10 # make install clean
+++ Some programs may need linprocfs, please add it to /etc/fstab! +++

Running linux ldconfig...

This software is based in part on the work of the FreeType Team.
See <URL:http://www.freetype.org/>.

Installation of the Linux base system is finished. The Linux kernel
mode, which must be enabled for Linux binaries to run, is now
enabled. Linux mode can be enabled permanently with the linux_enable
variable of rc.conf(5).

If you want to use shared memory in Linux applications, you need to set up
a link from /dev/shm to a suitable place, e.g. by adding the following line
to /etc/devfs.conf (takes effect on each boot):
        link /tmp shm

To make use of NIS you have to adjust yp.conf and nsswitch.conf in
/compat/linux/etc/ accordingly. For example:

Set your yp-server and yp-domainname in yp.conf:
        domainname      my.yp.domainname
        ypserver        my.yp.server

Let your lists for hosts, passwd and group be resolved via nsswitch.conf:
        passwd: files nis
        shadow: files nis
        group:  files nis
        hosts:  files dns nis

WARNING: doing work which needs to chroot into the linux base may not work.
In such cases (e.g. cross-development) you are better suited with a linux_dist
port.

===>   Registering installation for linux_base-f10-10_5
root@bsdbox:/usr/ports/emulators/linux_base-f10 # 

IV - Pengujian

1) Uji emulasi

Masuk ke emulasi Linux:

root@bsdbox:/root # /compat/linux/bin/sh

Tampilkan informasi sistem:

sh # uname -a

V - Kesimpulan

Kami berhasil mengatur emulasi Linux di FreeBSD. Tolong beri tahu kami apa yang Anda sukai dan apa yang tidak. Terima kasih!