Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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: http://ubuntuforums.org/archive/index.php/t-1689514.html

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

xrandr --addmode VBOX1 1600x1200_60.00 as 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

yields:

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

Has anyone else encountered something similar?

share|improve this question

migrated from stackoverflow.com May 23 '12 at 23:41

This question came from our site for professional and enthusiast programmers.

2 Answers 2

up vote 6 down vote accepted

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:

#!/bin/bash

# Script to automatically resize virtual monitors in VirtualBox

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

# Start the client service
VBoxClient-all

# 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
MAP0="VBOX0"
MAP1="VBOX1"

# 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
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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