LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-12-2022, 08:57 AM   #1
makem
Member
 
Registered: Nov 2013
Posts: 209

Rep: Reputation: Disabled
Unable to save /etc/X11xorg.conf for writing


I am using Ubuntu 21.10 with an XFCE desktop on two monitors. I have an ASUS TUF Z590 gfx card installed using nvidia drivers 'nvidia-driver-470 (proprietary tested) from the repository Additional Drivers. The card and drivers are working correctly.

I want to set up the two monitors and for this I use nvidia-settings. When I have completed the settings I select 'Save to X Configuration File' where I am required to authorise and get an error:

Unable to open X config file '/etc/X11/xorg.conf' for writing.

I notice that the is a 'Browse' button to allow me to select an alternative location but I have no idea where to put the settings file. I tried Desktop and again need to authorise, but again get the same error.

When these settings are saved I understand I also need to make sure XFCE settings match.

It seems strange that nvidia-settings allows you to change the settings but not be able to save them. There must be a reason for this so, can anyone enlighten me please?

The contents of the terminal are:

Code:
makem@makems-TUF:~$ nvidia-settings

(nvidia-settings:3600): GLib-GObject-CRITICAL **: 13:42:40.007: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
** Message: 13:42:40.159: PRIME: No offloading required. Abort
** Message: 13:42:40.159: PRIME: is it supported? no

WARNING:  Unable to parse X.Org version string.


WARNING:  Unable to parse X.Org version string.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
Error executing /usr/share/screen-resolution-extra/nvidia-polkit: Permission denied

ERROR: Unable to open X config file '/etc/X11/xorg.conf' for writing.


WARNING:  Unable to parse X.Org version string.


WARNING:  Unable to parse X.Org version string.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found

WARNING:  Unable to parse X.Org version string.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
Error executing /usr/share/screen-resolution-extra/nvidia-polkit: Permission denied

ERROR: Unable to open X config file '/home/makem/Desktop/20-nvidia.conf' for writing.

makem@makems-TUF:~$
Edit: Solved thanks to this post:

https://ubuntuforums.org/showthread.php?t=1482283

But I would still like to know why a workaround needs to be used.

Last edited by makem; 01-12-2022 at 09:18 AM.
 
Old 01-12-2022, 09:25 AM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Who owns /etc/X11 and /etc/X11/xorg.conf, is it root? Are you trying to write to it as root or user?

Quote:
Error executing /usr/share/screen-resolution-extra/nvidia-polkit: Permission denied
 
Old 01-12-2022, 09:54 AM   #3
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,148
Blog Entries: 21

Rep: Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483Reputation: 3483
Code:
sudo cp  /etc/X11/xorg.conf  /etc/X11/xorg.conf.old
The one named old is now your backup. Now you can edit your original.
 
Old 01-12-2022, 10:45 PM   #4
johnprogrammer
Member
 
Registered: Jan 2022
Distribution: Manjaro Linux, Ubuntu in Windows 11 WSL2
Posts: 35

Rep: Reputation: Disabled
Quote:
Originally Posted by makem View Post
I am using Ubuntu 21.10 with an XFCE desktop on two monitors. I have an ASUS TUF Z590 gfx card installed using nvidia drivers 'nvidia-driver-470 (proprietary tested) from the repository Additional Drivers. The card and drivers are working correctly.

I want to set up the two monitors and for this I use nvidia-settings. When I have completed the settings I select 'Save to X Configuration File' where I am required to authorise and get an error:

Unable to open X config file '/etc/X11/xorg.conf' for writing.
In most situations, NVIDIA users need to do the following:

1. sudo rm /etc/X11/xorg.conf

2. sudo nvidia-xconfig

3. run nvidia-settings, make their adjustments, and then quit. The settings are stored in ~/.nvidia-settings-rc automatically.

