Ubuntu – When starting gparted “Gtk-WARNING **: cannot open display:”

gpartedpartitioning

This is exactly my problem. running ubuntu server 12.04. sorry I couldn't find a way to mark the thread "unanswered".

Resize a 2TB partition on a 3TB disk created with fdisk

I downloaded and installed gparted – however I get an errors when trying to run it. can you guys help me? my terminal output is below:

keysersoze@the-usual-suspects:/$ sudo gparted /dev/sda

(gpartedbin:18064): Gtk-WARNING **: cannot open display:
keysersoze@the-usual-suspects:/$

note that I am fairly new to linux. thanks for your patience.

Best Answer

The trick here is to use an Xserver on another machine to display the GUI elements you can't see on a server. Set the environment variable to the local machine running the Xserver. Where this is an IP address and the screen # on the X server.

export DISPLAY="192.168.1.5:0"

then run :

sudo gparted 

With another Ubuntu machine you will need to change firewall rules to allow this. Using windows you can do this with MobaXterm which runs a local X server.

Related Question