Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the correct way to pass /tmp/.X11-unix into a chroot? #2711

Closed
dandelionred opened this issue May 20, 2019 · 9 comments
Closed

What is the correct way to pass /tmp/.X11-unix into a chroot? #2711

dandelionred opened this issue May 20, 2019 · 9 comments
Labels
information_old (Deprecated; use "doc-todo" or "needinfo" instead) Information was/is required

Comments

@dandelionred
Copy link
Contributor

I debootstrapped ubuntu 19.04 into /nas/chroot/disco and installed smplayer inside.

Running this

firejail --noprofile --chroot=/nas/chroot/disco smplayer

I get this

...
qt.qpa.xcb: could not connect to display :0
...

As a dirty fix I set up such bind

sudo mount --bind /tmp /nas/chroot/disco/tmp

and chrooted smplayer can start now.


Is there some native to firejail way to pass /tmp/.X11-unix into a chroot?


Btw I run xorg with -nolisten local so there is no abstract socket. Hence /tmp/.X11-unix is the only way to X.

@smitsohu
Copy link
Collaborator

Setting an environment variable FIREJAIL_X11 should work.

@dandelionred
Copy link
Contributor Author

Setting an environment variable FIREJAIL_X11 should work.

I'm not sure how to use it

$ FIREJAIL_X11=1 firejail --noprofile --chroot=/nas/chroot/disco smplayer
Error: cannot find /tmp/.X11-unix in chroot directory

@smitsohu
Copy link
Collaborator

You need to create an empty /tmp/.X11-unix directory as mount point first.

@dandelionred
Copy link
Contributor Author

Thanks, it works now.

Mby the FIREJAIL_X11 tip should be added to https://firejail.wordpress.com/documentation-2/x11-guide/ ?

@chiraag-nataraj chiraag-nataraj added the information_old (Deprecated; use "doc-todo" or "needinfo" instead) Information was/is required label May 20, 2019
@smitsohu
Copy link
Collaborator

To be honest, FIREJAIL_X11 is quite a dirty solution itself.

In the moment Firejail doesn't help too much in setting up the chroot, but this also means it will not get in your way too much. I think what you described in the original post is "the correct way" actually.

@dandelionred
Copy link
Contributor Author

KK, got it.

@smitsohu
Copy link
Collaborator

A last note:

Don't set FIREJAIL_X11 to yes, any other value will work just fine.

@dandelionred
Copy link
Contributor Author

@smitsohu What is wrong with FIREJAIL_X11=yes?

@smitsohu
Copy link
Collaborator

@dandelionred FIREJAIL_X11=yes is used internally to indicate that an --x* option has been parsed; setting it to a value other than yes navigates around possible issues.

Did I already mention it is dirty? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
information_old (Deprecated; use "doc-todo" or "needinfo" instead) Information was/is required
Projects
None yet
Development

No branches or pull requests

3 participants