11

Running 11.04 beta in a Parallels 5.0 virtual machine, but this question will apply to any virtualization software.

Parallels 5 Linux tools (guest additions) don't work for 10.10 and 11.04 and I don't want them. I like how the VM is integrated as is. The only thing that needs tuning is the screen geometry.

None of the options in the Systems -> Preferences -> Monitors fit my display perfectly. I need it at 1080 x 1920 (9:16) or 1920 x 1080 (16:9).

Many different resolutions work (see screen-shot bellow), among which are:

  • 1680 x 1080 (too narrow horizontally and a bit too short vertically)
  • 1920 x 1200 (perfect horizontally, but a bit too tall vertically)

How can I adjust the screen resolution (display/monitor size) manually?

What I tried so far

$ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
$ sudo xrandr --newmode "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr: Failed to get size of gamma for output default

$ cvt 1080 1920 
# 1080x1920 59.96 Hz (CVT) hsync: 119.26 kHz; pclk: 176.50 MHz
Modeline "1080x1920_60.00"  176.50  1080 1168 1280 1480  1920 1923 1933 1989 -hsync +vsync
$ sudo xrandr --newmode "1080x1920"  176.50  1080 1168 1280 1480  1920 1923 1933 1989 -hsync +vsync

$ sudo xrandr -q
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 1920 x 1200, maximum 1920 x 1200
default connected 1920x1200+0+0 0mm x 0mm
   1920x1200       0.0* 
   1600x1200       0.0  
   1680x1050       0.0  
   1400x1050       0.0  
   1280x1024       0.0  
   1440x900        0.0  
   1280x960        0.0  
   1280x800        0.0  
   1024x768        0.0  
   800x600         0.0  
   640x480         0.0  
  1920x1080 (0x11d)  173.0MHz
        h: width  1920 start 2048 end 2248 total 2576 skew    0 clock   67.2KHz
        v: height 1080 start 1083 end 1088 total 1120           clock   60.0Hz
  1080x1920 (0x11e)  176.5MHz
        h: width  1080 start 1168 end 1280 total 1480 skew    0 clock  119.3KHz
        v: height 1920 start 1923 end 1933 total 1989           clock   60.0Hz

The 2 new resolutions do not show up in the Monitor Preferences GUI: enter image description here

Trying Takkat's Solution

Here is what I do and get:

$ gtf 1920 1080 60 -x

  # 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
  Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

$ sudo xrandr --newmode "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

$ sudo xrandr --addmode default 1920x1080_60.00

$ xrandr 
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 640 x 480, current 1680 x 1050, maximum 1920 x 1200
default connected 1680x1050+0+0 0mm x 0mm
   1920x1200       0.0  
   1600x1200       0.0  
   1680x1050       0.0* 
   1400x1050       0.0  
   1280x1024       0.0  
   1440x900        0.0  
   1280x960        0.0  
   1280x800        0.0  
   1024x768        0.0  
   800x600         0.0  
   640x480         0.0  
   1920x1080_60.00   60.0  

I also tried gtf 1920 1080 60 -x.

In both cases I can't switch to that resolution and get:

  • Could not set configuration for CRTC 262

enter image description here

All the other resolutions work.

  • 1
    Did you install the guest additions? ( or open-vmware-tools if using vmware ) – OpenNingia Nov 11 '10 at 07:50
  • @OpenNingia, I'm installing it on Parallels 5. Would like to avoid using guest additions. All I need is to change the screen resolution. – Aleksandr Levchuk Apr 23 '11 at 22:40
  • @Alexsandr Levchuk the point of guest additions, vmware tools, etc.: is to give you better graphics driver support, keyboard/mouse integration, and some other miscellaneous hardware & network support. – Jeremy Bicha Apr 24 '11 at 19:08
  • @jbicha, that's why I don't need guest additions - for me all of the mentioned points work fine without the guest additions. Guest additions break every time there is a kernel update. In case of Parallels 5 they are simply not available for Ubuntu 10.10 and 11.4 – Aleksandr Levchuk Apr 24 '11 at 21:39
  • except that the graphics driver doesn't work right which is the reason you opened this question – Jeremy Bicha Apr 25 '11 at 01:11
  • @jbicha, so you are saying that without the guest additions there is no way to tune the screen size. I doubt that. I can make it larger than 1080 x 1920 or smaller, but I cannot make it something in between? – Aleksandr Levchuk Apr 25 '11 at 03:51
  • I believe guest additions (& VirtualBox) is the best & easiest way to get it working. Playing with randr like you already were would probably work too but I am not very good with randr. – Jeremy Bicha Apr 25 '11 at 04:59
  • Here is Parallels 5 Desktop for Mac without a serial key it will only work for 30 days. You should still be able to use it to test things. – Aleksandr Levchuk May 19 '11 at 23:52

