I'm accessing my Raspberry Pi 3 with PuTTY, and using X11 programs like GParted through ssh connection. It was perfectly working until I turned off IPv6 by adding the following line to /etc/sysctl.conf.

net.ipv6.conf.all.disable_ipv6 = 1

It does disable IPv6, but it makes X11 programs stop starting. It always shows message something like

pi@RPi-Dev:~$ sudo -E gparted
[sudo] password for pi:

(gpartedbin:1173): Gtk-WARNING **: cannot open display:

Why does disabling ipv6 cause it and how can I fix it?

  • Don't disable IPv6. It is not going away and you will need it sooner or later. – Michael Hampton Dec 15 '16 at 8:03

The method I used to specify disabling command in /etc/sysctl.conf wasn't the right way. It did disabled IPv6 like other Debian based distributions, but what I had to do was adding following command in /boot/cmdline.txt.


Everything worked fine after adding the command in the file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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