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
  • 886
  • What error did you got, and yes, because your monitor is not 4k, it wont work. It's like trying to fill a bucket. You are telling the system your bucket(monitor) is 4k, so it can pour pixels, but because its not, the bucket overflows, and you get an error. This is a hardware limitation, not a software one. Presuming ur monitor doesn't have 4k support. – We are Borg Nov 05 '15 at 09:25
  • I know I wont be able to display the VM at 4k but thats not what i want to do. I just need to record the VM at 4k which should be possible. – Qwertie Nov 05 '15 at 11:14
  • The screen is recorded, there is no stream of data which is coming from your graphics-card/chipset which is of 4k, because of which you cannot do it. Also, such feature is not supported by any known screen-recording program that I know. I wish you good luck, but the probability is quite low, you might wanna start considering/evaluating other options. Good luck!!! – We are Borg Nov 05 '15 at 12:04

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
  • 142,284
  • Thanks for the answer. I will give this a shot later today and see if I can get it to work. – Qwertie Nov 05 '15 at 20:44
  • On that last command I am getting the errors
    `X Error of failed request:  BadMatch (invalid parameter attributes)
      Major opcode of failed request:  140 (RANDR)
      Minor opcode of failed request:  7 (RRSetScreenSize)
      Serial number of failed request:  21
      Current serial number in output stream:  22`
    
    – Qwertie Nov 06 '15 at 23:55
  • I restarted the VM and added more gpu memory and it seems to be working now. – Qwertie Nov 07 '15 at 01:10