How to set 4K screen resolution

Discussions related to using VirtualBox on Linux hosts.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

How to set 4K screen resolution

Post by satimis »

Hi all

Host - Ubuntun 20.04 desktop
VM - Ubuntu 20.04 desktop and CentOS 8

Please advise how to set 4K screen resolution on VMs

Thanks

Regards
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to set 4K screen resolution

Post by mpack »

How have you ever set any display size? Why do you believe any particular one requires special treatment?

Display size is usually set by the guest OS. If the GAs are installed then it can also be changed by dragging the window border or by using the View|Virtual screen x menu.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to set 4K screen resolution

Post by satimis »

Display Resolution of Ubuntu 20.04 and CentOS 8

Code: Select all

2560 x 1600 (16:10) max
4K resolution is not available. My display is 4K resolution

CentOS 8 is quite strange. On reboot it selects 800 x 600 resolution. I have tried several times

Regards
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to set 4K screen resolution

Post by scottgus1 »

You would at least need Guest Additions in the VM, see https://www.virtualbox.org/manual/ch02. ... nux-prereq and https://www.virtualbox.org/manual/ch04. ... ions-linux. Also use maximum video RAM. I assume your host OS is running at 4K.

After GAs are installed, try setting the VM to Full Screen. Does the VM OS then pick up 4K screen size?
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to set 4K screen resolution

Post by satimis »

Performed following steps:-

Download VBoxGuestAdditions_6.1.0_RC1.iso on Host

click it
-> select "Run"

Code: Select all

Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.0_RC1 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 5.4.0-72-generic.
update-initramfs: Generating /boot/initrd.img-5.4.0-72-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.
Press Return to close this window...
Ubuntu 20.04
-> select video RAM = 27897 MB max allowed
(RAM onboard - 32G)

Start Ubuntu 20.04 VM

Display setting:

Code: Select all

Resolution  2560 x 1600 (16:10) max
(Remark: my Dell 32 4K Display - resolution: 3840 x 2160)

Reboot PC
Warning :

Code: Select all

VBoxClient: The virtualbox kernel service is not running
Reinstall VBoxGuestAdditions_6.1.0_RC1.iso

Code: Select all

Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.0_RC1 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.1.0_RC1 of VirtualBox Guest Additions...
update-initramfs: Generating /boot/initrd.img-5.4.0-72-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 5.4.0-72-generic.
update-initramfs: Generating /boot/initrd.img-5.4.0-72-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.
Press Return to close this window...
Reboot PC
The warning still popup

sudo nano /etc/X11/Xsession.d/98vboxadd-xclient

change following line

Code: Select all

notify-send "VBoxClient: the VirtualBox kernel service is not running. Exiting."
to

Code: Select all

echo "VBoxClient: the VirtualBox kernel service is not running. Exiting."
Reboot PC but the warning still popup

Display setting:

Code: Select all

Resolution  2560 x 1600 (16:10) max
Please help. Thanks in advance.

Regards
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to set 4K screen resolution

Post by scottgus1 »

satimis wrote:Download VBoxGuestAdditions_6.1.0_RC1.iso on Host
The release candidate (if that what RC means) of the first in a new major version of a program is bound to be buggy. Why that particular choice instead of matching the version of Virtualbox on the host?

Official Virtualbox from https://www.virtualbox.org/wiki/Linux_Downloads comes with Guest Additions built-in as an ISO and does not need a separate download. If you are using the Ubuntu fork, we don't support the forks here. You can put official Virtualbox & Guest Additions in the host and VM, then we can try to help.

Please post a zipped vbox.log per the usual methods, then we'll see what can be done.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to set 4K screen resolution

Post by satimis »

This PC was built 2~3 years ago including VirtualBox. I have Ubuntu 20.04 VMs and Windows 10 home/pro VMs running on it, all without problem, up to now. It is only the recently installed CentOS 8 VM having problems on display resolution and copy-n-paste between VM and Host.

VirtualBox was installed on the ISO, download on Oracle VirtualBox website. Unfortunately I couldn't find its ISO therefore I download it on Oracle VirtualBox website a new Guest Addition ISO to reinstall it.

Before all Ubuntu 20.04 VMs are running on 2560 x 1600 resolution without problem. Recently I installed a Dell 4K 32" display. Host is running 4K resolution without problem but only the VMs are unable to set 4K resolution.

That is the complete story !!!

1)
There is no xorg.conf on CentOS 8. Their forum advised me creating a file on /etc/X11/xorg.conf.d/monitor.conf

with following content

Code: Select all

Section "Monitor"
    Identifier "VGA1"
    Modeline "2560x1600" 153.562 1920 1968 2000 2080 1200 1203 1209 1235 +hsync -vsync
    Option "PreferredMode" "2560x1600"
    HorizSync       30-85
    VertRefresh     56-85
EndSection

