Is possible to start a process in physical console (with Gnome) from ssh??

Chano

New Member
Joined
Apr 20, 2021
Messages
6
Reaction score
1
Credits
56
Hi, it might sound strange, but it makes sense to me.

I'm running a headless solution to stream videos to YouTube with OBS. I've realized that, if I start OBS on the console (that has an Intel GPU) streaming is smoother than if I start OBS remotely over SSH & X11.

Providing that I need to remote control the service, I've developed a little python+gunicorn app that will receive orders and control OBS over websockets. if OBS is running in the console, everything is great!!

Sometimes, OBS hangs and I need to kill it and restart it but I can't do it remotely, because OBS will start in my X11 session but not in console.

I've solve the problem booting into Xwindow directly and putting OBS in the startup applications so it will start at boot.

The problem is that there are other things running in the same box, so this is not a very "pretty" solution.

I've tried changing ttys, and other solutions I've search on the net, but to no avail.

So, I'll appreciate your help. is it possible to start a command (obs) on the console from another process (SSH terminal or python script invoked via rest api)

Thx in advance for your help!!!
 


Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,003
Reaction score
967
Credits
9,874
Hi:

I have only used OBS a few times and I didn't write a script for it.
However; I did find theses thread's that may help.




Good Luck-:)
 
OP
C

Chano

New Member
Joined
Apr 20, 2021
Messages
6
Reaction score
1
Credits
56
It's really not a OBS QUestion (I have all my OBS scripting working) , My question is, how can I start an X-application in the console from a remote SSH sesion.

For instance, how can I start xeye in the console from ssh.

Thx anyway for your time!!!
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
3,910
Reaction score
2,642
Credits
28,260
You can just use ssh -X or ssh -Y and then start your application by running the command in the terminal, X11 forwarding needs to be enable on the remote system though.
Code:
1.  Connect to remote system using ssh: ssh -X remote.system.example.com
2.  Start application by running it from the command-line: xclock
 
OP
C

Chano

New Member
Joined
Apr 20, 2021
Messages
6
Reaction score
1
Credits
56
No, that's not what I need. If I do that, the x-application (xclock in your example) will show up in my xwindow session in my laptop. What I want its quite similar, but I want xclock started in the linux console, not in my laptop.
thx
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
3,910
Reaction score
2,642
Credits
28,260
OP
C

Chano

New Member
Joined
Apr 20, 2021
Messages
6
Reaction score
1
Credits
56
no, in the console.

Let me explain a little bit more.

I have a desktop Pc running debian 10 with Gnome desktop installed configured to auto-login with a regular user and Gnome is configured to auto-start the OBS application. So, when I powerup the Pc, it boots and ends up displaying in the HDMI monitor the OBS application. SO far, everything is OK.

Now, I want to be able to ssh to this desktop (same user that is auto-logged in) , kill OBS (no problem for this) and re-start OBS in the same HDMI console it was running (not in my ssh session). This is my problem!!
 
Last edited:

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
3,910
Reaction score
2,642
Credits
28,260
I see, find out while you are logged into the console what the DISPLAY variable is: echo $DISPLAY, then from your ssh session set that same variable and then create a simple script to launch it with. Say from your console you get back that your DISPLAY is ":0", so something like this.
Code:
!#/bin/bash
export DISPLAY=:0
xclock &
Run it and see what happens or you can just run the commands seperatly, I tried it on a vm and it works for me.
 
Last edited:
OP
C

Chano

New Member
Joined
Apr 20, 2021
Messages
6
Reaction score
1
Credits
56
I guess I've tried that, but I'm not sure...

I'm away from the machine now. Tomorrow I'll go to the place the machine sits and I'll try.

I'll post here any results.

Thx for your help!!
 
OP
C

Chano

New Member
Joined
Apr 20, 2021
Messages
6
Reaction score
1
Credits
56
I've just test it and it works!!!

The Display enviroment variable was set to :0.0 doing
export DISPLAY=:0.0
on my ssh session, OBS is started in the console as I wanted.

THANK YOU very much for your help!!
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!


Top