Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running Ubuntu 12.04 on a MacBook 4,1 (Intel GMA X3100 graphics chipset) on an external monitor, but can only get a resolution of 1024 x 768 (I get 1280 x 1024 in OS X).

I'm able to force the resolution to 1280 x 1024 using the xrandr command as per these instructions, but there are two issues now:

  1. The screen is off center, by maybe a couple dozen pixels up and to the left.

  2. The instructions are for 10.04, and the directions for making the change permanent do not work in 12.04.

Any way to fix this?

UPDATE: I believe the driver is the root of the problem. Ubuntu listed the graphics device as "Unknown" until I installed mesa-utils. I also get a message on boot before the desktop loads that says something along the lines of 00:02.0: i915 Invalid ROM contents.

Here is the relevant output of lspci -v:

00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03) (prog-if 00 [VGA controller])
    Subsystem: Apple Inc. Device 00a1
    Flags: bus master, fast devsel, latency 0, IRQ 45
    Memory at d0100000 (64-bit, non-prefetchable) [size=1M]
    Memory at c0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 6110 [size=8]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: intelfb, i915

00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (secondary) (rev 03)
    Subsystem: Apple Inc. Device 00a1
    Flags: fast devsel
    Memory at d0200000 (64-bit, non-prefetchable) [disabled] [size=1M]
    Capabilities: <access denied>

I tried using xrandr --output VGA1 --pos 10x10 to see if it would reposition the screen but nothing happened.

share|improve this question

2 Answers 2

I fixed (1).

I suspected the modeline numbers I've been entering in xrandr are inaccurate, so I downloaded SwitchResX for OS X, which has an option to export modelines. So I got the modeline for the 1280 x 1024 mode I use in OS X, put it into xrandr in Ubuntu and now the screen isn't offset anymore!

Now I just need to know how to make this change permanent.

share|improve this answer

Have you tried editing the /etc/lightdm/lightdm.conf file?

How to force Multiple Monitors correct resolutions for LightDM?

For instance, adding

display-setup-script=/usr/share/lightdmxrandr.sh

runs the above script at the login screen.

And adding

session-setup-script=/usr/share/lightdmxrandr.sh

runs the above script during the session.

In my case, that script says the following:

#!/bin/bash

# connected external output
XCOM0=`xrandr -q | egrep '(HDMI1|VGA1|DP1) connected' | egrep -o '(HDMI1|VGA1|DP1)'`
# command to set external desktop
XCOM1=`xrandr --output LVDS1 --primary --auto --output $XCOM0 --auto --right-of LVDS1`
# command to set normal desktop
XCOM2=`xrandr --output LVDS1 --primary --auto`
# if the external monitor is connected, then we tell XRANDR to set up an extended desktop
if [ -n "$XCOM0" ] || [ ! "$XCOM0" = "" ]; then echo $XCOM1
# if the external monitor is disconnected, then we tell XRANDR to output only to the laptop screen
else echo $XCOM2
fi

exit 0;


# ERASE THESE COMMENTS:
# Forces multiple monitors correct resolutions for LightDM
# Tested with Ubuntu 12.04 LTS.
# Save this file as lightdmxrand.sh
# Set as an executable file like this: 
#  $ sudo chmod +x lightdmxrand.sh
# Move it to /usr/share/ directory like this:
#  $ sudo mv lightdmxrand.sh /usr/share/lightdmxrandr.sh
# Edit /etc/lightdm/lightdm.conf adding the given line to it: display-setup-script=/usr/share/lightdmxrandr.sh
# If you want this script to also run after the login, add: session-setup-script=/usr/share/lightdmxrandr.sh

Hope it works!

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.