16:10 - Wednesday, 23 April 2014

Shipping Default Xorg.conf File In Ubuntu 12.04

With recent versions of Ubuntu, there’s no /etc/X11/xorg.conf file being shipped anymore. That’s good as long as you don’t have a Nvidia graphics cards and you want to use multiple screens, in which case you have to allow normal users to write to /etc/X11/xorg.conf.

Now, given that Ubuntu doesn’t ship a default /etc/X11/xorg.conf file, I can’t chmod 666 it (no file to change permissions on).

If I try to ship a default xorg.conf file with puppet (and set the permissions accordingly so that normal user can overwrite that file), puppet will keep overwriting this file in case it changes from the shipped default.

So what are my options here?

  1. Is there a way to ship a default file with puppet but tell puppet to not overwrite customized versions of that file?
  2. Is there a way to tell the xorg-x11 package to create a default xorg.conf file?
  3. Polkit?

any other options that I’m not aware of?

I found a solution that works with puppet: in the file section, you need to include replace => "no". By default puppet will ship the right xorg.conf file, but once a user modifies it, the modification won’t be overwritten.

    file { "$name":            replace => "no",            mode => 666,            owner => root,            group => root,            ensure => present,    }

NVidia provide a tool for users to configure their screen (resolution, dual-screen, etc.). You just need to deploy this application and give the user proper rights to execute it.

So you should configure /etc/sudoers so that your users can do:

sudo nvidia-xconfig