Hello I try to build my docker image it requires X server (can be dummy X server) to build so when I build It gives
cannot connect to X server
when I try
xhost local:root
I get error
unable to open display ":1"
I tried to make it work using xterm and xvfb like
Xvfb :1 -screen 0 1600x1200x24
but then the terminal freezes
although it is installed
Thanks for any help !
Solved! Go to Solution.
I found the solution that seem to work well
sudo chown -R $USER /usr/share/X11
sudo chmod -R ugo+rwx /usr/share/X11
sudo chown -R $USER /etc/X11
sudo chmod -R ugo+rwx /etc/X11
sudo chown -R $USER /tmp/
sudo chmod -R ugo+rwx /tmp/
sudo chown -R $USER /dev/tty0
sudo chmod -R ugo+rwx /dev/tty0
If we take Google Cloud Compute Engine out of the picture ... are you able to build and run a local (to your workstation) Docker Image that runs? I'm wondering if this is a Google Cloud puzzle or a Docker generic puzzle?
Thanks @kolban, yes it works when I built this image on my ubuntu 20 machine, unluckily my brute force solution that I earlier marked as a solution to the problem
```
chown -R $USER ${HOME}
chmod -R ugo+rwx ${HOME}
```
although fixes the problem with x11 breaks possibility of logging in as I described in https://www.googlecloudcommunity.com/gc/Infrastructure-Compute-Storage/cannot-connect-properly-reset...
I tried also to lounch docker build as a superuser - yet it do not help (image is based on https://github.com/Slicer/SlicerDocker)
full error message is
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
Build Operating System: linux Ubuntu
Current Operating System: Linux 8945adfae32c 5.11.0-1021-gcp #23~20.04.1-Ubuntu SMP Fri Oct 1 19:04:32 UTC 2021 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.11.0-1021-gcp root=PARTUUID=ed7f54fb-315b-437f-b68b-5eb7addc18db ro console=ttyS0 panic=-1
Build Date: 14 December 2021 02:14:13PM
xorg-server 2:1.20.13-1ubuntu1~20.04.2 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.38.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "./10.log", Time: Thu Jun 30 09:15:09 2022
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (No such file or directory)
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "./10.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
XORG_PID [11]
Set default application settings
Slicer: cannot connect to X server :10
The command '/bin/sh -c /home/sliceruser/install.sh ${HOME}/Slicer/Slicer' returned a non-zero code: 1
I found the solution that seem to work well
sudo chown -R $USER /usr/share/X11
sudo chmod -R ugo+rwx /usr/share/X11
sudo chown -R $USER /etc/X11
sudo chmod -R ugo+rwx /etc/X11
sudo chown -R $USER /tmp/
sudo chmod -R ugo+rwx /tmp/
sudo chown -R $USER /dev/tty0
sudo chmod -R ugo+rwx /dev/tty0