Is /etc/X11/xinit/xinitrc. supposed not to exist?

5,059

If you have the xinit package, the file you mention should be installed.

$ dpkg -L xinit | grep xinitrc
/etc/X11/xinit/xinitrc
$

If it's not, these commands ought to fix it:

sudo apt-get purge xinit
sudo apt-get install xinit
Share:
5,059
user280121
Author by

user280121

Updated on September 18, 2022

Comments

  • user280121
    user280121 over 1 year

    I'm trying to connect to Amazon EC2 Ubuntu 14.04 instance through VNC but always fail (only grey background). Some articles say we should have a line in .vnc/xstartup which reads exec sh /etc/X11/xinit/xinitrc But I checked this file and found that this file does not exist at all in EC2 Ubuntu. So if sh /etc/X11/xinit/xinitrc is executed, there should be an error like

    sh: 0: Can't open  ...
    

    I guess that this is the reason why I can not display the desktop of EC2 ubuntu from TightVNC (I can successfully connect). So my question is: is /etc/X11/xinit/xinitrc supposed not to exist? If so, what happens if the execution of sh /etc/X11/xinit/xinitrc fails? If it should exist, what contents should this file contain?

    • Gunnar Hjalmarsson
      Gunnar Hjalmarsson over 9 years
      The file belongs to the xinit package, so you may want to install (or reinstall) xinit.
    • user280121
      user280121 over 9 years
      Yes, I have installed xinit package. I know that by running a command dpkg -l|grep xinit and seeing xinit in the results output.
    • Gunnar Hjalmarsson
      Gunnar Hjalmarsson over 9 years
      Then purge it and install it again to get /etc/X11/xinit/xinitrc.
    • user280121
      user280121 over 9 years
      @Gunnar Hjalmarsson: I did, no use.
    • Gunnar Hjalmarsson
      Gunnar Hjalmarsson over 9 years
      Strange. (I still posted an answer to clarify.)
  • user280121
    user280121 over 9 years
    Thank you for the answer. I tried your method again, this time /etc/X11/xinit/xinitrc appeared, with a line ". /etc/X11/Xsession" in it. But I still only get a grey screen in the remote desktop when connecting.
  • Gunnar Hjalmarsson
    Gunnar Hjalmarsson over 9 years
    @user280121: Then the cause for the problem is something else. Can't help with that, I'm afraid.