Section "Screen"
    Identifier "Screen0"
    Monitor "VGA1"
    DefaultDepth 24
    SubSection "Display"
        Modes "2560x1600"
    EndSubSection
EndSection

Section "Device"
    Identifier "Device0"
    Driver "vesa"
EndSection
It couldn't solve the problem of resolution on reboot.

There is no problem selecting resolution 2560 x 1600 after booting up CentOS 8. However on reboot it selects resolution 800 x 600 again. I have tried 4 times with the same result. Also copy-n-paste is not working between CentOS 8 VM and Host.

Shall I re-install Guest Addition? Which ISO shall I download?

Oracle Linux 8 / Red Hat Enterprise Linux 8 / CentOS 8 ?
Ubuntu 19.10 / 20.04 / 20.10 / 21.04 ?

Host - Ubuntu 20.04 desktop

2)
On Ubuntu Host Terminal
$ sudo find / -type f -name vbox.log

Code: Select all

find: ‘/run/user/1000/gvfs’: Permission denied
$ ls ~/.config/VirtualBox/

Code: Select all

compreg.dat                                    selectorwindow.log.9
HostInterfaceNetworking-vboxnet0-Dhcpd.config  vbox-ssl-cacertificate.crt
HostInterfaceNetworking-vboxnet0-Dhcpd.log     VBoxSVC.log
HostInterfaceNetworking-vboxnet1-Dhcpd.config  VBoxSVC.log.1
HostInterfaceNetworking-vboxnet1-Dhcpd.log     VBoxSVC.log.10
HostInterfaceNetworking-vboxnet2-Dhcpd.config  VBoxSVC.log.2
HostInterfaceNetworking-vboxnet2-Dhcpd.log     VBoxSVC.log.3
selectorwindow.log                             VBoxSVC.log.4
selectorwindow.log.1                           VBoxSVC.log.5
selectorwindow.log.10                          VBoxSVC.log.6
selectorwindow.log.2                           VBoxSVC.log.7
selectorwindow.log.3                           VBoxSVC.log.8
selectorwindow.log.4                           VBoxSVC.log.9
selectorwindow.log.5                           VirtualBox.xml
selectorwindow.log.6                           VirtualBox.xml.old
selectorwindow.log.7                           VirtualBox.xml-prev
selectorwindow.log.8                           xpti.dat
Which log file shall I send to you ?

Thanks

Regards
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: How to set 4K screen resolution

Post by fth0 »

You can try the following: Save Resolution Across Reboots (don't forget to replace the VM name ;)).
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to set 4K screen resolution

Post by scottgus1 »

satimis wrote:Which log file shall I send to you ?
Funny, Satimis, I would figure after 400-ish posts, you must have posted a vbox.log by now. :lol:

If fth0's suggestion does not work, do this:

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to set 4K screen resolution

Post by satimis »

scottgus1 wrote: -snip-
If fth0's suggestion does not work, do this:
$ sudo VBoxManage setextradata "Centos8_00" "GUI/LastGuestSizeHint"

Code: Select all

VBoxManage: error: Could not find a registered machine named 'Centos8_00'
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 934 of file VBoxManageMisc.cpp
Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, ....
CentOS 8 is running without problem. The problems are;
1. On reboot, it selects 800x600 resolution
2. Copy-n-paste" between Host and VM doesn't work

Regards
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: How to set 4K screen resolution

Post by Martin »

Where in the instruction did you see the need to use "sudo" for the command?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to set 4K screen resolution

Post by scottgus1 »

satimis wrote:CentOS 8 is running without problem.
Hmmm.
scottgus1 wrote:Run until you see the problem happen,
satimis wrote:On reboot, it selects 800x600 resolution
Isn't the reset to 800x600 the problem?

FWIW Vbox.log shows more than problems..........
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to set 4K screen resolution

Post by satimis »

scottgus1 wrote: FWIW Vbox.log shows more than problems..........
Hi scottgus1

I attach here the log file of CentOS 8 VM running on my daily working PC. I'll send you the log file of CentOS 8 VM running on my OLD PC later.

Regards
Attachments
centos8_00_computerA.log.zip
(32.5 KiB) Downloaded 13 times
satimis
Posts: 506
Joined: 12. Jun 2007, 03:41

Re: How to set 4K screen resolution

Post by satimis »

Hi scottgus1

I attach here the log file of CentOS 8 VM running on my OLD PC.

Regards
Attachments
centos8_computerB.log.zip
(33.88 KiB) Downloaded 15 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to set 4K screen resolution

Post by scottgus1 »

Thanks for the logs. Neither log shows the Guest Additions installed in the VM. Without Guest Additions, only the VM OS's native drivers are used, with loss of graphics capability as a result.

Additionally, the "Computer A" log was a restore from a saved state and is missing some diagnostic data that may have helped:
scottgus1 wrote:Start the VM from full normal shutdown, not save-state.
Post Reply