Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 10-08-2019, 09:30 AM   #1
Registered: May 2011
Location: TX
Distribution: Debian
Posts: 762

Rep: Reputation: 220Reputation: 220Reputation: 220
remote app back with -X flag and close terminal

I often ssh to a remote desktop server to run a program using its GUI. The way I do it, "ssh -X erik@server program". The terminal stays open with some output until I close the GUI and then it takes me back to the prompt. It's not a problem, but I'd like to be able to run the program without the terminal being that way, and leaving me at a prompt with the remote program still open. Is this possible?

Edit: I found that using the & operator works for what I'm doing. Thanks.

Last edited by erik2282; 10-08-2019 at 09:55 AM.
Old 10-08-2019, 03:15 PM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,814
Blog Entries: 15

Rep: Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661
Yep. The "&" puts it it into the background. Thanks for updating.

Note that when you close your original terminal it sends a hangup (sighup) to background processes started from the terminal. If you'd like the background process (e.g. your GUI) to still run when you close the terminal you can precede the command with "nohup" to tell it not to hangup.
Old 10-08-2019, 03:33 PM   #3
Registered: Aug 2002
Posts: 19,028

Rep: Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890
nohup,screen or tmux do not work if running a GUI application. Your using your local x server to connect to a client on the remote machine and closing the terminal closes the connection. I've never used Xpra but allows disconnection of remote GUI applications.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gparted - to "flag" or NOT to "flag" as "raid" ? helen314 Linux - Newbie 3 06-28-2019 03:02 PM
Help Required adding flag on packet and routing packet based on flag over ssl tunnel. sskhan Linux - Networking 1 02-02-2018 03:56 PM
close terminal mean close background process? Niceman2005 Linux - General 7 05-27-2010 02:58 PM
How to launch an app in terminal, & keep it running after I close terminal? kornerr Linux - General 7 06-24-2006 05:54 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration