«

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

Posted on March 1, 2011
Filed Under Linux | 26 Comments     


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:
sudo add-apt-repository ppa:disper-dev/ppa
sudo apt-get update
sudo apt-get install disper

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:

disper -l

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:

 
       -l, --list
              list the attached displays

       -s, --single
              only enable the primary display

       -S, --secondary
              only enable the secondary display

       -c, --clone
              clone displays

       -e, --extend
              extend displays

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
If you find this post useful, consider donating a few bucks to help the server running cost.

Go to Top

Subscribe to keep track of your comment.
26 Comments so far
  1. [...] Previous Next [...]
  2. Hugh November 28, 2011 5:49 pm
    Worked brilliantly for me on an HP dv6700 running Ubuntu 11.10

    Thanks so much!
  3. El Grazo December 13, 2011 2:57 am
    awesome, everything i needed, thanks man!
  4. enrico December 18, 2011 2:10 am
    dell xps core i7, it didn't work :(
  5. Laura January 13, 2012 2:48 am
    This was the only way to solve my problems.. Thank you! Old PC + Ubuntu 11.10
  6. Daniel San Pedro January 18, 2012 3:49 pm
    Check this out:

    http://www.vknuckles.net/use-disper-and-a-bash-script-to-change-resolution-when-docking-and-undocking/

    Maybe this script can help you out (also uses disper)
  7. Harald February 1, 2012 2:53 pm
    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!
  8. Silver February 19, 2012 4:15 pm
    Perfect program, easy to install, easy to use!
  9. smith March 20, 2012 9:17 am
    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!!!!
  10. Mariano May 24, 2012 9:30 am
    Thanks a lot!!! :D
  11. Xavier Portell June 26, 2012 8:46 am
    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: 1600x900
    display CRT-0: DELL P2211H
    resolutions: 320x240, 400x300, 512x384, 680x384, 640x480, 720x450, 700x525, 840x525, 800x600, 960x540, 832x624, 960x600, 1024x768, 1152x864, 1360x768, 1280x960, 1440x900, 1280x1024, 1400x1050, 1680x1050, 1600x1200, 1920x1200, 1920x1080


    Any help would be appreciated!

    Cheers,
    Xavi.
  12. Cuong June 26, 2012 7:34 pm
    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.
  13. Xavier Portell June 28, 2012 9:17 am
    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!
  14. Ed September 5, 2012 11:12 pm
    This method worked on my Asus laptop, model "Eee PC 1015PN", under Ubuntu 12.04.

    Thank you very much for the info!
  15. coz787 September 19, 2012 8:32 am
    Parfait et bien pratique pour projeter avec un "overhead projector"
    notamment ...
    Just brilliant ! M thanks
  16. Vikram Kamath December 9, 2012 8:44 pm
    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: 320x175, 320x200, 360x200, 320x240, 400x300, 416x312, 512x384, 640x350, 576x432, 640x400, 680x384, 720x400, 640x480, 720x450, 640x512, 700x525, 800x512, 840x525, 800x600, 960x540, 832x624, 1024x768, 1280x800
    display DFP-1: Samsung S24B300
    resolutions: 320x175, 320x200, 360x200, 320x240, 400x300, 416x312, 512x384, 640x350, 576x432, 640x400, 680x384, 720x400, 640x480, 720x450, 640x512, 720x480, 700x525, 800x512, 720x576, 840x525, 800x600, 960x540, 832x624, 960x600, 896x672, 928x696, 960x720, 1024x768, 1152x864, 1280x800, 1360x768, 1280x960, 1440x900, 1280x1024, 1600x900, 1400x1050, 1600x1024, 1680x1050, 1280x720, 1920x1080
  17. Babar December 17, 2012 3:20 am
    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: 1024x768, 800x600
    Can anybody help me to fix the issue.Like how i can connect my monitor to my laptop.
    Thanks in advance
  18. Lehel February 11, 2013 12:18 pm
    on Dell XPS15 l502x this does not works either unfortunately, i'm checking it via bumblebeed
  19. [...] recently I noticed there is a more reliable tool called disper which has been developped for facilitating the monitor [...]
  20. Darrel April 28, 2013 2:59 pm
    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 <a href="http://almesryoon.com/forum/entry.php?8852-Planning-Your-UK-Pension" rel="nofollow">Darrel</a>
  21. Jason June 10, 2013 11:02 am
    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"
  22. VGA Switch June 11, 2013 1:52 pm
    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.
  23. rackmount lcd monitor June 27, 2013 1:18 am
    I found it really useful, this can solve the problem by taking less time. I have tried this in my laptop and the issue has been solved, thanks for the great post.
  24. Northon Torga June 28, 2013 4:30 pm
    Try add the resolution after the command, like:

    disper --secondary 800x600

    it works here.
  25. [...] « Previous Next »Switch to External Monitor Connected via HDMI/VGA port in UbuntuPosted on March 1, 2011Filed Under Linux | 24 Comments   More Sharing ServicesShareTable of Contents:Disper PackageRelated Links&nbsp;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&#8217;s rather inconvenient. I want this to be done without restarting.&nbsp;Disper PackageAfter some more researching, I found a tool called &#8220;disper&#8221;, which does exactly what I need. After installing the tool, and run &#8220;disper -l&#8221;, 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&#8217;s how to install it to Ubuntu 10.10:sudo add-apt-repository ppa:disper-dev/ppasudo apt-get updatesudo apt-get install disperNow you can run disper command to detect the external display. Plug the HDMI cable (VGA port should work too, but I haven&#8217;t tested it) in, run:disper -lOpen 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&#8217;s it.Run &#8220;man disper&#8221; to see what options you have. Here are some very useful ones:&nbsp; -l, &#8211;list list the attached displays -s, &#8211;single only enable the primary display -S, &#8211;secondary only enable the secondary display -c, &#8211;clone clone displays -e, &#8211;extend extend displaysI don&#8217;t even bother to bind the command to a hot key, since I don&#8217;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.via Switch to External Monitor Connected via HDMI/VGA port in Ubuntu : Code Central. [...]
  26. 0Fux June 19, 2014 12:02 pm
    *tips hat*

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments
If you want to post source code, please wrap it with <pre> </pre>, or it will break.
For quotations, please use <blockquote> </blockquote>

Subscribe to keep track of your comment.

To my beloved readers:
Please note that you may freely post comments here, but I will most likely not be able to reply to most them due to my current availability.

Code Central Special

Polls

  • Which one do you prefer?

    View Results

    Loading ... Loading ...

Recent Comments