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.

My laptop supports 1366x768 resolution but, even after installing Guest Additions on my lubuntu-11.10-alternate-i386 virtual machine I have as available resolutions only (from xrandr):

   1024x768       60.0 +   60.0  
   1600x1200      60.0  
   1440x1050      60.0  
   1280x960       60.0  
   800x600        60.0* 
   640x480        60.0  
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Please check out my post here:

http://stackoverflow.com/questions/10725867/forcing-monitor-resolution-in-virtualbox-vm-on-linux-guest/10726041#10726041

#!/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

You can then just put this in your rc file (kderc, gtkrc-2.0, fvwm2rc) to run and then restart the desktop manager. Everything should look great!

Please note that the only extra bit of code in here is the --above $MAP0 argument, which means that the monitor for MAP0 is physically located above MAP0.

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.