gtk-WARNING **: cannot open display while running command-line-only scriptHow to prevent ecryptfs from umounting home if tmux is still running?Take Control of Process via SSHgksu: Gtk-WARNING **: cannot open display: :0How to get terminal back after I suspend a computer over SSH?Run Shell Script inside tmux(gedit:1430): Gtk-WARNING **: cannot open display:How to have DISPLAY 'automatically' set by Eclipse's remote debugging session?

Considering the power dissipation of a transistor

how to get a list of folders and number files in each folder side by side, in the current directory?

Stack Exchange Answerer

Why is/was the National Liberal Party of Romania opposed to Catholic & Hungarian school when they support a German-minority president?

Pay everything now or gradually?

Tablet and Wi-Fi AP can't agree on a channel. Which device is violating the 802.11n standard?

How to add new line between `ls -l` output

Can I apply for a passport in the country I'm in so I can travel to my home country?

Learn university maths or train for high school competitions: which is better?

Can I say "guess what" to acknowledge new information?

What is a short code for generating this matrix in R?

How are names of enharmonic notes determined?

Does a pro-rata backdoor Roth IRA conversion come from each IRA proportionally or just the one being converted?

Please help me spot the error in my "proof" that the sum of two irrational numbers must be irrational

My code seems to be a train wreck

Is it a complete sentence: "Caution murmured: it could be a trick, a lure, a trap."?

How do you say "to play Devil's advocate" in German?

Was X17 predicted before it was observed?

Using "um...zu" with past participle

What are pros and cons around banning castling?

Give a grammar for a language on Σ=a,b,c that accepts all strings containing exactly one a

What is a Sexy Phrase™?

Find the length of a number's "base-jumping" path

Is it acceptable to say that a divergent series that tends to infinity is 'equal to' infinity?



gtk-WARNING **: cannot open display while running command-line-only script


How to prevent ecryptfs from umounting home if tmux is still running?Take Control of Process via SSHgksu: Gtk-WARNING **: cannot open display: :0How to get terminal back after I suspend a computer over SSH?Run Shell Script inside tmux(gedit:1430): Gtk-WARNING **: cannot open display:How to have DISPLAY 'automatically' set by Eclipse's remote debugging session?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









3


















I'm trying to run several compute intensive python scripts on a server (Ubuntu 14.04.5 LTS) via ssh -Y and tmux. This works fine as long as I don't close the ssh connection. If I do close the connection, the currently running script will finish properly but the all scripts starting afterwards will get the error




gtk-WARNING **: cannot open display: localhost:10.0




The scripts are command-line-only but perhaps a library used for some reason needs a display. If I disconnect, the display is gone (my assumption). Is there a way to fix this (preferably without root access), perhaps a way to fool ubuntu into thinking there's a display while there is none?



EDIT:



  • I first connect to a vpn and then ssh into the server (with -Y flag)

  • I'm trying to run this script in a loop with different parameters each time. It uses matplotlib.use('Agg') so matplotlib shouldn't be the problem (?) I can't think of anything else.


  • echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0

  • X11-Forwarding works normally, I can run any desktop app I tried so far. The problem are scripts that start after I disconnect/logout.









share|improve this question



























  • can you tell me what does echo $DISPLAY command return after you see that error?

    – Savvas Radevic
    Feb 4 '18 at 12:27











  • also, what kind of commands are you trying to run? gtk-warning shows you're trying to run desktop apps in a terminal.. does the command/app support command-line mode? Possible solution here: superuser.com/a/310201/76384

    – Savvas Radevic
    Feb 4 '18 at 12:38












  • @SavvasRadevic Thank You for trying to help me! echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0. Could intermittently connecting from a different computer be the problem? However the script seems to have already failed before I connect again (not sure though)

    – KJoke
    Feb 4 '18 at 13:26


















3


















I'm trying to run several compute intensive python scripts on a server (Ubuntu 14.04.5 LTS) via ssh -Y and tmux. This works fine as long as I don't close the ssh connection. If I do close the connection, the currently running script will finish properly but the all scripts starting afterwards will get the error




gtk-WARNING **: cannot open display: localhost:10.0




The scripts are command-line-only but perhaps a library used for some reason needs a display. If I disconnect, the display is gone (my assumption). Is there a way to fix this (preferably without root access), perhaps a way to fool ubuntu into thinking there's a display while there is none?



