You are not logged in.
Pages: 1
I just installed arch and kde. Everything was fine until I noticed that after I run vim as root I get weird errors. More specifically the error is:
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key
It's not preventing me from doing anything, but it's annoying nonetheless. Does anyone know how to fix this?
Offline
Do you have gvim installed ? If it is installed, and you don't use the Gui for vim, remove the gvim package and see if the messages still display.
Offline
No I did not have gvim installed. I installed it to see if it would have the same problem and this is the error it gave when I tried to start gvim as root:
Invalid MIT-MAGIC-COOKIE-1 keyE233: cannot open displayInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key
Press ENTER or type command to continue
At which point I would get thrown into regular console vim. Gvim worked fine under a regular account. I uninstalled it and the original problem persists.
Offline
whats the value of the $DISPLAY variable for root when you run vim? is it the same as for you regular user? (the one that's running the X session)
Offline
echoing $DISPLAY gave ":0.0" for both regular user and root.
Fooling around I noticed that if I overwrite /root/.Xauthority with my regular user's ~/.Xauthority the problem goes away, but comes back after reboot. I have an old laptop running arch and Xfce, the /root/.Xauthority file on there is blank and everything works fine with no warnings or errors. If I just have a blank /root/.Xauthority on this machine, instead of getting the magic cookie errors I instead get this:
No protocol specified
No protocol specified
No protocol specified
My guess is there is a security setting somewhere that I can change to not require a valid .Xauthority for root, but I don't know where that is.
Offline
Having the exact same problem here... uninstalled gvim to no avail.
echoing $DISPLAY gave ":0.0" for both regular user and root.
doing a
xhost +
as per the suggestion on the website below as user makes the error dissappear.
http://forums.opensuse.org/install-boot … -help.html
Not entirely sure what it does though.
Last edited by onguarde (2009-06-22 14:00:00)
Offline
you should ditch xhost (xhost is dangerous security-wise) and just use kdesu programm-of-choice if you need a programm with root-priviliges or gksu wich does the same
Offline
The method posted by @onguarde is NOT recommened as Access is granted to everyone, even if they aren't on the list to open windows on your machine.
As normal user, you should run:
xhost local:root
and then root will be able to open X programs. You can edit /root/.bashrc and add the following line:
export XAUTHORITY=/home/username/.Xauthority
Where "username" is the user account name that you use. After editing /root/.bashrc, you won't have to issue the command "xhost local:root" anymore after X starts.
OR even simpler, make a symbolic link to the current - correct - cookie (not tested this but I think it might work):
su -
cd /root (if not already there)
ln -sf /home/username/.Xauthority
But as @parintachin said is better to run GUI programs with root privileges using ALT+F2 and kdesu(if using KDE) or gksu(if using GNOME) + name of the application.
I know this thread is a little bit old, but I faced this problem today and wanted to help in some way or another.
Last edited by Mahara (2010-04-05 12:00:29)
Offline
Thank you Mahara, your solution did it for me, everything was running fine in my system until I decided to try KDE 4.6 and Gnome 3, I don't know which of the enviroments messed it for me but now everything is fine.
Thanks a lot!
Archlinux KDE user.
Offline
Please mark your thread as solved
Offline
I had this problem in Debian because 'vim' was ultimately a symbolic link to 'vim.gtk' instead of 'vim.basic', and the solution was to run
update-alternatives --config vim
I found this thread while searching for the MIT cookie error, so I am posting this here in case other Debian users happen upon it like I did.
Offline
Pages: 1