2

I want to record a screen recording of ubuntu in a VM at 4k for people with new monitors however I only have a 1080p screen.

Is there any way to turn the resolution of the VM in virtualbox up to 4k while still fitting it on my 1080p screen?

I have tried manually setting the resolution with xrandr but I get the error "Size index 3840 is too large, there are only 13 sizes" When I listed the sizes the highest one was 2560x1440 but trying to set this resolution failed too.

Qwertie
  • 906
  • 3
  • 12
  • 31

1 Answers1

2

To be able to run a 4K virtual display in Virtual Box on a smaller screen we need to define the desired resolution (4096 x 2160) first (also see my answer there):

Make a 4k virtual screen

  1. Calculate the modeline for xrandr

    gtf 3840 2160 60
    Modeline "3840x2160_60.00"  712.34  3840 4152 4576 5312  2160 2161 2164 2235  -HSync +Vsync
    
  2. Define a new screen geometry mode:

    xrandr --newmode "3840x2160_60.00"  712.34  3840 4152 4576 5312  2160 2161 2164 2235  -HSync +Vsync
    
  3. Attach this mode to the Virtual Box virtual screen (e.g. VGA-0):

    xrandr --addmode "VGA-0" 3840x2160_60.00
    
  4. Apply this mode to the Virtual Screen:

    xrandr --output VGA-0 --mode "3840x2160_60.00"
    

    We can alternatively choose this new geometry from System settings... > Displays.

Note: Virtual Box should run in windowed mode on a screen having a lower resolution than the new geometry we had defined.

Record the desktop

Sadly due to a bug in Virtual Box we may need to disable 3D acceleration in the machine's settings to be able to record the desktop with our favorite recording software.

Below is a scaled down example GIF from a 4K virtual desktop:

enter image description here

Takkat
  • 144,580