[lxc-users] lxc-create through socks proxy

Julien Malik julien.malik at paraiso.me
Wed Mar 11 12:45:11 UTC 2015


On 2015-03-11 10:44, Fajar A. Nugraha wrote:

> On Tue, Mar 10, 2015 at 10:37 PM, Julien <julien.malik+lxc at paraiso.me> 
> wrote:
>> Hi,
>> 
>> I fail to lxc-create containers with the download template through a 
>> SOCKS
>> proxy.
>> 
>> I usually use tsocks to provide socks support to my application.
>> tsocks uses the LD_PRELOAD trick to provide socks support to 
>> application
>> that do not natively support it.
>> lxc-create might not like it.
>> 
>> I get these errors :
>> 
>> $ tsocks lxc-create -t download -n trusty2
>> 15:52:06 libtsocks(14728): Unresolved symbol: connect
>> 15:52:07 libtsocks(14728): Unresolved symbol: close
>> 15:52:07 libtsocks(14729): Unresolved symbol: connect
>> 15:52:07 libtsocks(14729): Unresolved symbol: close
>> 15:52:07 libtsocks(14736): Unresolved symbol: connect
>> 15:52:07 libtsocks(14736): Unresolved symbol: close
>> 15:52:07 libtsocks(14742): Unresolved symbol: connect
>> 15:52:07 libtsocks(14742): Unresolved symbol: close
>> 15:52:07 libtsocks(14748): Unresolved symbol: connect
>> 15:52:07 libtsocks(14748): Unresolved symbol: close
>> Setting up the GPG keyring
>> 
>> And then it hangs at that point.
>> Any advice on how to run lxc-create through a SOCKS proxy ?
> 
> Are you able to get gpg to work with tsocks? This thread [2] (and the 
> reply [3]) seems to say so. The fix is beyond the scope of this list. 
> Reporting the bug to gpg or tsocks maintainer might help, although I 
> doubt they will make it a priority since a workaround already exists.
> 
> 


I have no problem importing keys through tsocks :

$ gpg --keyserver hkp://pool.sks-keyservers.net  --recv-keys 
0xBAEFF88C22F6E216
gpg: requesting key 22F6E216 from hkp server pool.sks-keyservers.net
^C
gpg: Interrupt caught ... exiting

^ this hangs (as expected)

$ tsocks gpg --keyserver hkp://pool.sks-keyservers.net  --recv-keys 
0xBAEFF88C22F6E216
gpg: requesting key 22F6E216 from hkp server pool.sks-keyservers.net
gpg: key 22F6E216: public key "LXC pre-built images 
<lxc-devel at lists.linuxcontainers.org>" imported
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   2  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 2u
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)


So the "libtsocks(14728): Unresolved symbol: " errors do not come from 
gpg.

My feeling is that running the lxc-download template script directly 
would work and that the errors come from lxc-create itself, which may 
not like the LD_PRELOAD stuff.
I shall probably confirm that by running the template script directly 
(not through lxc-create).


Julien



More information about the lxc-users mailing list