2

I followed the tutorial at http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/ and was able to successfully run Firefox. However, after restarting, I can't start X for my user, from the graphical login or via startx. It always errors out with:

(EE) xf86OpenConsole: Cannot open virtual console 2 (permission denied)

If I run startx as root, it runs fine. How can I regain the ability to use X from my user account?

2 Answers 2

3

Virtual Console 2 seems to refer to tty2. I had this problem while working with chromium-browser and X11 through the startx command in a docker container.

To resolve, I had to create a user in the docker container, add them to 'tty' group, and ensure 'tty' group had read permissions. tty2 already had write permissions enabled when I got there.

Chmod for reference:

sudo chmod 660 /dev/tty2

For Read/Write Owner, Read/Write Group, and nothing for the world.

In my docker run command, I mapped over tty2 using the --device flag:

--device=/dev/tty2:/dev/tty2

That resolved this very specific issue for me. I hope this helps someone down the road.

1
  • This worked great for running xinit on an orangepi device. Thank you very much.
    – Exzile
    May 18, 2022 at 3:48
0

I'm not sure what I did, but I must have run something as root that I shouldn't have. To run a Docker app with your user, add the option -u $UID to the docker run command. This will ensure that permissions don't get messed up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .