2
This question has been asked several times, but the solutions I've found always solve the problem in a different way.
On the remote machine (the one on which I want to run startx
), I have already
echo allowed_users=anybody | sudo tee /etc/X11/Xwrapper.config
When I ssh to the machine and run startx;
, I get the error,
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
I added myself to the tty
group after which the error is
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
Speculating, when I log in to the machine locally, getty
(running as root
) assigns ownership of tty0
to my user, and this is sine qua non. How can I make this assignment happen without typing my username and password on that virtual terminal? Maybe I can send keystrokes to the virtual terminal? Maybe I can chown
the right files so that I can own it?
Of course this is a "XY" problem. The real problem is: when I'm away, I would like to log into the machine (e.g. after a reboot) and turn on its monitor (a projector in this case) so that my family can watch movies on my profile without knowing or having to type my password.
I dont think using ssh would help, even after the permissions problem is solved. Something like VNC (server launched on startup) might be a better fit. The problem is even if you do get your ssh solution working I posit it will send the screen over the SSH connection, not to both the ssh connection and console. (Also, you probably dont have X forwarding set on the client side) – davidgo – 2019-04-30T19:15:38.957
@davidgo Thanks for the comment. I don't want X forwarding over SSH. I want X to take control of TTY0 just like it would if I typed my credentials in there and ran
startx;
. – Limited Atonement – 2019-05-01T19:29:55.040Can you lunch startx by changing the runlevel (ie runlevel 5)? Relatedly, why does your system not start X on startup and how is it configured to not do so? – davidgo – 2019-05-01T20:09:36.187
I use arch linux. The default is not to start X unless specifically configured to do so. I don't run a desktop manager either. Run level...interesting. I don't know how that will help me give control of tty0 to X, but I'd be interested in hearing a more concrete suggestion! – Limited Atonement – 2019-05-03T01:58:43.780
I've never used arch, but have a look at https://wiki.archlinux.org/index.php/SysVinit#Runlevel_invocation
– davidgo – 2019-05-03T02:17:35.090