Switch to External Monitor Connected via HDMI/VGA port in Ubuntu

This is more like part II of the article I posted earlier about my laptop issues in Ubuntu. I finally managed to get the HDMI (possibly VGA) port working. Keep reading if you are interested.

I found that I have to connect the HDMI cable before Ubuntu is booted up. If I do that, I am able to see the external monitor in Nvidia X Server Setting window. So either connect the cable before starting the OS, or connect the cable and then restart the OS will both work. This works well, but it's rather inconvenient. I want this to be done without restarting.

 

Disper Package

After some more researching, I found a tool called "disper", which does exactly what I need. After installing the tool, and run "disper -l", the external monitor instantly shows up in the Nvidia X Server Setting window. I then can set up dual monitor, change resolution, etc. So here's how to install it to Ubuntu 10.10:

Now you can run disper command to detect the external display. Plug the HDMI cable (VGA port should work too, but I haven't tested it) in, run:

Open Nvidia X Server Setting, you should see the external display is added. Configure TwinView should get you a dual monitor set up for your laptop. That's it.

Run "man disper" to see what options you have. Here are some very useful ones:

I don't even bother to bind the command to a hot key, since I don't mind to type in the terminal. Now all the hardware issues of Asus N73JQ are solved, cheers! Again, if you want to post your laptop model + OS if this has worked for you, you are welcome to.

Related Links

Previous Post
Disper homepage
Disper Lauchpad page

23 Comments Switch to External Monitor Connected via HDMI/VGA port in Ubuntu

  1. Pingback: Fix Ubuntu 10.10 Suspend/Hibernate Not Working Bug | Code Central

  2. Harald

    Thank you very much for the hint, this solved my problem.
    Maybe you want to have a look at the "cycle-stage"-option of disper: just adding a launcher with
    disper --cycle-stages='-s : -S' --cycle
    will enable you to switch between primary and secondary display with a simple button press...
    Anyway, thanks again!

  3. smith

    Great Post, I've been looking for something like this! Worked immediately, waaaay quicker than switching to my Windows OS just to watch movies on my TV. Thanks!!!!

  4. Xavier Portell

    Thanks a lot! It was extremely useful but suddenly stopped working. I don't know why this is the case. I have an HP EliteBook 8440p and an external DELL screen. It is more than one year that I am running without problems but suddenly I got a:

    disper -e
    could not switch to metamode 51: resolution not found

    Any idea? I am running Ubuntu 10.04 LTS and maybe it was one of the recent updates that screwed this... I tried reinstalling disper but no success.

    If I run:

    disper -l

    I obtain:

    display DFP-3: AU Optronics Corporation
    resolutions: 1600×900
    display CRT-0: DELL P2211H
    resolutions: 320×240, 400×300, 512×384, 680×384, 640×480, 720×450, 700×525, 840×525, 800×600, 960×540, 832×624, 960×600, 1024×768, 1152×864, 1360×768, 1280×960, 1440×900, 1280×1024, 1400×1050, 1680×1050, 1600×1200, 1920×1200, 1920×1080

    Any help would be appreciated!

    Cheers,
    Xavi.

  5. Cuong

    Same problem here, but I notice that after the recent update, I can use Fn + F7 (for my Toshiba) to switch monitors. Give that a try.

  6. Xavier Portell

    Many thanks, Cuong!

    I gave it a try and it works! Actually, in my laptop is Fn+F4.
    So it seems that after the recent update, the hot key combination works and the disper doesn't. Well, now I don't need it anymore if the other is working.

    Thanks for the tip!

  7. Ed

    This method worked on my Asus laptop, model "Eee PC 1015PN", under Ubuntu 12.04.

    Thank you very much for the info!

  8. coz787

    Parfait et bien pratique pour projeter avec un "overhead projector"
    notamment ...
    Just brilliant ! M thanks

  9. Vikram Kamath

    Thanks: My config.

    Running Ubuntu 11.10 on Macbook 6,1 and Samsung SyncMaster 24 (Mini DVI to HDMI)

    disper -e extended my laptop to my monitor. However, I am unable to switch positions between Notebook and monitor.

    Any pointers

    Heres output:
    disper -l
    display DFP-0: Apple
    resolutions: 320×175, 320×200, 360×200, 320×240, 400×300, 416×312, 512×384, 640×350, 576×432, 640×400, 680×384, 720×400, 640×480, 720×450, 640×512, 700×525, 800×512, 840×525, 800×600, 960×540, 832×624, 1024×768, 1280×800
    display DFP-1: Samsung S24B300
    resolutions: 320×175, 320×200, 360×200, 320×240, 400×300, 416×312, 512×384, 640×350, 576×432, 640×400, 680×384, 720×400, 640×480, 720×450, 640×512, 720×480, 700×525, 800×512, 720×576, 840×525, 800×600, 960×540, 832×624, 960×600, 896×672, 928×696, 960×720, 1024×768, 1152×864, 1280×800, 1360×768, 1280×960, 1440×900, 1280×1024, 1600×900, 1400×1050, 1600×1024, 1680×1050, 1280×720, 1920×1080

  10. Babar

    I have Dell XPS 15 i7.I try everything to connect a DELL monitor through HDMI/DVI cable but it is not working.I still have black screen.Also i have installed disper.
    The output of disper -l is
    display default: default
    resolutions: 1024×768, 800×600
    Can anybody help me to fix the issue.Like how i can connect my monitor to my laptop.
    Thanks in advance

  11. Pingback: Switching display quickly with disper | Sven Logan's Blog

  12. Darrel

    Hey there,
    Someone in my Facebook group shared this website with
    us so I came to give it a look. I'm loving the content! Terrific blog

    To access even more great information check out my web-site on Darrel

  13. Jason

    Didn't work for me. Running a Lenovo Thinkpad W520. Every time I type which selection I want to choose into terminal it says "command not found"

  14. VGA Switch

    I found that I have to connect the HDMI cable before Ubuntu is booted up. By doing that, I am able to see the external monitor in Nvidia X Server Setting window. So either connect the cable before starting the OS, or connect the cable and then restart the OS will both work. This works well, but I found it a bit inconvenient.

  15. Northon Torga

    Try add the resolution after the command, like:

    disper --secondary 800×600

    it works here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">