I want sublime text editor open via sublime command, i've all ok for install sublime text 2, but when type sublime in terminal then showing me error, see below, anyone know how i can fix this ?

root@tmdwc:~# sublime
(sublime:22192): Gtk-WARNING **: cannot open display:

marked as duplicate by muru, heemayl, Eric Carvalho, kiri, Eliah Kagan Apr 25 '15 at 18:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


If you download sublime text 2 from here, you will get Sublime Text 2.0.2.tar.bz2

After unpacking archive with command

tar xfvj Sublime\ Text\ 2.0.2.tar.bz2

you will get directory Sublime Text 2, go to dir

cd  /path_to_dir/Sublime Text 2

and start text editor with command


If you want to start text editor only with command sublime create sim link in /usr/bin

cd /usr/bin
sudo ln -s /path_to_dir/Sublime\ Text\ 2/sublime_text sublime

This link will allow to run text editor with command sublime

First part of problem is solved.

Exporting X Display via ssh you can have with option -X

ssh -l username ssh_server -X

With this command probably you will get your text editor in you display.

  • username means root@tmdw ? and ssh_server ? @2707974 – Rasel Khan Apr 24 '15 at 7:46
  • you also can use command in format ssh root@tmdw -X. In command ssh -l username ssh_server -X, -l - mean login name on server. command ssh root@tmdw -X is the same like ssh -l root tmdw -X – 2707974 Apr 24 '15 at 7:51
  • root@tmdwc:~# ssh -l root@tmdwc ssh_server -X not working – Rasel Khan Apr 24 '15 at 7:55
  • only ssh root@tmdwc -X or ssh -l root tmdwc -X – 2707974 Apr 24 '15 at 7:57
  • root@tmdwc:~# ssh root@tmdwc -X root@tmdwc's password: Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64) * Documentation: help.ubuntu.com Last login: Fri Apr 24 07:58:17 2015 from tmdwc root@tmdwc:~# sublime (sublime:27953): Gtk-WARNING **: cannot open display: ` – Rasel Khan Apr 24 '15 at 7:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.