6 Answers6

16

Display Geometry Settings in Virtual Box

In Oracle Virtual Box you can adjust the virtual screen resolution after having installed the Guest Additions simply by dragging the window with the mouse or by choosing full screen mode. No need to do anything with xorg.conf. XServer 1.10 (included in 11.04) and thus Unity 3D runs only in Virtual Box >=4.0.6.

1. Use Mouse to adjust screen size

Adjusting the screen by resizing the Virtual Box Windows with the mouse allows for any screen resolution up to the host screen resolution.

2. Use predefined standard screen sizes

If you need a fixed (standard) resolution you may also choose System Settings -> Monitors (for 11.04) or Displays (for 12.04) for a selection of fixed resolutions (here shown for 12.04):

enter image description here

  • For maximum host screen resolution you will need to run Virtual Box in Fullscreen mode (Host + F)
  • For a fixed host screen resolution we need to disable Auto-resize Guest Display (HOST+G) from Virtual Box Manager View menu.

3. Define new geometry with xrandr

If you need a fixed geometry that is not in the list of resolutions for monitors you will have to use xrandr to define a new resolution:

First we use gtf for calculating the modeline of possible resolutions:

gtf <xres> <yres> <refresh> [-x]

Give the desired values for x-resolution, y-resolution and refresh rate. The flag -x is default and can be omitted. For a portrait resolution 480x640 at 60 Hz you will get the following output:

$ gtf 480 640 60 -x
$ 480x640 @ 60.00 Hz (GTF) hsync: 39.78 kHz; pclk: 24.82 MHz Modeline "480x640_60.00" 24.82 480 504 552 624 640 641 644 663 -HSync +Vsync

From this we can copy & paste the modeline to add it to xrandr list of known resolutions:

xrandr --newmode "480x640_60.00" 24.82 480 504 552 624 640 641 644 663 -HSync +Vsync

and add this for the Virtual Box Monitor:

xrandr --addmode VBOX0 480x640_60.00

Replace VBOX0 with the appropriate monitor if you have setup Virtual Box with multiple monitors (or any other output name the driver reports).

We can now switch to the newly defined geometry as described above (2.).

Alexis Wilke
  • 2,707