EDIT:



  • I first connect to a vpn and then ssh into the server (with -Y flag)

  • I'm trying to run this script in a loop with different parameters each time. It uses matplotlib.use('Agg') so matplotlib shouldn't be the problem (?) I can't think of anything else.


  • echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0

  • X11-Forwarding works normally, I can run any desktop app I tried so far. The problem are scripts that start after I disconnect/logout.









share|improve this question



























  • can you tell me what does echo $DISPLAY command return after you see that error?

    – Savvas Radevic
    Feb 4 '18 at 12:27











  • also, what kind of commands are you trying to run? gtk-warning shows you're trying to run desktop apps in a terminal.. does the command/app support command-line mode? Possible solution here: superuser.com/a/310201/76384

    – Savvas Radevic
    Feb 4 '18 at 12:38












  • @SavvasRadevic Thank You for trying to help me! echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0. Could intermittently connecting from a different computer be the problem? However the script seems to have already failed before I connect again (not sure though)

    – KJoke
    Feb 4 '18 at 13:26














3













3









3








I'm trying to run several compute intensive python scripts on a server (Ubuntu 14.04.5 LTS) via ssh -Y and tmux. This works fine as long as I don't close the ssh connection. If I do close the connection, the currently running script will finish properly but the all scripts starting afterwards will get the error




gtk-WARNING **: cannot open display: localhost:10.0




The scripts are command-line-only but perhaps a library used for some reason needs a display. If I disconnect, the display is gone (my assumption). Is there a way to fix this (preferably without root access), perhaps a way to fool ubuntu into thinking there's a display while there is none?



EDIT:



  • I first connect to a vpn and then ssh into the server (with -Y flag)

  • I'm trying to run this script in a loop with different parameters each time. It uses matplotlib.use('Agg') so matplotlib shouldn't be the problem (?) I can't think of anything else.


  • echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0

  • X11-Forwarding works normally, I can run any desktop app I tried so far. The problem are scripts that start after I disconnect/logout.









share|improve this question
















I'm trying to run several compute intensive python scripts on a server (Ubuntu 14.04.5 LTS) via ssh -Y and tmux. This works fine as long as I don't close the ssh connection. If I do close the connection, the currently running script will finish properly but the all scripts starting afterwards will get the error




gtk-WARNING **: cannot open display: localhost:10.0




The scripts are command-line-only but perhaps a library used for some reason needs a display. If I disconnect, the display is gone (my assumption). Is there a way to fix this (preferably without root access), perhaps a way to fool ubuntu into thinking there's a display while there is none?



EDIT:



  • I first connect to a vpn and then ssh into the server (with -Y flag)

  • I'm trying to run this script in a loop with different parameters each time. It uses matplotlib.use('Agg') so matplotlib shouldn't be the problem (?) I can't think of anything else.


  • echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0

  • X11-Forwarding works normally, I can run any desktop app I tried so far. The problem are scripts that start after I disconnect/logout.






server ssh xorg display x11-forwarding






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 '18 at 13:40







KJoke

















asked Feb 4 '18 at 12:08









KJokeKJoke

311 silver badge3 bronze badges




311 silver badge3 bronze badges















  • can you tell me what does echo $DISPLAY command return after you see that error?

    – Savvas Radevic
    Feb 4 '18 at 12:27











  • also, what kind of commands are you trying to run? gtk-warning shows you're trying to run desktop apps in a terminal.. does the command/app support command-line mode? Possible solution here: superuser.com/a/310201/76384

    – Savvas Radevic
    Feb 4 '18 at 12:38












  • @SavvasRadevic Thank You for trying to help me! echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0. Could intermittently connecting from a different computer be the problem? However the script seems to have already failed before I connect again (not sure though)

    – KJoke
    Feb 4 '18 at 13:26


















  • can you tell me what does echo $DISPLAY command return after you see that error?

    – Savvas Radevic
    Feb 4 '18 at 12:27











  • also, what kind of commands are you trying to run? gtk-warning shows you're trying to run desktop apps in a terminal.. does the command/app support command-line mode? Possible solution here: superuser.com/a/310201/76384

    – Savvas Radevic
    Feb 4 '18 at 12:38












  • @SavvasRadevic Thank You for trying to help me! echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0. Could intermittently connecting from a different computer be the problem? However the script seems to have already failed before I connect again (not sure though)

    – KJoke
    Feb 4 '18 at 13:26

















can you tell me what does echo $DISPLAY command return after you see that error?

– Savvas Radevic
Feb 4 '18 at 12:27





can you tell me what does echo $DISPLAY command return after you see that error?

