1

I am new to Ubuntu, and my original problem was with the screen (display) resolution. I am running Ubuntu 16.04 LTE (x64) on a VMWare Workstation 12.0.1 which is on a Windows 7 Enterprise x64 machine with AMD Radeon HD 5670 graphics card.

Every time I run Ubuntu, it runs in a smaller resolution 800x600; my native resolution is 1920x1080. So I searched around and found article's instructing to create a custom bash script which should've forced the system resolution to 1920x1080.
Following the tutorial i created a "setscreen.sh" file with the following commands ->

xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080

But after every restart the resolution goes back to 800x600. Then i have to run the custom "setscreen.sh" command again from the terminal to bring it back to 1920x1080.

I did more research and found another article which suggested to put the file in "startup application" after enabling the "execute" permission of the 'custom display' file to "Allow executing file as program". I did as instructed (marking the file executable and making a new entry in the Startup Application) and now after every restart the resolution would come to 1920x1080, but with a error message (Could not apply the stored configuration for monitors). When I close the error message the resolution goes back to 800x600. Then i have to run the "setscreen.sh" command again from the terminal to bring the resolution back to 1920x1080. (no error msg when run manually from the terminal).

Since this was turning out to be yet another inconvenience, I followed this and this article to create a ".desktop" file but it still does not fix anything and the issue persists.

Now thinking that maybe i can't get this issue fixed i started looking at other ways to change the resolution and thought of manually running the "setscreen.sh" file from the desktop (GUI) by double clicking on it. But when i double click on the file it opens in "gedit". So to fix this problem, I followed this article but i can't seem to understand the instructions there. What is "Raring Nautilus" (the file manager)? I can't find "File" menu in my ubuntu desktop. How do we come to the "preferences" to change the "Behavior"?

I open the Ubuntu "Files Explorer" and locate to the /path/of/file and tried finding the file menu on the Explorer window but can't seeems to find it. Also right clicking the file and selecting "open with"option and then "other application" and then "View all application" shows a bunch of application but not "Terminal". Here I did try to open it with the "sun software" option but that also does not fix the problem.

I did further research to fix the problem by doing a search for every possible solution on askubuntu site but nothing i do seems to fix the problem.

Also I am sorry for not being able to keep this question short and concise fearing lack of proper understanding of my issue and leading to potential delay.

Hope i have explained enough for someone to either help me resolve this issue or point me towards a resolution.

Thanks.

Eri
  • 51

4 Answers4

4

After 13 months of struggle I have finally fixed my issue.

First make sure that you are running the "VMware Tools" properly on your VM, and I did that by follow the instructions here!.

Then I fire up the Terminal (Ctrl + Alt + T) and enter the following commands

(Note -> References to these 5 display command xrandr are a plenty here on this site, but without resolution to my problem. However I must mention them again here for proper visibility for people facing similar problem like me. This will save them the trouble of visiting other pages for completing a phase of the resolution. So here it goes..)

xrandr -q

From the output of the above command, check which output is connected. For me it was Virtual1

Then type the following command cvt followed by your desired resolution. Please give attention to spaces in the following command. For me it was

cvt 1920 1080

This generated the a output from which we need to copy (Ctrl+Shift+C) text after the word "Modeline" till the end and paste it (Ctrl+Shift+V) into the below code. Make sure to delete the _60.00 from between the quotes, before you run the code. For me it was like this

xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088
1120 -hsync +vsync

Observe I have removed the _60.00 from the original "1920x1080_60.00". Next take the screen resolution from between the quotes and enter into the following code

xrandr --addmode Virtual1 1920x1080

After this add the following command

xrandr --output Virtual1 --mode 1920x1080

This should bring your screen resolution in Ubuntu to the desired one (1920x1080)

At this point if you restart then the new resolution will not be saved. So I went back to the System Setting -> Display. I now see that the desired resolution 1920x1080(16:9), (which was previously unavailable) has now become available in the Resolution drop down. Now when I select the resolution here and click on Apply, it retains the changes, even after restart.

So this way you don't have to make and custom resolution file and put it in startup items. i would like to say thanks to @DevRobot for this suggestions and efforts (he was the only one to do so).

abu_bua
  • 10,783
Eri
  • 51
  • for me, the last command xrandr -- output Virtual1 --mode 1920x1080 didn't work. But it did when I changed it to xrandr --output Virtual1 --mode 1920x1080. That is, I removed the space between -- and output. I'm not sure if that was a typo or if leaving that space worked for you, but just wanted to mention that. – George V.M. Nov 17 '18 at 10:59
2

Raring Nautilus is the file manager used in Ubuntu. The instructions in this answer are only applicable if you're running Gnome, which you obviously aren't.

The way to make the bash script executable is by right clicking the script -> Properties -> Permissions -> set file as executable (or something very similar).
Otherwise you can use the terminal: chmod +x yourscript.sh.

In case you did something wrong in setting up the .sh script to run on startup, I'll give you the instructions:

  • Create a bash script, xrandr.sh for example, and place your xrandr commands into it:
#!/bin/bash
xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080
  • Make the script executable with chmod +x xrandr.sh

  • Search for "Startup Applications" in the dash, run it, and add the script as a startup application.

The commands will now run every time you log into your account.

If you run into further problems, don't hesitate to contact me in the comments =)

TellMeWhy
  • 17,484
  • Thanks for the reply @DevRobot. Previously I had actually changed the Premission of setscreen.sh both in the GUI and the terminal. Now I followed your instructions and created a new file (xrandr.sh) with the script that you provided me and then adding the same in ''Startup Application" but still after restart it throws up the same error msg as before. And as before when i close the msg the screen goes back to 800x600. Then to make the screen 1920x1080 i run the file in terminal and it runs without any error and the screen becomes ok. Any idea how to make it run without error or double click? – Eri Nov 25 '15 at 05:57
  • since both the files are running without any error code Manually, i was wondering why its generating error when asked to run during startup? Thinking that since the location of both files were under my user folder (Desktop & Documents), i tried moving the file to the root and made changes in the startup accordingly. But still its throwing up the error msg. Screenshot of error msg in imgur album – Eri Nov 25 '15 at 08:28
  • Hi @devrobot ! I am still waiting for your feedback. Thanks – Eri Dec 01 '15 at 04:16
  • @saj oh, sorry... could you provide a screenshot of the error? – TellMeWhy Dec 01 '15 at 10:02
  • here is the link to the screenshot album and there is the direct link to the screenshot screenshot2 – Eri Dec 07 '15 at 02:28
  • Hi @devrobot, were you able to check out the screenshots? Thanks – Eri Dec 21 '15 at 00:39
1

My solution for this problem was slighty different than the answer from DevRobot. Here's my approach.

So setting the custom resolution is done as mentioned by saj.

xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080

In order to keep this customized screen resolution set after every reboot I did change ~/.xprofile.

In terminal gedit ~/.xprofile

Add following lines to the end of the file and save:

xrandr --newmode "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
Ruts
  • 111
0

I got it to work in rather a simple way. I installed vmware tools following the link sent above and then in VMWare VM settings, change video memory to 16MB which was previously set to 4MB. Windows 98 users would recall how limited options were with 4MB cards so there it is :).