I am working in a VirtualBox 4 VM running Slackware-current. I have added an external monitor, and am attempting to set up both of them to run in their native resolutions, but am having no luck.

I am following the instructions set out at on this page.

But I cannot get past the step where I add a new monitor mode, ie:

xrandr --addmode VBOX1 1600x1200_60.00

When I run that, I get an error message:

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 151 (RANDR)
Minor opcode of failed request: 18 (RRAddOutputMode)
Serial number of failed request: 20
Current serial number in output stream: 21

I have gone through a number of forums, installed the latest version of VirtualBox4, and installed the Guest OS Runtime utilities.

I have also made sure that my virtual display can handle this, ie: xrandr | grep -i maximum


minimum 64 x 64, current 800 x 600, maximum 32000 x 32000

Has anyone else encountered something similar?


I've encountered this exact problem myself.

First, in most of the guides, you usually do the following:

  1. Specify a monitor resolution, then provide it to gtf:
    gtf 1024 768 60 (get the Modeline information for 1024x768 resolution at 60Hz).
    In my case, it yields:

    #1024x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 64.11 MHz Modeline "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync

  2. Create the new mode:
    xrandr --newmode "1024x768_60.00" 64.11 1024 1080 1184 1344 768 769 772 795 (DO NOT include the trailing -HSync +Vsync . Some guides tell you to do this, but it will break the configuration for some reason).

  3. Now you should be able to add the mode to a new display:
    xrandr --addmode VBOX0 1024x768_60.00

  4. Set the new mode for the device: xrandr --output VBOX0 --mode 1024x768_60.00

If step 3 failed still (these steps work for my laptop screen which is 1680x1050, but for some reason not for my external monitor which supports 1600x1200. These steps do work for resolutions up to 1280x1024 for my external monitor though. Weird), you can still try letting xrandr use auto mode. In my case, it allowed me to have my laptop screen and external monitor working perfectly. The script I use is attached below:


# Script to automatically resize virtual monitors in VirtualBox

# Start the server
sudo killall VBoxService
sleep 1
sudo VBoxService
sleep 1

# Start the client service

# Get the modeline information we want for the following resolutions:
# 1680x1050@60.00Hz (Laptop display)
RES0="1680 1050 60"
# 1280x1024@60Hz (External monitor)
RES1="1280 1024 60"

# Setup mappings for physical to virtual monitors

# Generate settings
SETTINGS0=$( gtf $RES0 | grep Modeline | cut -d ' ' -f4-16 )
SETTINGS1=$( gtf $RES1 | grep Modeline | cut -d ' ' -f4-16 )

# Get name of modelines from settings
NAME0=$( echo $SETTINGS0 | cut -d ' ' -f1 )
NAME1=$( echo $SETTINGS1 | cut -d ' ' -f1 )

# Echo settings
echo "Modeline for Display 0 ($NAME0): $SETTINGS0"
echo "Modeline for Display 1 ($NAME1): $SETTINGS1"

# Create the new modelines via xrandr
xrandr --newmode $SETTINGS0
xrandr --newmode $SETTINGS1

# Add the newly created modelines to devices
xrandr --addmode $MAP0 $NAME0
xrandr --addmode $MAP1 $NAME1

# Finally, enable the new modes
xrandr --output $MAP0 --mode $NAME0
xrandr --output $MAP1 --mode $NAME1

# Extra: Attempt to run "auto" mode on the external monitor
# This is out last-ditch effort (which worked in this case) to get it running at
# 1600x1200 instead of 1280x1024 :)
xrandr --output $MAP1 --auto --above $MAP0
  • 3
    xrandr --addmode VBOX0 "1600x900_60.00" gives me following error: Failed to get size of gamma for output default. cannot find output "VBOX0" – stiv Mar 31 '15 at 10:51
  • I get xrandr --newmode $SETTINGS0 X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 149 (RANDR) Minor opcode of failed request: 25 (RRGetScreenResourcesCurrent) Serial number of failed request: 11 Current serial number in output stream: 11 – moodboom Aug 1 '17 at 19:16

I had the same problem when running Arch on virtualbox. Allocating more Video Memory seems to resolve this issue for me.

enter image description here

  • 1
    After many unsuccessful attempts, this finally worked for me. – Onion Aug 19 '15 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.