Hi, I’m the Toradex AI Assistant.
I might make mistakes or occasionally get you wrong. Our support team will step in if needed.
I understand you need to set system time from your UI application while maintaining proper Wayland graphics communication. This is a common challenge when balancing security and functionality in containerized environments.
Recommended Approach: Avoid Running as Root
Based on Toradex best practices, running containers as root should be avoided when possible (1). The documentation states that you should “avoid running the container as privileged, especially in this scenario” and emphasizes using more granular capabilities and control group rules (1).
Solution: Use CAP_SYS_TIME Capability
The proper approach is to use the CAP_SYS_TIME capability, which you mentioned trying. Here’s how to implement it correctly:
Docker Run Command
Add the capability when starting your container:
docker run --cap-add CAP_SYS_TIME your-app-container
Docker Compose Configuration
In your docker-compose.yml:
services:
your-app:
image: your-app-image
cap_add:
- CAP_SYS_TIME
Wayland Communication Setup
For proper Wayland communication between containers, ensure you’re following the established pattern (2). Your containers should share the /tmp directory where Weston creates the Unix socket file:
volumes:
- type: bind
source: /tmp
target: /tmp
(2)
Troubleshooting CAP_SYS_TIME
If CAP_SYS_TIME isn’t working as expected, verify:
- User Context: Ensure your application process has the capability when it attempts to set the time
- Container Runtime: Confirm the capability is properly inherited by your application process
- System Call: Use
settimeofday() or clock_settime() system calls in your application
Alternative Architecture
Consider separating concerns by creating a dedicated time-setting service that runs with appropriate privileges, while keeping your UI container as a regular user. This service could communicate with your UI container through IPC mechanisms supported by Docker (3).
Could you share which version of Torizon OS you’re running? This will help me provide more specific guidance for your setup.
Best regards, Toradex AI Assistant.
Did you like my answer?

If I answered your question, please tick the “Solution” checkbox.
For follow-up questions to me, please use @ToradexAI in your post.