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:
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
All the other resolutions work.
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 predefinde 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):
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: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:
From this we can copy & paste the modeline to add it to xrandr list of known resolutions:
and add this for the Virtual Box Monitor:
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.).
In VirtualBox I use a minimal version of the good old xorg.conf:
I don't know if you need to provide HorizSync and VertRefresh for a TFT, but in any case don't copy my values!
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.
Just to summarize a working answer succinctly. Tested in 18.04 with lubuntu-desktop:
sudo apt-get install virtualbox-guest-dkms
sudo shutdown -r now
(You could skip step 1 if guest additions are already installed. Check if
sudo lsmod | grep vbox
returns anything first.)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.
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.