# Linux Binary Compatibility fails to start



## fumanchu (Nov 28, 2022)

I hope this question is in the correct forum...

I need to run a Linux specific package under FreeBSD.  I read through the Chapter 11. Linux Binary Compatibility guide, which instructed me to simply enable linux and then run `service linux start`...

When I did this, I got these errors:


```
root@localhost:/etc/rc.d # service linux start
kldload: can't load linux: Operation not permitted
/etc/rc.d/linux: WARNING: Unable to load kernel module linux
kldload: can't load linux64: Operation not permitted
/etc/rc.d/linux: WARNING: Unable to load kernel module linux64
kldload: can't load pty: Operation not permitted
/etc/rc.d/linux: WARNING: Unable to load kernel module pty
stat: /compat/linux/proc: stat: No such file or directory
stat: /compat/linux/proc/..: stat: No such file or directory
stat: /compat/linux/proc: stat: No such file or directory
stat: /compat/linux/proc/..: stat: No such file or directory
mount: /compat: No such file or directory
stat: /compat/linux/sys: stat: No such file or directory
stat: /compat/linux/sys/..: stat: No such file or directory
stat: /compat/linux/sys: stat: No such file or directory
stat: /compat/linux/sys/..: stat: No such file or directory
mount: /compat: No such file or directory
stat: /compat/linux/dev: stat: No such file or directory
stat: /compat/linux/dev/..: stat: No such file or directory
stat: /compat/linux/dev: stat: No such file or directory
stat: /compat/linux/dev/..: stat: No such file or directory
mount: /compat: No such file or directory
stat: /compat/linux/dev/fd: stat: No such file or directory
stat: /compat/linux/dev/fd/..: stat: No such file or directory
stat: /compat/linux/dev/fd: stat: No such file or directory
stat: /compat/linux/dev/fd/..: stat: No such file or directory
mount: /compat: No such file or directory
stat: /compat/linux/dev/shm: stat: No such file or directory
stat: /compat/linux/dev/shm/..: stat: No such file or directory
stat: /compat/linux/dev/shm: stat: No such file or directory
stat: /compat/linux/dev/shm/..: stat: No such file or directory
mount: /compat: No such file or directory
root@localhost:/etc/rc.d #
```

Any ideas?
​


----------



## T-Daemon (Nov 28, 2022)

```
root@localhost:/etc/rc.d # service linux start
*kldload: can't load linux: Operation not permitted*
/etc/rc.d/linux: WARNING: Unable to load kernel module linux
*kldload: can't load linux64: Operation not permitted*
/etc/rc.d/linux: WARNING: Unable to load kernel module linux64
*kldload: can't load pty: Operation not permitted*
/etc/rc.d/linux: WARNING: Unable to load kernel module pty
```

It looks like the system has a elevated security level which doesn't permit kernel module loading.


----------



## covacat (Nov 28, 2022)

kern.securelevel ?


----------



## fumanchu (Nov 28, 2022)

Yep thanks!  My setup has 
	
	



```
kern_securelevel="3"
```

I need to do a bit of reading on securelevel...


----------



## fumanchu (Nov 29, 2022)

Okay, I must be doing something incorrect as I am still getting those errors...

I first tried to set the kern_securelevel="-1".. but that did not work.  I then commented out all reference to "kern_securelevel" in the rc.conf... no dice...

Any thoughts?


----------



## covacat (Nov 29, 2022)

what is the output of
sysctl kern.securelevel


----------



## T-Daemon (Nov 29, 2022)

fumanchu said:


> I first tried to set the kern_securelevel="-1".. but that did not work. I then commented out all reference to "kern_securelevel" in the rc.conf... no dice...


I assume you have rebooted the system after setting/unsetting the secure level in rc.conf. Are there any `kern.securelevel` setting in  /etc/sysctl.conf?


----------



## fumanchu (Nov 29, 2022)

covacat said:


> what is the output of
> sysctl kern.securelevel


I get "kern.securelevel: -1"



T-Daemon said:


> I assume you have rebooted the system after setting/unsetting the secure level in rc.conf. Are there any `kern.securelevel` setting in  /etc/sysctl.conf?


Yep, rebooted.  The /etc/sysctl.conf does not have any  `kern.securelevel`


----------



## SirDice (Nov 30, 2022)

Are you trying to do this in a jail perhaps?


----------



## fumanchu (Nov 30, 2022)

Hum, I do not believe so as I am not sure how to setup a jail...


----------



## SirDice (Nov 30, 2022)

fumanchu said:


> I do not believe so as I am not sure how to setup a jail...


Then you're probably not using a jail  The 'problem' with a jail is that you can't load kernel modules. That's why I just wanted to make sure.


----------



## fumanchu (Dec 6, 2022)

Okay, I finally figured it out.  It was because I had not previously install the linux_base-c7.7.9.2009 package.  Once I did that and configured everything, things were better...


----------

