Форум русскоязычного сообщества Ubuntu


Получить помощь и пообщаться с другими пользователями Ubuntu можно
на irc канале #ubuntu-ru в сети Freenode
и в Jabber конференции ubuntu@conference.jabber.ru

Автор Тема: Не удалось открыть дисплей (Could not open X display)  (Прочитано 35885 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #15 : 13 Марта 2013, 12:15:23 »
cat ~/.bashrc?
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #16 : 13 Марта 2013, 12:28:15 »
root@fp-anykey:/home/salvador# cat ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
    else
color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion
#fi

Пользователь решил продолжить мысль 13 Марта 2013, 12:34:57:
на freebsd есть файлик /etc/ttys, где описаны консоли. Так вот в убунте его нету, суть в том, там есть номера дисплеев, который занимает консоль.
Это я к тому, что man x | grep DISPLAY
У меня сейчас работает tty7, логично я сделал экспорт
export DISPLAY=localhost:7.0
ну собственно вот что получилось:
root@fp-anykey:/home/salvador# gedit

** (gedit:20340): WARNING **: Could not open X display
Не удалось открыть дисплей:
Запустите «gedit --help» для получения полного списка поддерживаемых ключей.
« Последнее редактирование: 13 Марта 2013, 12:34:57 от Salvador21 »
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #17 : 13 Марта 2013, 12:42:41 »
ssh клиент??
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #18 : 13 Марта 2013, 12:46:01 »
нет Ubuntu стоит на этом компе. Имеете ввиду ssh -X ?
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #19 : 13 Марта 2013, 13:01:31 »
Salvador21,
1
ALT+F2
gnome-terminalвыполнить

2
xterm?
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #20 : 13 Марта 2013, 13:07:42 »
под моим логином работает, а из под рута никак
root@fp-anykey:/home/salvador# xterm
xterm: Xt error: Can't open display: %s
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #21 : 13 Марта 2013, 13:13:09 »
Цитировать
под моим логином работает
если
sudo xterm?
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #22 : 13 Марта 2013, 13:15:51 »
salvador@fp-anykey:~$ sudo xterm
[sudo] password for salvador:
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm: Xt error: Can't open display: %s
xterm: DISPLAY is not set
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #23 : 13 Марта 2013, 13:19:23 »
cat /etc/passwd | grep root
cat /etc/environment
?
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #24 : 13 Марта 2013, 13:21:46 »
salvador@fp-anykey:~$ cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bash
salvador@fp-anykey:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
http_proxy="http://proxy.finpar.lan:3128/"
https_proxy="https://proxy.finpar.lan:3128/"
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #25 : 13 Марта 2013, 13:33:19 »
$ и #
xhost?
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #26 : 13 Марта 2013, 13:34:03 »
root@fp-anykey:/home/salvador# xhost
xhost:  unable to open display ""
salvador@fp-anykey:~$ xhost
xhost:  unable to open display "localhost:0"

« Последнее редактирование: 13 Марта 2013, 13:38:40 от Salvador21 »
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #27 : 13 Марта 2013, 13:43:24 »
sudo grep -Rs "env_reset" /etc?
Wars ~.o

Оффлайн Salvador21

  • Автор темы
  • Любитель
  • *
  • Сообщений: 59
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #28 : 13 Марта 2013, 13:44:29 »
salvador@fp-anykey:~$ sudo grep -Rs "env_reset" /etc
[sudo] password for salvador:
/etc/sudoers:Defaults env_reset
/etc/sudoers~:Defaults env_reset
-Доктор, что это у меня?
-Аааа, что это у вас?

Оффлайн victor00000

  • Старожил
  • *
  • Сообщений: 15568
  • Глухонемой (Deaf)
    • Просмотр профиля
Re: Не удалось открыть дисплей (Could not open X display)
« Ответ #29 : 13 Марта 2013, 13:47:38 »
sudo diff '/etc/sudoers~' '/etc/sudoers'?
Wars ~.o

 

Страница сгенерирована за 0.038 секунд. Запросов: 23.