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
  • 61

4 Answers4

5

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
  • 11,313
Eri
  • 61
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,964
  • 41
  • 100
  • 142
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
1

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 :).