Disabling laptop monitor on boot?

30,462

Solution 1

I managed to find a fix for my problem. I simply added this to my /etc/default/grub file:

GRUB_CMDLINE_LINUX_DEFAULT="<default paramaters> video=LVDS-1:d"

Then did a good ol' fashin update-grub.

This disabled the laptop's LCD on boot, and allowed the external monitor to automatically set its resolution, which worked without a hitch.

Solution 2

If your kernel has i915 driver enabled, the following (which I quote from ArchLinux Wiki, and which in turn quotes from nouveau wiki) might prove helpful.

Basically you could experiment with adding video=... parameter in grub using the d option (see the parameter format below) to disable the internal monitor (whichever name it might have for <conn> option you need to find from the system log which should display the available options during kernel start-up. The information might still be available from previous start-up in /var/log/dmesg if your distro has that, please try grep i915 /var/log/dmesg* and post it here.

https://wiki.archlinux.org/index.php/Kernel_Mode_Setting:

A mode can be forced on the kernel command line. Unfortunately, the command line option video is poorly documented in the DRM case. Bit and pieces on how to use it can be found in

http://cgit.freedesktop.org/nouveau/linux-2.6/tree/Documentation/fb/modedb.txt
http://cgit.freedesktop.org/nouveau/linux-2.6/tree/drivers/gpu/drm/drm_fb_helper.c

The format is:

video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]

<conn>: Connector, e.g. DVI-I-1, see your kernel log.
<xres> x <yres>: resolution
M: compute a CVT mode?
R: reduced blanking?
-<bpp>: color depth
@<refresh>: refresh rate
i: interlaced (non-CVT mode)
m: margins?
e: output forced to on
d: output forced to off
D: digital output forced to on (e.g. DVI-I connector) 

You can override the modes of several outputs using "video" several times, for instance, to force DVI to 1024x768 at 85 Hz and TV-out off:

video=DVI-I-1:1024x768@85 video=TV-1:d

Share:
30,462

Related videos on Youtube

Joshua Merriman
Author by

Joshua Merriman

Updated on September 18, 2022

Comments

  • Joshua Merriman
    Joshua Merriman over 1 year

    I'm using a laptop with Ubuntu (no graphical desktop) to do all of my work. The resolution is awful, at 1024x576 or something similar. So I just close my laptop lid and plug it into an external monitor - but the external one never seems to stretch out to its full size.

    The reason for this is that the laptop monitor is always enabled - even when the laptop lid is closed. As a result, the external monitor never assumes the full size, and any time I set GRUB to use a resolution higher than 1024x576, the external screen ignores it.

    Is there any way to disable the laptop screen in GRUB, or to specify which screen I want as the primary one? I've tried Google, and absolutely nothing comes up.

    (The computer is a Lenovo S10e, if it helps at all.)

    • Doktoro Reichard
      Doktoro Reichard over 10 years
      Well, in Windows, you could select the primary display after you connected the second. I doubt that you can set the external display as default, seeing as it would give a lot of problems to the graphics card (they expect some kind of display).
    • Joshua Merriman
      Joshua Merriman over 10 years
      @doktoro-reichard Uhh, this is in Linux.
    • Doktoro Reichard
      Doktoro Reichard over 10 years
      I know, I'm just telling you my experience (and not answering because I don't have Unix). Now, graphics cards need to be connected to a display at start - tried to disconnect my VGA cable from the PC then reconnected while the system was running, it froze. What this means is that unless the graphics board is granted that there is a display, it won't output anything. And since a laptop already has a display, it will output to there. Besides, you said you weren't using a graphical interface so why (in my opinion) should there be a function to control displays?
    • Joshua Merriman
      Joshua Merriman over 10 years
      @DoktoroReichard - You're totally misinterpreting what I'm asking for. I'm asking for a way to disable my laptop's screen in favour of using my external VGA output. Your comment added nothing to the discussion. And besides, "why (in my opinion) should there be a function to control displays?" Maybe because some people like myself want to use an external display over the pre-installed laptop display. It's not unheard of.
    • Joshua Merriman
      Joshua Merriman over 10 years
      @zagrimsan - My question stated that I'm running no graphical desktop, ergo I don't use X. Unless I'm missing something big, why would an X utility solve a non-X problem?
    • Doktoro Reichard
      Doktoro Reichard over 10 years
      @Joshua maybe this post might help
    • zagrimsan
      zagrimsan over 10 years
      Please post the output of uname -a
    • Joshua Merriman
      Joshua Merriman over 10 years
      @DoktoroReichard - While that is a nice post, it still applies to X. I don't have any form of graphical window system on my machine, and I don't plan on getting one soon.
    • Joshua Merriman
      Joshua Merriman over 10 years
      @zagrimsan - I managed to do just that, passing a single line to GRUB on boot to disable my laptop LCD, which let the external VGA display take over and set its own resolution.
    • Joshua Merriman
      Joshua Merriman over 10 years
      @zagrimsan - I will, give me some time! I'm not able to accept my own answer until two days have passed.
  • Joshua Merriman
    Joshua Merriman over 10 years
    That sounds good, but I also take the laptop out with me every day. Disconnecting the ribbon cable when I leave home then reconnecting it when I get home is totally impractical. Thanks for the answer anyways! :)
  • Sjoerd
    Sjoerd about 6 years
    This worked for me. I got the name for my screen by running xrandr.
  • Sjoerd
    Sjoerd about 6 years
    This didn't work for me. I removed the whole screen from the laptop, but still X would try to display on the missing laptop screen.
  • chirlu
    chirlu over 5 years
    I had to use LVDS-1 (with a hyphen) as in the example although xrandr gave the name as LVDS1 (without hyphen).