Takkat
  • 142,284
  • 3
    Virtual box 4.0 has a new "scale mode" for screen size. http://www.virtualbox.org/wiki/Changelog – djangofan Dec 23 '10 at 23:11
  • 2
    I highly recommend using VirtualBox (VB); it works on any operating system, not just Macs. It is open source and thus is in the Ubuntu repositories if you'd like for Ubuntu to be the host operating system and the guest-utils are in the repos if you want Ubuntu to be the guest (but you want to make sure the guest-utils version number matches the VB version). As most of us do not have Parallels installed it is more difficult for you to find community support from Ubuntu users. – Jeremy Bicha Apr 24 '11 at 19:13
  • Dear @Takkat, I'm stuck on the last part - xrandr --addmode VBOX0 480x60_60.00. I don't have the VBOX0. Where can I get the list of available monitors? – Aleksandr Levchuk Apr 28 '11 at 19:30
  • @Takkat, thanks for explaining how to lookup the monitor (mine was "default"). I'm further but still have a blocker. Please see my update in the question. – Aleksandr Levchuk Apr 29 '11 at 22:42
  • @Takkat, all of my operations were in fullscreen mode. – Aleksandr Levchuk Apr 30 '11 at 07:42
  • @Takkat, I don't have guest additions installed. Perhaps you can reproduce the "CRTC 262" error that I'm stuck with if you repeat what I did on a VM that does not have guest additions. – Aleksandr Levchuk Apr 30 '11 at 07:49
  • @Takkat, I do have enough video RAM. I can set even 1920x1200 which goes beyond my actual screen size. I had to adjust the video setting in Parallels (the virtualization software). I set it to max (256MB). – Aleksandr Levchuk Apr 30 '11 at 17:25
  • @Takkat, in Virtual Box the Shared Folders feature would break but that's a different topic. I used Parallels for 1 year, then Virtual box for 6 month, and now back to Parallels. The reason I switched back to Parallels was because Ubuntu started freezing (perhaps 1GB RAM is not enough). Parallels 5 does not freeze but it's "Guest Additions" refuse to be installed on Ubuntu 10.10 and up. It's a degenerate case but I think I'm not the only one who wants to known how to tweak Display size in an Ubuntu VM without Guest Additions. – Aleksandr Levchuk Apr 30 '11 at 21:03
  • @Takkat, I award the bounty to you because you were probably the closest among the other answers. Hoverer, my question remains un-answered. – Aleksandr Levchuk Apr 30 '11 at 21:34
  • @Aleksandr Levchuk: Thank you :) It's not unusual that bounty questions are not really solved (had that myself) but they do get viewed (almost 1k). I agree that changing screen resolution without GA would be a nice feature. However as long as GA work fine not many people may need it. One possible solution we could try out may be to boot using EFI BIOS and set the geometry there. However I don't really know how to do that, and I am not sure if a VM stays stable then. 1 GB virtual RAM is sufficient to run Ubuntu. I never experienced crashes. To reduce clutter I deleted my earlier comments. – Takkat May 01 '11 at 07:45
  • Great answer, the 3. Define new geometry with xrandr method also helped me with ubuntu 12.04 in vmware fusion 4.1 on mac not displaying the 1920 x 1080 option. – DanC Sep 11 '12 at 15:25
  • I have Ubuntu 20.4 under Virtual Box 6.1 and after I do the 2nd step however after the reboot the resolution is reverted by to my previous setting. Any idea on how to do this change permanent ? – thanos.a Dec 17 '20 at 09:03
3

In VirtualBox I use a minimal version of the good old xorg.conf:

Section "Monitor"
    Identifier      "Monitor0"
    HorizSync       30.0 - 96.0
    VertRefresh     50.0 - 160.0
EndSection

Section "Device"
    Identifier      "Device0"
    Driver          "vesa"
EndSection

Section "Screen"
    Identifier      "Screen0"
    Monitor         "Monitor0"
    Device          "Device0"
    DefaultDepth    24
    SubSection "Display"
        Depth       24
        Modes       "1280x1024"
    EndSubSection
EndSection

Section "ServerLayout"
    Identifier      "Layout0"
    Screen          "Screen0"
EndSection

I don't know if you need to provide HorizSync and VertRefresh for a TFT, but in any case don't copy my values!

htorque
  • 64,798
  • Probably not necessary any more. Virtual box 4.0 has a new "scale mode" for screen size. http://www.virtualbox.org/wiki/Changelog – djangofan Dec 23 '10 at 23:12
  • This did not work for me. After placing the xorg.conf file and rebooting the screen goes black. Recovered with ctrl + alt + f1 – Aleksandr Levchuk Apr 23 '11 at 22:42
1

Just to summarize a working answer succinctly. Tested in 18.04 with lubuntu-desktop:

  1. Install guest additions on the VM: sudo apt-get install virtualbox-guest-dkms
  2. Restart the VM: sudo shutdown -r now
  3. After logging into the VM, resize the VirtualBox window to the desired size. (The VM screen inside the window does not resize automatically yet.)
  4. On the VM, go to Preferences -> Monitor Settings -> select Auto -> Apply -> OK

(You could skip step 1 if guest additions are already installed. Check if sudo lsmod | grep vbox returns anything first.)

krubo
  • 949
1

Possible one could try the commands and xorg.conf snippets that are listed here:

http://wiki.debian.org/XStrikeForce/HowToRandR12

I haven't tried that yet and don't know if there is enough information to get it working.

0

I am running ubuntu 10.10 on Virtualbox i had the same problem . couldn't adjust the resolution and also the full screen mode was not working. After a bit googling i found this article http://tutorial.downloadatoz.com/how-to-fix-ubuntu-10-10-virtualbox-guest-additions-problems.html

This really worked for me.

aneeshep
  • 30,321
0

I had this problem with Windows8 (Host Ubuntu). It wouldn't scale to the external monitor's size.

In the Virtualbox, File, Preferences [CTRL]+[G], Display, choose Maximum Guest Screen Size - Automatic.

Solved. VirtualBox - Settings

GUI Junkie
  • 1,936