Minimum requirement for lxd-p2c

Does not work with the =.
Also, in your command, I can see some Unicode quotes which are a big no no.
I cannot understand how you go them, since this forum software does not do any superfluous text formatting.

Here the following is on Ubuntu 18.04, running Go 1.11 (snap package).

$ go version
go version go1.11 linux/amd64
$ go get -a -v -x -ldflags '-extldflags "-static"'
$ cd $GOPATH/bin
$ ldd lxd-p2c 
	not a dynamic executable
Exit 1

Verify that ldd says that the executable is not dynamic (i.e. it’s static).

I manually re-typed the whole line, got the ldd output as you indicate, copied it over to a centos 6 box:

[root@nj-web01-cl01 ~]# uname -a
Linux nj-web01-cl01 2.6.32-042stab127.2 #1 SMP Thu Jan 4 16:41:44 MSK 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@nj-web01-cl01 ~]# ./lxd-p2c
FATAL: kernel too old

What kernel version does Centos 6 have? Distrowatch says Linux 2.6. Is that really your kernel version on Centos?

You can add the --enable-kernel=x.y.z option when you compile the binary.
See more at

Did you ever find a resolution to this? I am having the same problem. I started a new thread.

Is the lxd server a member of a cluster?


This thread is about generating the lxd-p2c executable file.
Your thread is about an issue with lxd-p2c not working.

Sorry for the delay in getting back to you. The kernel is 2.6.32 in centos.

I built it with this am still getting the kernel too old message:

go get -a -v -x -ldflags ‘-extldflags “-static --enable-kernel-=2.6.32”’

I was able to build a static version of lxd-p2c on CentOS 6 by using the Developer Toolset which provides a newer version of gcc than the one installed by default:

yum install -y centos-release-scl
yum install -y devtoolset-8-binutils devtoolset-8-gcc-c++ devtoolset-8-binutils-devel devtoolset-8-libstdc++-devel devtoolset-8-runtime devtoolset-8-gcc

go get -d -v
scl enable devtoolset-8 bash
go build -v -x --tags netgo --ldflags '-extldflags "-static"'

Then the resulting executeable lxd-p2c is static:

# ldd lxd-p2c
        not a dynamic executable

There is a Makefile target for a static lxd-p2c build.