4. Create a start up entry, in your desktop environment, to run the command: nvidia-settings -l (that's a lowercase L) when you log in.

That's it.

Last edited by johnprogrammer; 01-12-2022 at 10:46 PM.
 
Old 01-15-2022, 12:54 AM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,877
Blog Entries: 1

Rep: Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078
Quote:
Originally Posted by johnprogrammer View Post
In most situations, NVIDIA users need to do the following:
1. sudo rm /etc/X11/xorg.conf
I think not "most". Xorg has gotten smart over the years. Automagic now works for the vast majority of users, main exception being NVidia users of non-FOSS graphics drivers. The only installations I've made in recent years on which /etc/X11/xorg.conf was created by default are Mageia, where I usually replace the original with one of zero bytes and make it immutable. Debian, Fedora, Mint, openSUSE & *buntu haven't created on here in well over a decade. I suspect Manjaro, Arch, Gentoo, most of the bazillion Debian/Ubuntu derivatives, and others, don't create one either.
 
Old 01-15-2022, 06:46 AM   #6
makem
Member
 
Registered: Nov 2013
Posts: 209

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnprogrammer View Post
In most situations, NVIDIA users need to do the following:

1. sudo rm /etc/X11/xorg.conf

2. sudo nvidia-xconfig

3. run nvidia-settings, make their adjustments, and then quit. The settings are stored in ~/.nvidia-settings-rc automatically.

4. Create a start up entry, in your desktop environment, to run the command: nvidia-settings -l (that's a lowercase L) when you log in.

That's it.
xorg.conf is automatically created.

sudo nvidia-xconfig backs up xorg.conf and creates a new one (Wipes out any changes I made previously I assume)

running nvidia-settings allows me in a roundabout way to make settings I want (Those which were wiped above)

I fail to see what I would have achieved, am I missing something?

Would I really have to run nvidia-settings on every boot?
 
Old 01-15-2022, 11:46 PM   #7
johnprogrammer
Member
 
Registered: Jan 2022
Distribution: Manjaro Linux, Ubuntu in Windows 11 WSL2
Posts: 35

Rep: Reputation: Disabled
Quote:
Originally Posted by makem View Post
xorg.conf is automatically created.

sudo nvidia-xconfig backs up xorg.conf and creates a new one (Wipes out any changes I made previously I assume)

running nvidia-settings allows me in a roundabout way to make settings I want (Those which were wiped above)

I fail to see what I would have achieved, am I missing something?

Would I really have to run nvidia-settings on every boot?
With nvidia-settings, all settings are saved to ~/.nvidia-settings-rc, when you close it.

At least in Manjaro, I need to run nvidia-settings -l after login, to load the saved settings.
 
Old 01-16-2022, 12:24 PM   #8
makem
Member
 
Registered: Nov 2013
Posts: 209

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnprogrammer View Post
With nvidia-settings, all settings are saved to ~/.nvidia-settings-rc, when you close it.

At least in Manjaro, I need to run nvidia-settings -l after login, to load the saved settings.
contents of .nvidia-settings-rc:

Code:
#
# Configuration file for nvidia-settings - the NVIDIA X Server Settings utility
# Generated on Wed Jan 12 15:08:38 2022
#

# ConfigProperties:

RcFileLocale = C
DisplayStatusBar = Yes
SliderTextEntries = Yes
IncludeDisplayNameInConfigFile = No
ShowQuitDialog = Yes
UpdateRulesOnProfileNameChange = Yes
Timer = PowerMizer_Monitor_(GPU_0),Yes,1000
Timer = Thermal_Monitor_(GPU_0),Yes,1000
Timer = Memory_Used_(GPU_0),Yes,3000

# Attributes:

0/SyncToVBlank=1
0/LogAniso=0
0/FSAA=0
0/TextureClamping=1
0/FXAA=0
0/AllowFlipping=1
0/FSAAAppControlled=1
0/LogAnisoAppControlled=1
0/OpenGLImageSettings=1
0/FSAAAppEnhanced=0
0/ShowGraphicsVisualIndicator=0
[DPY:DP-0]/RedBrightness=0.000000
[DPY:DP-0]/GreenBrightness=0.000000
[DPY:DP-0]/BlueBrightness=0.000000
[DPY:DP-0]/RedContrast=0.000000
[DPY:DP-0]/GreenContrast=0.000000
[DPY:DP-0]/BlueContrast=0.000000
[DPY:DP-0]/RedGamma=1.000000
[DPY:DP-0]/GreenGamma=1.000000
[DPY:DP-0]/BlueGamma=1.000000
[DPY:DP-0]/Dithering=0
[DPY:DP-0]/DitheringMode=0
[DPY:DP-0]/DitheringDepth=0
[DPY:DP-0]/DigitalVibrance=0
[DPY:DP-0]/ColorSpace=0
[DPY:DP-0]/ColorRange=0
[DPY:DP-0]/SynchronousPaletteUpdates=0
[DPY:DP-1]/Dithering=0
[DPY:DP-1]/DitheringMode=0
[DPY:DP-1]/DitheringDepth=0
[DPY:DP-1]/ColorSpace=0
[DPY:DP-1]/ColorRange=0
[DPY:DP-1]/SynchronousPaletteUpdates=0
[DPY:HDMI-0]/RedBrightness=0.000000
[DPY:HDMI-0]/GreenBrightness=0.000000
[DPY:HDMI-0]/BlueBrightness=0.000000
[DPY:HDMI-0]/RedContrast=0.000000
[DPY:HDMI-0]/GreenContrast=0.000000
[DPY:HDMI-0]/BlueContrast=0.000000
[DPY:HDMI-0]/RedGamma=1.000000
[DPY:HDMI-0]/GreenGamma=1.000000
[DPY:HDMI-0]/BlueGamma=1.000000
[DPY:HDMI-0]/Dithering=0
[DPY:HDMI-0]/DitheringMode=0
[DPY:HDMI-0]/DitheringDepth=0
[DPY:HDMI-0]/DigitalVibrance=0
[DPY:HDMI-0]/ColorSpace=0
[DPY:HDMI-0]/ColorRange=0
[DPY:HDMI-0]/SynchronousPaletteUpdates=0
[DPY:DP-2]/Dithering=0
[DPY:DP-2]/DitheringMode=0
[DPY:DP-2]/DitheringDepth=0
[DPY:DP-2]/ColorSpace=0
[DPY:DP-2]/ColorRange=0
[DPY:DP-2]/SynchronousPaletteUpdates=0
[DPY:DP-3]/Dithering=0
[DPY:DP-3]/DitheringMode=0
[DPY:DP-3]/DitheringDepth=0
[DPY:DP-3]/ColorSpace=0
[DPY:DP-3]/ColorRange=0
[DPY:DP-3]/SynchronousPaletteUpdates=0
[DPY:HDMI-1]/Dithering=0
[DPY:HDMI-1]/DitheringMode=0
[DPY:HDMI-1]/DitheringDepth=0
[DPY:HDMI-1]/ColorSpace=0
[DPY:HDMI-1]/ColorRange=0
[DPY:HDMI-1]/SynchronousPaletteUpdates=0
[DPY:DP-4]/Dithering=0
[DPY:DP-4]/DitheringMode=0
[DPY:DP-4]/DitheringDepth=0
[DPY:DP-4]/ColorSpace=0
[DPY:DP-4]/ColorRange=0
[DPY:DP-4]/SynchronousPaletteUpdates=0
[DPY:DP-5]/Dithering=0
[DPY:DP-5]/DitheringMode=0
[DPY:DP-5]/DitheringDepth=0
[DPY:DP-5]/ColorSpace=0
[DPY:DP-5]/ColorRange=0
[DPY:DP-5]/SynchronousPaletteUpdates=0
This entry is dated 12th January 2022 but I have changed xorg.conf using nvidia-settings a number of times since that date. It seems to be an original entry. I don't see anything to do with dual monitors either other than DP and HDMI.

I removed xorg.conf and another wasn't made. It seems to have no effect which suggest the settings changes I made are saved somewhere else.

I am also wondering where the Ubuntu "Display" settings are saved to enable me to check them.
 
Old 01-16-2022, 06:49 PM   #9
makem
Member
 
Registered: Nov 2013
Posts: 209

Original Poster
Rep: Reputation: Disabled
To make xorg.conf writeable from nvidia-settings:

sudo chmod +x /usr/share/screen-resolution-extra/nvidia-polkit

Much easier than messing with file copy etc.
 
1 members found this post helpful.
Old 01-16-2022, 11:30 PM   #10
johnprogrammer
Member
 
Registered: Jan 2022
Distribution: Manjaro Linux, Ubuntu in Windows 11 WSL2
Posts: 35

Rep: Reputation: Disabled
Quote:
Originally Posted by makem View Post
This entry is dated 12th January 2022 but I have changed xorg.conf using nvidia-settings a number of times since that date. It seems to be an original entry. I don't see anything to do with dual monitors either other than DP and HDMI.

I removed xorg.conf and another wasn't made. It seems to have no effect which suggest the settings changes I made are saved somewhere else.

I am also wondering where the Ubuntu "Display" settings are saved to enable me to check them.
To create the xorg.conf file, you run:

sudo nvidia-xconfig

The settings of nvidia-settings, are saved to ~/.nvidia-settings-rc by default.
 
Old 01-17-2022, 04:10 AM   #11
makem
Member
 
Registered: Nov 2013
Posts: 209

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnprogrammer View Post
To create the xorg.conf file, you run:

sudo nvidia-xconfig

The settings of nvidia-settings, are saved to ~/.nvidia-settings-rc by default.
From what I have found so far there is no need to create an xorg.conf entry. I feel sure that the Ubuntu "Display" settings are the ones needed but I cannot find them.

~/.nvidia-settings-rc:

Code:
#
# /home/makem/.nvidia-settings-rc
#
# Configuration file for nvidia-settings - the NVIDIA X Server Settings utility
# Generated on Mon Jan 17 00:45:37 2022
#

# ConfigProperties:

RcFileLocale = C
DisplayStatusBar = Yes
SliderTextEntries = Yes
IncludeDisplayNameInConfigFile = No
ShowQuitDialog = Yes
UpdateRulesOnProfileNameChange = Yes
Timer = Memory_Used_(GPU_0),Yes,3000
Timer = Thermal_Monitor_(GPU_0),Yes,1000
Timer = PowerMizer_Monitor_(GPU_0),Yes,1000

# Attributes:

0/SyncToVBlank=1
0/LogAniso=0
0/FSAA=0
0/TextureClamping=1
0/FXAA=0
0/AllowFlipping=1
0/FSAAAppControlled=1
0/LogAnisoAppControlled=1
0/OpenGLImageSettings=1
0/FSAAAppEnhanced=0
0/ShowGraphicsVisualIndicator=0
[DPY:DP-0]/RedBrightness=0.000000
[DPY:DP-0]/GreenBrightness=0.000000
[DPY:DP-0]/BlueBrightness=0.000000
[DPY:DP-0]/RedContrast=0.000000
Nothing in there that is helpful or relevant it seems.

I am considering using the Nouveau drivers. Do you know if I deselect the Nvidia ones in Ubuntu "Additional Drivers" and select instead "Nouveau display driver from xserver-xorg-video-nouveay (open source) that I don't need to uninstall the Nvidia drivers and can swap between the two?

Edit:
I decided to give it a go having researched some. I used Software & Updates, chose Nouveau, applied the changes, rebooted and guess what?

The login appeared on the Primary monitor, success? No, because Ubuntu "Display" settings showed that only one monitor was recognised

Back to Nvidia drivers.

Last edited by makem; 01-17-2022 at 04:47 AM.
 
Old 01-25-2022, 11:25 AM   #12
Xenotaj
LQ Newbie
 
Registered: Jan 2022
Posts: 1

Rep: Reputation: 1
Quote:
Originally Posted by makem View Post
To make xorg.conf writeable from nvidia-settings:

sudo chmod +x /usr/share/screen-resolution-extra/nvidia-polkit

Much easier than messing with file copy etc.
This is the solution that worked for me. Thanks!
 
1 members found this post helpful.
Old 10-05-2023, 05:28 PM   #13
RichMD
LQ Newbie
 
Registered: Oct 2023
Posts: 1

Rep: Reputation: 0
The above solved the problem for me as well.

I have been a LONG time windows user and although I know some linux, I never tried to make it my default. The X11org.conf save issue (on multiple distros/versions) was just another thing that made me not want to keep trying since I never found an answer in the past and it seemed like such a basic thing...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is there any difference between / etc/rsyslog.conf and /etc/rsyslogd.conf sigint-ninja Linux - Newbie 3 10-22-2016 03:19 PM
/etc/ldap.conf vs /etc/openldap/ldap.conf wilslm Red Hat 2 05-04-2011 08:19 PM
Difference between /etc/ldap.conf vs. /etc/ldap/ldap.conf fahadaziz Linux - Server 8 07-14-2010 05:12 AM
/etc/hosts, /etc/resolve.conf and /etc/host.conf config probs below_average Linux - Networking 1 12-08-2004 10:07 PM
Where is /etc/modules.conf or /etc/modules.conf in FC2 CountingCount Fedora 1 06-01-2004 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration