2

I am trying to run X on an unrooted Moto Z Play. For that I installed GNURoot which is running a limited version of Debian. One of the limits is that I can't access /dev. This causes startx and also xinit to fail, because it can't access /dev/tty*. Is there any way to start X without that access? On my old (rooted) phone, I was running Linux Deploy, which shared its desktop via VNC. Is anything similar possible without root and with the SELinux limitations in place?

Edit: I don't want X to access the phone's display hardware, I only want it to be available via VNC so I can access it via a VNC app pointed to localhost.

  • How exactly do you plan to let the X server access the display hardware if it doesn't have permissions to do so? If anyone could just bypass root permission restrictions, they wouldn't be restrictions. You can run a second X server that allows remote clients via VNC etc., but that one will also not be able to access the display hardware directly. Though you can run a client for it on your primary X server, of course. – dirkt Jul 24 '17 at 8:12
  • I don't actually want it to access the display hardware directly, I just want to be able to access it using VNC. That's the way I had it setup on Linux Deploy. To view the display I'd just connect to localhost with a VNC app. – Dakkaron Jul 24 '17 at 10:07
  • And to be able to access the hardware display in any way, via VNC or otherwise, you need root. Because if you want to run an X server that you can access via VNC, that X server in turn needs to access the display, if you want that. That you are not directly involved in the this when you use VNC doesn't change this fact. – dirkt Jul 24 '17 at 14:28
  • Is there any way to do that without a hardware display? So just with some kind of virtual display? – Dakkaron Jul 25 '17 at 7:01
  • @Dakkaron Xvfb provides an invisible X server that can be accessed with VNC or ssh. As it has a virtual display only, it does not need hardware access. – mviereck Aug 1 '17 at 16:18
1

Contrary to the comments this is actually possible using xvnc or more precisely xtightvncserver. This starts a new X server without using /dev and forwards that to vnc.

The exact command is tightvncserver -geometry 1920x1080 :51.

To start a program (in this case the LXDE desktop environment) that is to be displayed on that virtual display use this command: DISPLAY=localhost:51 lxsession -s LXDE &

  • That's actually noy "contrary to the comments" (if you mean mine): "You can run a second X server that allows remote clients via VNC etc". – dirkt Aug 8 '17 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.