Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a problem with nautilus in Ubuntu 12.04 LTS.

When I run command "gksu nautilus /" password ask box appear and I type my super-user password , than password box is disappear and nautilus is not open.

When I try to open nautilus via normal user in command box "nautilus" the folder is opened up.

When I try in terminal ...

$sudo nautilus

I got the following error

$ sudo nautilus /

** (nautilus:8523): WARNING **: Command line `dbus-launch --autolaunch=2c8ce9b7da2257c2609b749700000007 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n Could not parse arguments: Cannot open display:

How can I fix this error?

share|improve this question
You could also try installing nemo (linux mint file browser), which has an "open as root" option. – user132550 Feb 16 '13 at 11:06
sudo su nautilus this worked for me too, assuming you set up your root password and sign in – bmendonc Jul 1 '13 at 0:16


gksudo nautilus

Then type your own password just like when using sudo.

Gksudo man page:

share|improve this answer
yes, I type my own password ,but no folder window open up. – Pho swan Jun 28 '12 at 7:17
I use Ubuntu 12.04 LTS 2 week ago, and i m ok will gksu nautilus command. and yesterday, I face with that problem, type comand " gksu nautilus / " and I type my password . no folder window open up .. so, i cant edit some file in root. – Pho swan Jun 28 '12 at 7:26
what about: "DISPLAY=:0 gksudo nautilus" or debug mode "gksudo -d nautilus" – jaywink Jun 28 '12 at 9:35

When opening Nautilus with root privileges, it is best to use the command


unless your root account is unlocked, and in that case, Ubuntu discourages this.

The reason for the "gk" is because sudo, by itself, doesn't perform the necessary actions automatically to properly run graphical applications as another user.

However for instance, if you were on a KDE system such as Kubuntu, you would want to issue the command


p.s. Do not leave your Nautilus root window open when you are not using it,then forgetting about it, as using a window you do not know is root is a bad idea.

For more information view the Ubuntu man page for gksudo here.

share|improve this answer

If you find yourself opening nautilus as root often, I would recommend adding the option to the right-click menu in Unity: (it uses the same command as the top answer, gksu nautilus).

You will need to edit a *.desktop file in order to add the menu option, and you have two choices:

  • /usr/share/applications/nautilus.desktop (requires root access to edit) - The menu option will be added for all users. Note that you may need to re-edit this file, adding the option if an update to Nautilus occurrs that overwrites your changes.
  • ~/.local/share/applications/nautilus.desktop (If you can't find it there, make a duplicate of the one found in /usr/share/applications/, and save it to this new location) - The menu option will only be available for the specified user, and is considered "better practice". Note that if you already have it docked to your Unity bar, you will need to choose Unlock from Launcher on your existing Nautilus icon (by default shows up as named Files), then re-add your "custom" version. These changes should stay even if Nautilus gets an update.

Edit the text file nautilus.desktop, adding the following block of code (you can use the existing two blocks as a template):

[Desktop Action RootWindow]
Name=Open a Root Window
Exec=gksu nautilus

Next, add the new action to the list (should be at around line 18 of the text file):


Now right-clicking the text editor window in Unity brings up this handy new option:

Ubuntu Unity: Open Nautilus as Root

share|improve this answer
I was trying this except for file nautilus.desktop is not exist on my Ubuntu 15.10 ! – Ihab Abdel-Rahim Dec 15 '15 at 9:36
@IhabAbdel-Rahim That's strange, it exists on mine at /usr/share/applications/nautilus.desktop, and I just did a fresh install a month ago. – IQAndreas Dec 18 '15 at 21:34
Yeah, I found it. Thanks – Ihab Abdel-Rahim Dec 19 '15 at 1:20

"sudo nautilus" works for me. Here are some alternatives:

Enter superuser mode with "sudo su" in the terminal (will ask for your password), then run the commands from there:

sudo su

Another alternative is to use something else for file exploration than nautilus, something that does not require graphical environment. GNU Midnight Commander - mc comes to mind. You can install and run it like this:

sudo apt-get install mc

Your error messages suggest that the root "Cannot open display". The reason might be that the DISPLAY environment is not properly set up. You can check it from the terminal like this:

printenv | grep DISPLAY

You should see something like DISPLAY=:0.0 in response. If not, take care of the display environment for the root first.

share|improve this answer

Open terminal and type the following:

sessionfile=$(find "${HOME}/.dbus/session-bus/" -type f)
export $(grep "DBUS_SESSION_BUS_ADDRESS=" "${sessionfile}" | sed '/^#/d')

Try running your command again (sudo nautilus).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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