xterm error : xt error can't open display xterm display is not setssh -X “Xt error: Can't open display:...
What is the best way to deal with NPC-NPC combat?
"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"
Restricting the options of a lookup field, based on the value of another lookup field?
Is there a word for the censored part of a video?
Combinatorics problem, right solution?
How to have a sharp product image?
What does "function" actually mean in music?
How to pronounce 'c++' in Spanish
std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?
Philosophical question on logistic regression: why isn't the optimal threshold value trained?
Why must Chinese maps be obfuscated?
Is Electric Central Heating worth it if using Solar Panels?
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?
How can I practically buy stocks?
How long after the last departure shall the airport stay open for an emergency return?
What was Apollo 13's "Little Jolt" after MECO?
How to keep bees out of canned beverages?
What is this word supposed to be?
Co-worker works way more than he should
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
Magical attacks and overcoming damage resistance
How much cash can I safely carry into the USA and avoid civil forfeiture?
xterm error : xt error can't open display xterm display is not set
ssh -X “Xt error: Can't open display: :0.0”Why isn't cluster-SSH working on Ubuntu Server?How to customize xtermJust installed UBUNTU 12.04.3 - XTERM XT Error Can't displayHow to enable cut or copy-paste in xtermMaking xterm use unifontHow to get ssh under xterm not to break alt key?how can I open a extra console and run a program in it with one command?xterm display is not setVim not sending correct xterm esc sequences back over an ssh connection to an OSX xterm
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have no idea how to set the display. I keep getting the following error error
xterm: xt error can't open display xterm display is not set
I have searched online but haven't found any solution. Please can anyone help me out ?
xterm
bumped to the homepage by Community♦ 14 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have no idea how to set the display. I keep getting the following error error
xterm: xt error can't open display xterm display is not set
I have searched online but haven't found any solution. Please can anyone help me out ?
xterm
bumped to the homepage by Community♦ 14 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have no idea how to set the display. I keep getting the following error error
xterm: xt error can't open display xterm display is not set
I have searched online but haven't found any solution. Please can anyone help me out ?
xterm
I have no idea how to set the display. I keep getting the following error error
xterm: xt error can't open display xterm display is not set
I have searched online but haven't found any solution. Please can anyone help me out ?
xterm
xterm
edited May 29 '16 at 14:37
ankit7540
3,26911633
3,26911633
asked May 27 '16 at 19:09
OyinadeOyinade
11112
11112
bumped to the homepage by Community♦ 14 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 14 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
This is likely due to either a misconfiguration issue or you have multiple displays. As can be seen in the xterm manpage (man xterm) you can set the display using the -display flag:
-display display
This option specifies the X server to contact; see X(7).
If you then look in X(7) where it specifies to look (man X) you will see what you need to put after the flag:
DISPLAY NAMES
From the user's perspective, every X server has a display name of the
form:
hostname:displaynumber.screennumber
This information is used by the application to determine how it should
connect to the server and which screen it should use by default (on
displays with multiple monitors):
hostname
The hostname specifies the name of the machine to which the
display is physically connected. If the hostname is not given,
the most efficient way of communicating to a server on the same
machine will be used.
displaynumber
The phrase "display" is usually used to refer to a collection
of monitors that share a common set of input devices (keyboard,
mouse, tablet, etc.). Most workstations tend to only have one
display. Larger, multi-user systems, however, frequently have
several displays so that more than one person can be doing
graphics work at once. To avoid confusion, each display on a
machine is assigned a display number (beginning at 0) when the
X server for that display is started. The display number must
always be given in a display name.
screennumber
Some displays share their input devices among two or more moni‐
tors. These may be configured as a single logical screen,
which allows windows to move across screens, or as individual
screens, each with their own set of windows. If configured
such that each monitor has its own set of windows, each screen
is assigned a screen number (beginning at 0) when the X server
for that display is started. If the screen number is not
given, screen 0 will be used.
On POSIX systems, the default display name is stored in your DISPLAY
environment variable. This variable is set automatically by the xterm
terminal emulator. However, when you log into another machine on a
network, you may need to set DISPLAY by hand to point to your display.
For example,
% setenv DISPLAY myws:0
$ DISPLAY=myws:0; export DISPLAY
The ssh program can be used to start an X program on a remote machine;
it automatically sets the DISPLAY variable correctly.
Finally, most X programs accept a command line option of -display dis‐
playname to temporarily override the contents of DISPLAY. This is most
commonly used to pop windows on another person's screen or as part of a
"remote shell" command to start an xterm pointing back to your display.
For example,
% xeyes -display joesws:0 -geometry 1000x1000+0+0
% rsh big xterm -display myws:0 -ls </dev/null &
X servers listen for connections on a variety of different communica‐
tions channels (network byte streams, shared memory, etc.). Since
there can be more than one way of contacting a given server, The host‐
name part of the display name is used to determine the type of channel
(also called a transport layer) to be used. X servers generally sup‐
port the following types of connections:
local
The hostname part of the display name should be the empty
string. For example: :0, :1, and :0.1. The most efficient
local transport will be chosen.
TCPIP
The hostname part of the display name should be the server
machine's hostname or IP address. Full Internet names, abbre‐
viated names, IPv4 addresses, and IPv6 addresses are all
allowed. For example: x.org:0, expo:0, [::1]:0,
198.112.45.11:0, bigmachine:1, and hydra:0.1.
To get the value of your display you should just be able to run:
echo $DISPLAY
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
@Oyinade: So what is the output ofecho $DISPLAYand what is the output of when you put that output afterxterm -display?
– user364819
May 29 '16 at 22:24
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commandssetenv DISPLAY hostname:0andDISPLAY=hostname:0; export DISPLAY(replacinghostnamewith your actual host name).
– user364819
May 30 '16 at 14:14
add a comment |
In a bash script one way to find the display associated with a user is to run the command who. The useful bits in this case would be the login name and X display.
On a single user system you can usually safely assume that there will only be one user logged on. For a multi user server some logic may need to be applied to choose the correct display.
# process who for a unique list of users with their display as an array
USERLIST=($(/usr/bin/who | /bin/sed -e 's/[)(]//g' -e 's/ +/ /g' | /usr/bin/cut -d ' ' -f1,5 | /usr/bin/sort -u | /usr/bin/tr -d 'n'))
# ${USERLIST[1]:-":0.0"} includes a default guess to be used if the array value is null.
xterm -display "${USERLIST[1]:-":0.0"}"
add a comment |
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/3.0/"u003ecc by-sa 3.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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f778386%2fxterm-error-xt-error-cant-open-display-xterm-display-is-not-set%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is likely due to either a misconfiguration issue or you have multiple displays. As can be seen in the xterm manpage (man xterm) you can set the display using the -display flag:
-display display
This option specifies the X server to contact; see X(7).
If you then look in X(7) where it specifies to look (man X) you will see what you need to put after the flag:
DISPLAY NAMES
From the user's perspective, every X server has a display name of the
form:
hostname:displaynumber.screennumber
This information is used by the application to determine how it should
connect to the server and which screen it should use by default (on
displays with multiple monitors):
hostname
The hostname specifies the name of the machine to which the
display is physically connected. If the hostname is not given,
the most efficient way of communicating to a server on the same
machine will be used.
displaynumber
The phrase "display" is usually used to refer to a collection
of monitors that share a common set of input devices (keyboard,
mouse, tablet, etc.). Most workstations tend to only have one
display. Larger, multi-user systems, however, frequently have
several displays so that more than one person can be doing
graphics work at once. To avoid confusion, each display on a
machine is assigned a display number (beginning at 0) when the
X server for that display is started. The display number must
always be given in a display name.
screennumber
Some displays share their input devices among two or more moni‐
tors. These may be configured as a single logical screen,
which allows windows to move across screens, or as individual
screens, each with their own set of windows. If configured
such that each monitor has its own set of windows, each screen
is assigned a screen number (beginning at 0) when the X server
for that display is started. If the screen number is not
given, screen 0 will be used.
On POSIX systems, the default display name is stored in your DISPLAY
environment variable. This variable is set automatically by the xterm
terminal emulator. However, when you log into another machine on a
network, you may need to set DISPLAY by hand to point to your display.
For example,
% setenv DISPLAY myws:0
$ DISPLAY=myws:0; export DISPLAY
The ssh program can be used to start an X program on a remote machine;
it automatically sets the DISPLAY variable correctly.
Finally, most X programs accept a command line option of -display dis‐
playname to temporarily override the contents of DISPLAY. This is most
commonly used to pop windows on another person's screen or as part of a
"remote shell" command to start an xterm pointing back to your display.
For example,
% xeyes -display joesws:0 -geometry 1000x1000+0+0
% rsh big xterm -display myws:0 -ls </dev/null &
X servers listen for connections on a variety of different communica‐
tions channels (network byte streams, shared memory, etc.). Since
there can be more than one way of contacting a given server, The host‐
name part of the display name is used to determine the type of channel
(also called a transport layer) to be used. X servers generally sup‐
port the following types of connections:
local
The hostname part of the display name should be the empty
string. For example: :0, :1, and :0.1. The most efficient
local transport will be chosen.
TCPIP
The hostname part of the display name should be the server
machine's hostname or IP address. Full Internet names, abbre‐
viated names, IPv4 addresses, and IPv6 addresses are all
allowed. For example: x.org:0, expo:0, [::1]:0,
198.112.45.11:0, bigmachine:1, and hydra:0.1.
To get the value of your display you should just be able to run:
echo $DISPLAY
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
@Oyinade: So what is the output ofecho $DISPLAYand what is the output of when you put that output afterxterm -display?
– user364819
May 29 '16 at 22:24
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commandssetenv DISPLAY hostname:0andDISPLAY=hostname:0; export DISPLAY(replacinghostnamewith your actual host name).
– user364819
May 30 '16 at 14:14
add a comment |
This is likely due to either a misconfiguration issue or you have multiple displays. As can be seen in the xterm manpage (man xterm) you can set the display using the -display flag:
-display display
This option specifies the X server to contact; see X(7).
If you then look in X(7) where it specifies to look (man X) you will see what you need to put after the flag:
DISPLAY NAMES
From the user's perspective, every X server has a display name of the
form:
hostname:displaynumber.screennumber
This information is used by the application to determine how it should
connect to the server and which screen it should use by default (on
displays with multiple monitors):
hostname
The hostname specifies the name of the machine to which the
display is physically connected. If the hostname is not given,
the most efficient way of communicating to a server on the same
machine will be used.
displaynumber
The phrase "display" is usually used to refer to a collection
of monitors that share a common set of input devices (keyboard,
mouse, tablet, etc.). Most workstations tend to only have one
display. Larger, multi-user systems, however, frequently have
several displays so that more than one person can be doing
graphics work at once. To avoid confusion, each display on a
machine is assigned a display number (beginning at 0) when the
X server for that display is started. The display number must
always be given in a display name.
screennumber
Some displays share their input devices among two or more moni‐
tors. These may be configured as a single logical screen,
which allows windows to move across screens, or as individual
screens, each with their own set of windows. If configured
such that each monitor has its own set of windows, each screen
is assigned a screen number (beginning at 0) when the X server
for that display is started. If the screen number is not
given, screen 0 will be used.
On POSIX systems, the default display name is stored in your DISPLAY
environment variable. This variable is set automatically by the xterm
terminal emulator. However, when you log into another machine on a
network, you may need to set DISPLAY by hand to point to your display.
For example,
% setenv DISPLAY myws:0
$ DISPLAY=myws:0; export DISPLAY
The ssh program can be used to start an X program on a remote machine;
it automatically sets the DISPLAY variable correctly.
Finally, most X programs accept a command line option of -display dis‐
playname to temporarily override the contents of DISPLAY. This is most
commonly used to pop windows on another person's screen or as part of a
"remote shell" command to start an xterm pointing back to your display.
For example,
% xeyes -display joesws:0 -geometry 1000x1000+0+0
% rsh big xterm -display myws:0 -ls </dev/null &
X servers listen for connections on a variety of different communica‐
tions channels (network byte streams, shared memory, etc.). Since
there can be more than one way of contacting a given server, The host‐
name part of the display name is used to determine the type of channel
(also called a transport layer) to be used. X servers generally sup‐
port the following types of connections:
local
The hostname part of the display name should be the empty
string. For example: :0, :1, and :0.1. The most efficient
local transport will be chosen.
TCPIP
The hostname part of the display name should be the server
machine's hostname or IP address. Full Internet names, abbre‐
viated names, IPv4 addresses, and IPv6 addresses are all
allowed. For example: x.org:0, expo:0, [::1]:0,
198.112.45.11:0, bigmachine:1, and hydra:0.1.
To get the value of your display you should just be able to run:
echo $DISPLAY
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
@Oyinade: So what is the output ofecho $DISPLAYand what is the output of when you put that output afterxterm -display?
– user364819
May 29 '16 at 22:24
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commandssetenv DISPLAY hostname:0andDISPLAY=hostname:0; export DISPLAY(replacinghostnamewith your actual host name).
– user364819
May 30 '16 at 14:14
add a comment |
This is likely due to either a misconfiguration issue or you have multiple displays. As can be seen in the xterm manpage (man xterm) you can set the display using the -display flag:
-display display
This option specifies the X server to contact; see X(7).
If you then look in X(7) where it specifies to look (man X) you will see what you need to put after the flag:
DISPLAY NAMES
From the user's perspective, every X server has a display name of the
form:
hostname:displaynumber.screennumber
This information is used by the application to determine how it should
connect to the server and which screen it should use by default (on
displays with multiple monitors):
hostname
The hostname specifies the name of the machine to which the
display is physically connected. If the hostname is not given,
the most efficient way of communicating to a server on the same
machine will be used.
displaynumber
The phrase "display" is usually used to refer to a collection
of monitors that share a common set of input devices (keyboard,
mouse, tablet, etc.). Most workstations tend to only have one
display. Larger, multi-user systems, however, frequently have
several displays so that more than one person can be doing
graphics work at once. To avoid confusion, each display on a
machine is assigned a display number (beginning at 0) when the
X server for that display is started. The display number must
always be given in a display name.
screennumber
Some displays share their input devices among two or more moni‐
tors. These may be configured as a single logical screen,
which allows windows to move across screens, or as individual
screens, each with their own set of windows. If configured
such that each monitor has its own set of windows, each screen
is assigned a screen number (beginning at 0) when the X server
for that display is started. If the screen number is not
given, screen 0 will be used.
On POSIX systems, the default display name is stored in your DISPLAY
environment variable. This variable is set automatically by the xterm
terminal emulator. However, when you log into another machine on a
network, you may need to set DISPLAY by hand to point to your display.
For example,
% setenv DISPLAY myws:0
$ DISPLAY=myws:0; export DISPLAY
The ssh program can be used to start an X program on a remote machine;
it automatically sets the DISPLAY variable correctly.
Finally, most X programs accept a command line option of -display dis‐
playname to temporarily override the contents of DISPLAY. This is most
commonly used to pop windows on another person's screen or as part of a
"remote shell" command to start an xterm pointing back to your display.
For example,
% xeyes -display joesws:0 -geometry 1000x1000+0+0
% rsh big xterm -display myws:0 -ls </dev/null &
X servers listen for connections on a variety of different communica‐
tions channels (network byte streams, shared memory, etc.). Since
there can be more than one way of contacting a given server, The host‐
name part of the display name is used to determine the type of channel
(also called a transport layer) to be used. X servers generally sup‐
port the following types of connections:
local
The hostname part of the display name should be the empty
string. For example: :0, :1, and :0.1. The most efficient
local transport will be chosen.
TCPIP
The hostname part of the display name should be the server
machine's hostname or IP address. Full Internet names, abbre‐
viated names, IPv4 addresses, and IPv6 addresses are all
allowed. For example: x.org:0, expo:0, [::1]:0,
198.112.45.11:0, bigmachine:1, and hydra:0.1.
To get the value of your display you should just be able to run:
echo $DISPLAY
This is likely due to either a misconfiguration issue or you have multiple displays. As can be seen in the xterm manpage (man xterm) you can set the display using the -display flag:
-display display
This option specifies the X server to contact; see X(7).
If you then look in X(7) where it specifies to look (man X) you will see what you need to put after the flag:
DISPLAY NAMES
From the user's perspective, every X server has a display name of the
form:
hostname:displaynumber.screennumber
This information is used by the application to determine how it should
connect to the server and which screen it should use by default (on
displays with multiple monitors):
hostname
The hostname specifies the name of the machine to which the
display is physically connected. If the hostname is not given,
the most efficient way of communicating to a server on the same
machine will be used.
displaynumber
The phrase "display" is usually used to refer to a collection
of monitors that share a common set of input devices (keyboard,
mouse, tablet, etc.). Most workstations tend to only have one
display. Larger, multi-user systems, however, frequently have
several displays so that more than one person can be doing
graphics work at once. To avoid confusion, each display on a
machine is assigned a display number (beginning at 0) when the
X server for that display is started. The display number must
always be given in a display name.
screennumber
Some displays share their input devices among two or more moni‐
tors. These may be configured as a single logical screen,
which allows windows to move across screens, or as individual
screens, each with their own set of windows. If configured
such that each monitor has its own set of windows, each screen
is assigned a screen number (beginning at 0) when the X server
for that display is started. If the screen number is not
given, screen 0 will be used.
On POSIX systems, the default display name is stored in your DISPLAY
environment variable. This variable is set automatically by the xterm
terminal emulator. However, when you log into another machine on a
network, you may need to set DISPLAY by hand to point to your display.
For example,
% setenv DISPLAY myws:0
$ DISPLAY=myws:0; export DISPLAY
The ssh program can be used to start an X program on a remote machine;
it automatically sets the DISPLAY variable correctly.
Finally, most X programs accept a command line option of -display dis‐
playname to temporarily override the contents of DISPLAY. This is most
commonly used to pop windows on another person's screen or as part of a
"remote shell" command to start an xterm pointing back to your display.
For example,
% xeyes -display joesws:0 -geometry 1000x1000+0+0
% rsh big xterm -display myws:0 -ls </dev/null &
X servers listen for connections on a variety of different communica‐
tions channels (network byte streams, shared memory, etc.). Since
there can be more than one way of contacting a given server, The host‐
name part of the display name is used to determine the type of channel
(also called a transport layer) to be used. X servers generally sup‐
port the following types of connections:
local
The hostname part of the display name should be the empty
string. For example: :0, :1, and :0.1. The most efficient
local transport will be chosen.
TCPIP
The hostname part of the display name should be the server
machine's hostname or IP address. Full Internet names, abbre‐
viated names, IPv4 addresses, and IPv6 addresses are all
allowed. For example: x.org:0, expo:0, [::1]:0,
198.112.45.11:0, bigmachine:1, and hydra:0.1.
To get the value of your display you should just be able to run:
echo $DISPLAY
edited May 27 '16 at 22:33
answered May 27 '16 at 22:26
user364819
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
@Oyinade: So what is the output ofecho $DISPLAYand what is the output of when you put that output afterxterm -display?
– user364819
May 29 '16 at 22:24
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commandssetenv DISPLAY hostname:0andDISPLAY=hostname:0; export DISPLAY(replacinghostnamewith your actual host name).
– user364819
May 30 '16 at 14:14
add a comment |
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
@Oyinade: So what is the output ofecho $DISPLAYand what is the output of when you put that output afterxterm -display?
– user364819
May 29 '16 at 22:24
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commandssetenv DISPLAY hostname:0andDISPLAY=hostname:0; export DISPLAY(replacinghostnamewith your actual host name).
– user364819
May 30 '16 at 14:14
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
This is not working for me, do you have any other suggestions please ?
– Oyinade
May 29 '16 at 22:19
@Oyinade: So what is the output of
echo $DISPLAY and what is the output of when you put that output after xterm -display ?– user364819
May 29 '16 at 22:24
@Oyinade: So what is the output of
echo $DISPLAY and what is the output of when you put that output after xterm -display ?– user364819
May 29 '16 at 22:24
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
'echo $DISPLAY' gives a blank result while 'xterm -display' gives xterm: Xt error : Can't open display: xterm : DISPLAY is not set
– Oyinade
May 29 '16 at 22:51
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commands
setenv DISPLAY hostname:0 and DISPLAY=hostname:0; export DISPLAY (replacing hostname with your actual host name).– user364819
May 30 '16 at 14:14
Do you know what your hostname is? Your display number? And your screen number? Or at least your hostname because you could try running the commands
setenv DISPLAY hostname:0 and DISPLAY=hostname:0; export DISPLAY (replacing hostname with your actual host name).– user364819
May 30 '16 at 14:14
add a comment |
In a bash script one way to find the display associated with a user is to run the command who. The useful bits in this case would be the login name and X display.
On a single user system you can usually safely assume that there will only be one user logged on. For a multi user server some logic may need to be applied to choose the correct display.
# process who for a unique list of users with their display as an array
USERLIST=($(/usr/bin/who | /bin/sed -e 's/[)(]//g' -e 's/ +/ /g' | /usr/bin/cut -d ' ' -f1,5 | /usr/bin/sort -u | /usr/bin/tr -d 'n'))
# ${USERLIST[1]:-":0.0"} includes a default guess to be used if the array value is null.
xterm -display "${USERLIST[1]:-":0.0"}"
add a comment |
In a bash script one way to find the display associated with a user is to run the command who. The useful bits in this case would be the login name and X display.
On a single user system you can usually safely assume that there will only be one user logged on. For a multi user server some logic may need to be applied to choose the correct display.
# process who for a unique list of users with their display as an array
USERLIST=($(/usr/bin/who | /bin/sed -e 's/[)(]//g' -e 's/ +/ /g' | /usr/bin/cut -d ' ' -f1,5 | /usr/bin/sort -u | /usr/bin/tr -d 'n'))
# ${USERLIST[1]:-":0.0"} includes a default guess to be used if the array value is null.
xterm -display "${USERLIST[1]:-":0.0"}"
add a comment |
In a bash script one way to find the display associated with a user is to run the command who. The useful bits in this case would be the login name and X display.
On a single user system you can usually safely assume that there will only be one user logged on. For a multi user server some logic may need to be applied to choose the correct display.
# process who for a unique list of users with their display as an array
USERLIST=($(/usr/bin/who | /bin/sed -e 's/[)(]//g' -e 's/ +/ /g' | /usr/bin/cut -d ' ' -f1,5 | /usr/bin/sort -u | /usr/bin/tr -d 'n'))
# ${USERLIST[1]:-":0.0"} includes a default guess to be used if the array value is null.
xterm -display "${USERLIST[1]:-":0.0"}"
In a bash script one way to find the display associated with a user is to run the command who. The useful bits in this case would be the login name and X display.
On a single user system you can usually safely assume that there will only be one user logged on. For a multi user server some logic may need to be applied to choose the correct display.
# process who for a unique list of users with their display as an array
USERLIST=($(/usr/bin/who | /bin/sed -e 's/[)(]//g' -e 's/ +/ /g' | /usr/bin/cut -d ' ' -f1,5 | /usr/bin/sort -u | /usr/bin/tr -d 'n'))
# ${USERLIST[1]:-":0.0"} includes a default guess to be used if the array value is null.
xterm -display "${USERLIST[1]:-":0.0"}"
answered Dec 13 '17 at 7:56
J. StarnesJ. Starnes
1,456416
1,456416
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f778386%2fxterm-error-xt-error-cant-open-display-xterm-display-is-not-set%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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