You are not logged in.

#1 2017-04-27 09:39:04

tnek
Member
Registered: 2008-06-10
Posts: 41

[SOLVED] Xorg starts in wrong resolution in a VirtualBox guest

I have a problem with Xorg resolution in a VirtualBox guest. I get 800x600 but I want 1920x1200.

What I did

First I installed the package containg the video module for VirtualBox

sudo pacman -S virtualbox-guest-utils # picked the 2:nd choice ..-modules-arch as I use the default kernel (according to wiki)

Then I reboot'ed the system to make sure the video module was loaded.

After that I installed Xorg, xinit and its optional dependencies

sudo pacman -S xorg-server xterm xorg-xclock xorg-twm xorg-xinit # picked libglvnd, the first and default choice as the others said nvidia..

When I startx I get a 800x600 screen.

If I issue xrandr it shows a lot of different resolutions to me, included 1920x1200 which is the one I want.

I am able to switch to 1920x1200 by

xrandr --output VGA-1 --mode 1920x1200.

I don't have any Xorg configuration file (at least not any that wasn't auto generated and residing somewhere other than $HOME). As this is a virtual machine I have been able to go back to a snapshot and experimented with this many times.

Two times it has just started to work, and I got into 1920x1200 straight from startx without any xrandr command to change resolution. However when I try to reproduce that now using in many different orders of the above commands I wasn't able to. But as far as I remember once was after doing a pacman -Syu, and the other time I changed resolution using xrandr, exited, and then startx sent me to the correct resolution again. But I have not been able to reproduce these two ways so it does not seem to happen every time.

Any idea why the auto configuration for resolution is not working for me?

Can I tell Xorg to re-configure itself, or is that done automatically?

Is resolution working for you in VirtualBox?

How do I get it to use 1920x1200 always?

Last edited by tnek (2017-05-01 22:45:51)

Offline

#2 2017-04-27 13:03:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,347

Re: [SOLVED] Xorg starts in wrong resolution in a VirtualBox guest

/etc/X11/xorg.conf.d/11-monitor

Section "Monitor"
     Identifier "VGA-1"
    Option "PreferredMode" "1920x1200"
EndSection

Offline

#3 2017-04-28 10:25:47

tnek
Member
Registered: 2008-06-10
Posts: 41

Re: [SOLVED] Xorg starts in wrong resolution in a VirtualBox guest

seth wrote:

/etc/X11/xorg.conf.d/11-monitor

Section "Monitor"
     Identifier "VGA-1"
    Option "PreferredMode" "1920x1200"
EndSection

I guess that is the way to go. Thanks!

It would have been nice if it worked automatically, especially since it has done so twice, but I cannot reproduce that. I will leave the thread open for a while more before marking it as closed, as I am interested in learning a bit more through answers for my other questions.

Offline

#4 2017-04-28 13:58:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,347

Re: [SOLVED] Xorg starts in wrong resolution in a VirtualBox guest

There's probably some virtualbox setting or maybe this is implied by the window size.
The (unconfigured) server relies on hints from the hardware - which in the vbox case is only emulated, so there's no "actual" proper value to be picked automagically.

Offline

#5 2017-05-01 22:45:31

tnek
Member
Registered: 2008-06-10
Posts: 41

Re: [SOLVED] Xorg starts in wrong resolution in a VirtualBox guest

seth wrote:

There's probably some virtualbox setting or maybe this is implied by the window size.
The (unconfigured) server relies on hints from the hardware - which in the vbox case is only emulated, so there's no "actual" proper value to be picked automagically.

Thanks for helping out! I could not get that to work even with the Xorg settings file, but I found a setting in VirtualBox I had not seen before which did fix it. So your hint was defenitely in the right direction.

What solved it / From command line system to Xorg with correct resolution in VirtualBox
I installed virtualbox-guest-utils (since I want X support + have the default kernel I picked virtualbox-guest-modules-arch as instructed on the wiki) and rebooted to let the graphics card driver module load.

I installed xorg-server xterm xorg-xclock xorg-twm xorg-xinit and did a startx. I got the wrong resolution with 800x600 (here, even if I added the Xorg configuration for resolution, nothing happened). Then I right clicked the monitor icon in the bottom right part of the VirtualBox guest window and picked Virtual Screen 1 / Resize to 1920x1200. When that is done exit the Xorg session by typing exit in the upper left xterm window. When starting Xorg again with startx, it will use 1920x1200 without any configuration file.

Note: You will only be able to select Virtual Screen 1 / Resize to 1920x1200 from INSIDE the Xorg session. I assume it's because it's actually using the VirtualBox virtual graphics card driver at that point, and that it isn't from the console.

Note2: This works for any desired resolution as long as it's available in Virtual Screen 1 / Resize to WIDTHxHEIGHT, such as 1920x1080.

Offline

#6 2017-05-02 02:25:02

Rick_Allard
Member
From: Montreal, Quebec, Canada
Registered: 2016-01-27
Posts: 4

Re: [SOLVED] Xorg starts in wrong resolution in a VirtualBox guest

seth wrote:

/etc/X11/xorg.conf.d/11-monitor

Section "Monitor"
     Identifier "VGA-1"
    Option "PreferredMode" "1920x1200"
EndSection

... This should actually be /etc/X11/xorg.conf.d/11-monitor.conf - works for me and I had the same issues. ... Just add the ".conf" to the filename.

Cheers.

Offline

Board footer

Powered by FluxBB