linux emulation question

William A. Mahaffey III wam at
Sat Nov 7 14:55:33 UTC 2015

I am trying to get linux emulation up & running on my newly provisioned 
FreeBSD 9.3R 'dev-box'. I downloaded & installed the basics (I think) of 
linux CentOS-6 emulation & got the following during install:

[root at devbox, /etc, 8:28:00am] 624 % pkg install -y linux-c6
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: linux-c6 has a missing dependency: linux-c6-flashplugin
The following 6 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
         linux-c6: 0.3
         linux-c6-libsndfile: 1.0.20_2
         linux-c6-flac: 1.2.1_3
         linux_base-c6: 6.6_6
         linux-c6-libogg: 1.1.4_2
         linux-c6-libvorbis: 1.2.3_2

The process will require 172 MiB more space.
21 MiB to be downloaded.
Fetching linux-c6-0.3.txz: 100%    1 KiB   1.6kB/s    00:01
Fetching linux-c6-libsndfile-1.0.20_2.txz: 100%  219 KiB 224.2kB/s    00:01
Fetching linux-c6-flac-1.2.1_3.txz: 100%  229 KiB 235.0kB/s 00:01
Fetching linux_base-c6-6.6_6.txz: 100%   21 MiB   3.2MB/s 00:07
Fetching linux-c6-libogg-1.1.4_2.txz: 100%   14 KiB  14.4kB/s 00:01
Fetching linux-c6-libvorbis-1.2.3_2.txz: 100%  131 KiB 134.3kB/s 00:01
Checking integrity... done (0 conflicting)
[1/6] Installing linux_base-c6-6.6_6...
sysctl: unknown oid 'compat.linux.osrelease'
linuxulator is not (kld)loaded, exiting
pkg: PRE-INSTALL script failed
[1/6] Extracting linux_base-c6-6.6_6: 100%

+++ Some programs may need linprocfs, please add it to /etc/fstab! +++

Running linux ldconfig...
ELF binary type "3" not known.
/compat/linux/sbin/ldconfig: Exec format error
[2/6] Installing linux-c6-libogg-1.1.4_2...
[2/6] Extracting linux-c6-libogg-1.1.4_2: 100%
ELF binary type "3" not known.
/compat/linux/sbin/ldconfig: Exec format error
pkg: POST-INSTALL script failed
[3/6] Installing linux-c6-flac-1.2.1_3...
[3/6] Extracting linux-c6-flac-1.2.1_3: 100%
ELF binary type "3" not known.
/compat/linux/sbin/ldconfig: Exec format error
pkg: POST-INSTALL script failed
[4/6] Installing linux-c6-libvorbis-1.2.3_2...
[4/6] Extracting linux-c6-libvorbis-1.2.3_2: 100%
ELF binary type "3" not known.
/compat/linux/sbin/ldconfig: Exec format error
pkg: POST-INSTALL script failed
[5/6] Installing linux-c6-libsndfile-1.0.20_2...
[5/6] Extracting linux-c6-libsndfile-1.0.20_2: 100%
ELF binary type "3" not known.
/compat/linux/sbin/ldconfig: Exec format error
pkg: POST-INSTALL script failed
[6/6] Installing linux-c6-0.3...
Message from linux_base-c6-6.6_6:
This software is based in part on the work of the FreeType Team.
See <URL:>.

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).

You should enable Linux mode with the linux_enable variable of rc.conf(5).
Depending on the version of FreeBSD you are using you may have to increase
the emulated linux version via compat.linux.osrelease=2.6.18 in
sysctl.conf(5). Check via "sysctl compat.linux.osrelease" that it shows a
lower version number before setting it.

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 

i.e. each package reported some sort of failure during install. I 
kldload'ed the relevant kernel modules & tried to initialize as per the 
linux(4) man-page:

/compat/linux/sbin/ldconfig -r /compat/linux

it crashed, so I rebooted & tried again:

[root at devbox, ~, 8:46:15am] 341 % cd /etc/
[root at devbox, /etc, 8:46:33am] 342 % kldstat
Id Refs Address            Size     Name
  1   24 0xffffffff80200000 1611688  kernel
  2    1 0xffffffff81812000 25aec8   zfs.ko
  3    2 0xffffffff81a6d000 84e8     opensolaris.ko
  4    2 0xffffffff81a76000 c19b8    linux.ko
  5    1 0xffffffff81b38000 12470    tmpfs.ko
  6    1 0xffffffff81c12000 52f2     fdescfs.ko
  7    1 0xffffffff81c18000 9fd4     linprocfs.ko
[root at devbox, /etc, 8:46:36am] 343 % /compat/linux/sbin/ldconfig -r 
FATAL: kernel too old
Segmentation fault (core dumped)
[root at devbox, /etc, 8:46:53am] 344 % uname -a
FreeBSD devbox 9.3-RELEASE-p24 FreeBSD 9.3-RELEASE-p24 #0: Sat Aug 22 
01:54:44 UTC 2015 
root at amd64
[root at devbox, /etc, 8:47:02am] 345 %

What am I doing wrong here ? Any clues appreciated. TIA & have a good one.


	William A. Mahaffey III


	"The M1 Garand is without doubt the finest implement of war
	 ever devised by man."
                            -- Gen. George S. Patton Jr.

More information about the freebsd-questions mailing list