How to install golang in jails?

3038922

Dabbler
Joined
Apr 23, 2020
Messages
27
I want to install go development environment in jails.
But there are many problems.
```
⚡ root@aria2  ~  go version
go version go1.14.2 linux/amd64
```
hello world
```
⚡ root@aria2  ~  go build hello.go
ELF binary type "0" not known.
go tool compile: fork/exec /usr/local/go/pkg/tool/linux_amd64/compile: exec format error
ELF binary type "0" not known.
```
I found on the Internet that it may be effective to execute this command, but the prompt is wrong
```
⚡ root@aria2  ~  kldload linux64
kldload: can't load linux64: Operation not permitted
```
```
⚡ root@aria2  ~  kldstat
Id Refs Address Size Name
1 88 0xffffffff80200000 2567158 kernel
2 1 0xffffffff82769000 100ee8 ispfw.ko
3 1 0xffffffff8286a000 fa60 ipmi.ko
4 2 0xffffffff8287a000 2d70 smbus.ko
5 1 0xffffffff8287d000 32cc8 if_bnxt.ko
6 1 0xffffffff828b0000 2243e8 if_qlxgbe.ko
7 1 0xffffffff82ad5000 f1440 ocs_fc.ko
8 1 0xffffffff82bc7000 22150 smartpqi.ko
9 1 0xffffffff82bea000 8a40 freenas_sysctl.ko
10 1 0xffffffff82e19000 330048 vmm.ko
11 1 0xffffffff8314a000 a84 nmdm.ko
12 1 0xffffffff8314b000 2ec dtraceall.ko
13 9 0xffffffff8314c000 39a78 dtrace.ko
14 1 0xffffffff83186000 5c0 dtmalloc.ko
15 1 0xffffffff83187000 1898 dtnfscl.ko
16 1 0xffffffff83189000 1d61 fbt.ko
17 1 0xffffffff8318b000 53240 fasttrap.ko
18 1 0xffffffff831df000 bcc sdt.ko
19 1 0xffffffff831e0000 6af0 systrace.ko
20 1 0xffffffff831e7000 6ac8 systrace_freebsd32.ko
21 1 0xffffffff831ee000 f9c profile.ko
22 1 0xffffffff831ef000 39f4 geom_multipath.ko
23 1 0xffffffff831f3000 14320 hwpmc.ko
24 1 0xffffffff83208000 7140 t3_tom.ko
25 2 0xffffffff83210000 aa8 toecore.ko
26 1 0xffffffff83211000 f8d0 t4_tom.ko
27 1 0xffffffff83221000 2420 ums.ko
28 1 0xffffffff83224000 1780 uhid.ko
29 1 0xffffffff83226000 33f80 linux64.ko
30 1 0xffffffff8325a000 2fb8 linux_common.ko
```
 

Linkman

Patron
Joined
Feb 19, 2015
Messages
219
How did you install? That version line looks like a Linux version was installed?
Version should be something like
$ go version
go version go1.14.2 freebsd/amd64
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,457
If you need to load the Linux compatibility (or any other) kernel module, that needs to be done in FreeNAS itself, not in the jail. But I'm with Linkman in wondering how and why you're apparently running a Linux version of Go on your FreeNAS box--inside a jail, pkg install go installs it, and results in this:
Code:
root@nextcloud:~ # go version
go version go1.14.1 freebsd/amd64
 

Christopher_P

Dabbler
Joined
Nov 10, 2019
Messages
10
Hello,

I have a slightly different flavor of this issue. For some reason, my calibredb/calibre-server installation no longer works. I thought it might have been due to me not being on the truenas 12 release but that doesn't seem to make a difference either. To summarize, my binaries used to be in the usual /etc/rc.d and /usr/local/etc/rc.d directories. Something happened, almost certainly initiated by me without actually realizing it, that caused those binaries to be moved into /opt/calibre/bin/calibre. Normally,this would be no big deal, I would have just repointed all of the init scripts and rc.conf files to the correct place. However, in this case, the jail is complaining about not being able to run the binary. Also, I'm not able to find the calibredb packages in pkg any longer. I can't find anything suggesting support for calibre has reached EOL for freenas/freebsd so I'm not really sure what's up. Any insight or thoughts would be extremely helpful. I realize I'm light on info here so just let me know what else you need!

Currently running truenas 12, old calibre jail is running 11.3 Release p14.

root@calibre:/ # /opt/calibre/bin/calibredb add -r /mnt/media/books/ --library-path=/mnt/media/books/toadd/
ELF binary type "0" not known.
/opt/calibre/bin/calibredb: Exec format error. Binary file not executable.
 
Top