I’ve been trying to run gui applications inside an lxd container for ros but have been facing issues. Guidance will be greatly appriciated.
config:
environment.DISPLAY: :1
raw.idmap: both 1000 1000
user.user-data: |
#cloud-config
runcmd:
- 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf'
- 'echo export PULSE_SERVER=unix:/tmp/.pulse-native | tee --append /home/ubuntu/.profile'
packages:
- x11-apps
- mesa-utils
- pulseaudio
description: GUI LXD profile
devices:
PASocket:
path: /tmp/.pulse-native
source: /run/user/1000/pulse/native
type: disk
X0:
path: /tmp/.X11-unix/X0
source: /tmp/.X11-unix/X0
type: disk
Xauth:
path: /home/user/.Xauthority
source: /run/user/1000/gdm/Xauthority
type: disk
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: ros
used_by:
- /1.0/instances/noetic
running tail -6 /var/log/cloud-init.log
ubuntu@noetic:~$ tail -6 /var/log/cloud-init.log
2020-11-20 03:14:30,438 - atomic_helper.py[DEBUG]: Atomically writing to file /var/lib/cloud/data/result.json (via temporary file /var/lib/cloud/data/tmpnll0apqx) - w: [644] 119 bytes/chars
2020-11-20 03:14:30,439 - util.py[DEBUG]: Creating symbolic link from '/run/cloud-init/result.json' => '../../var/lib/cloud/data/result.json'
2020-11-20 03:14:30,439 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2020-11-20 03:14:30,439 - util.py[DEBUG]: Read 11 bytes from /proc/uptime
2020-11-20 03:14:30,439 - util.py[DEBUG]: cloud-init mode 'modules' took 24.821 seconds (24.82)
2020-11-20 03:14:30,439 - handlers.py[DEBUG]: finish: modules-final: SUCCESS: running modules for final
running xclock
ubuntu@noetic:~$ xclock
Error: Can't open display: :1
On the host pc , running `$DISPLAY`
[ Thu Nov 19, 22:28:19 wolf1990@ad: ~/codebase/ros ]
└─ $ $DISPLAY
:1: command not found