Twingate linux client installation in a Docker container

Hi everyone,

Did somebody tried and manage to install the Twingate Linux client from a Docker container ?

I would like some resources inside a container to be able to access a private resource: the idea was to install the linux client in headless mode, using a service account from within the container.

While everything is working perfect on a standard Ubuntu host, the installation process inside a container gets me stuck:

  • Using ubuntu:20.04 image, :white_check_mark:
  • Installing needed dependencies :white_check_mark:
  • Installing twingate linux client :white_check_mark:
  • Setting up twingate linux client in headless mode :white_check_mark:
  • Starting tinwgate linux client :x:

The client never starts correctly. Here are the logs :

Failed to get OS name: The name org.freedesktop.hostname1 was not provided by any .service files
[2022-10-10T20:48:31.129851+0000] [INFO] [client] Starting Twingate Client
[2022-10-10T20:48:31.130403+0000] [INFO] [client] Configured Headless client with a service key
[2022-10-10T20:48:31.130579+0000] [ERROR] [client] system_property_set: Read-only file system: fopen(/proc/sys/net/ipv4/conf/all/rp_fi>
[2022-10-10T20:48:31.130628+0000] [ERROR] [client] linux_cm_new: system_properties_config(all) failed
[2022-10-10T20:48:31.131203+0000] [ERROR] [client] nm_get_property: The name org.freedesktop.NetworkManager was not provided by any .s>
[2022-10-10T20:48:31.131275+0000] [ERROR] [client] linux_nm_networking_enabled: nm_get_property(NetworkingEnabled)
[2022-10-10T20:48:31.131537+0000] [ERROR] [client] systemd_resolved_is_enabled: “!dbus_error_is_set(&error) && reply != NULL” failed
[2022-10-10T20:48:31.131649+0000] [ERROR] [client] linux_tun_new: No such file or directory: opening /dev/net/tun
[2022-10-10T20:48:31.131698+0000] [ERROR] [client] linux_cm_new: linux_tun_new
[2022-10-10T20:48:31.131745+0000] [ERROR] [client] manualconf_nameservers_restore: “backup_is_done == true” failed
[2022-10-10T20:48:31.131801+0000] [ERROR] [client] linux_cm_free: failed to restore nameservers
[2022-10-10T20:48:31.131862+0000] [FATAL] [client] Failed to initialize Network Controller

And I don’t manage to get neither systemd-resolved nor NetworkManager services properly enabled/configured. Any help or experience would be very appreciated! :slightly_smiling_face:

Hi @maximebn, did you pass the argument --device /dev/net/tun --cap-add NET_ADMIN in the docker run command?

[2022-10-10T20:48:31.131649+0000] [ERROR] [client] linux_tun_new: No such file or directory: opening /dev/net/tun

The above log sounds like it might not have been set.

Hi @aaron,

Indeed, I did not do it, and I feel a bit ashamed to have missed out this part of documentation :see_no_evil:

I am really sorry, anyway everything is working fine, thank you so much !!

Hey @maximebn glad to hear we got it fixed!