– Savvas Radevic
Feb 4 '18 at 12:27













also, what kind of commands are you trying to run? gtk-warning shows you're trying to run desktop apps in a terminal.. does the command/app support command-line mode? Possible solution here: superuser.com/a/310201/76384

– Savvas Radevic
Feb 4 '18 at 12:38






also, what kind of commands are you trying to run? gtk-warning shows you're trying to run desktop apps in a terminal.. does the command/app support command-line mode? Possible solution here: superuser.com/a/310201/76384

– Savvas Radevic
Feb 4 '18 at 12:38














@SavvasRadevic Thank You for trying to help me! echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0. Could intermittently connecting from a different computer be the problem? However the script seems to have already failed before I connect again (not sure though)

– KJoke
Feb 4 '18 at 13:26






@SavvasRadevic Thank You for trying to help me! echo $DISPLAY returns localhost:10.0 before the error. If I connect from a different computer it returns localhost:13.0. If I left the terminal on the original computer open, it will still return localhost:10.0 however if I open a new one it will now also return localhost:13.0. Could intermittently connecting from a different computer be the problem? However the script seems to have already failed before I connect again (not sure though)

– KJoke
Feb 4 '18 at 13:26











1 Answer
1






active

oldest

votes


















0



















Try setting the DISPLAY variable:



export DISPLAY=localhost:10.0


And then execute your commands.






share|improve this answer




















  • 1





    Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

    – WinEunuuchs2Unix
    Feb 5 '18 at 12:43











  • Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

    – Savvas Radevic
    Feb 6 '18 at 14:55











  • This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

    – KJoke
    Feb 15 '18 at 11:41












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002914%2fgtk-warning-cannot-open-display-while-running-command-line-only-script%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0



















Try setting the DISPLAY variable:



export DISPLAY=localhost:10.0


And then execute your commands.






share|improve this answer




















  • 1





    Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

    – WinEunuuchs2Unix
    Feb 5 '18 at 12:43











  • Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

    – Savvas Radevic
    Feb 6 '18 at 14:55











  • This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

    – KJoke
    Feb 15 '18 at 11:41















0



















Try setting the DISPLAY variable:



export DISPLAY=localhost:10.0


And then execute your commands.






share|improve this answer




















  • 1





    Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

    – WinEunuuchs2Unix
    Feb 5 '18 at 12:43











  • Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

    – Savvas Radevic
    Feb 6 '18 at 14:55











  • This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

    – KJoke
    Feb 15 '18 at 11:41













0















0











0









Try setting the DISPLAY variable:



export DISPLAY=localhost:10.0


And then execute your commands.






share|improve this answer














Try setting the DISPLAY variable:



export DISPLAY=localhost:10.0


And then execute your commands.







share|improve this answer













share|improve this answer




share|improve this answer










answered Feb 5 '18 at 11:13









Savvas RadevicSavvas Radevic

6,6971 gold badge33 silver badges44 bronze badges




6,6971 gold badge33 silver badges44 bronze badges










  • 1





    Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

    – WinEunuuchs2Unix
    Feb 5 '18 at 12:43











  • Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

    – Savvas Radevic
    Feb 6 '18 at 14:55











  • This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

    – KJoke
    Feb 15 '18 at 11:41












  • 1





    Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

    – WinEunuuchs2Unix
    Feb 5 '18 at 12:43











  • Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

    – Savvas Radevic
    Feb 6 '18 at 14:55











  • This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

    – KJoke
    Feb 15 '18 at 11:41







1




1





Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

– WinEunuuchs2Unix
Feb 5 '18 at 12:43





Wouldn't this be better if written as a comment first and then posted as a more detailed answer if it works for OP?

– WinEunuuchs2Unix
Feb 5 '18 at 12:43













Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

– Savvas Radevic
Feb 6 '18 at 14:55





Thank you for the recommendation, however I believe it requires an exception to that rule as it is a sane solution. Plus it won't get lost in the sea of comments. :)

– Savvas Radevic
Feb 6 '18 at 14:55













This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

– KJoke
Feb 15 '18 at 11:41





This does not work. As I said, X11-Forwarding works fine, what I need is a way to schedule scripts that require x-server without the need to be constantly connected. Scripts which start after I close the connection fail because the display at localhost:10.0 is no longer accessible. Something like this should work, unfortunately I don't have the rights to install packages and can't test it.

– KJoke
Feb 15 '18 at 11:41


















draft saved

draft discarded















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002914%2fgtk-warning-cannot-open-display-while-running-command-line-only-script%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?