From owner-freebsd-questions@freebsd.org Sat Nov 7 14:55:33 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DACAA28E8E for ; Sat, 7 Nov 2015 14:55:33 +0000 (UTC) (envelope-from wam@hiwaay.net) Received: from fly.hiwaay.net (fly.hiwaay.net [216.180.54.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E871DF1 for ; Sat, 7 Nov 2015 14:55:33 +0000 (UTC) (envelope-from wam@hiwaay.net) Received: from kabini1.local (dynamic-216-186-213-32.knology.net [216.186.213.32] (may be forged)) (authenticated bits=0) by fly.hiwaay.net (8.13.8/8.13.8/fly) with ESMTP id tA7EtOJr017557 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 7 Nov 2015 08:55:25 -0600 To: FreeBSD Questions !!!! From: "William A. Mahaffey III" Subject: linux emulation question Message-ID: <563E10DC.2050804@hiwaay.net> Date: Sat, 7 Nov 2015 09:00:54 -0553.75 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Nov 2015 14:55:33 -0000 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@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 . 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 linux_dist port. 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@devbox, ~, 8:46:15am] 341 % cd /etc/ [root@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@devbox, /etc, 8:46:36am] 343 % /compat/linux/sbin/ldconfig -r /compat/linux FATAL: kernel too old Segmentation fault (core dumped) [root@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@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 [root@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.