Page 1 of 1

[SOLVED] How to setup dual monitor using VirtualBox?

Posted: 7. Oct 2013, 13:48
by abcuser
Hi,
I did the following:
1. I have connected two monitors to my PC one using DVI and one VGA.
2. Turn on PC running Ubuntu 8.04 as host. On both monitors are the same image displayed.
3. In VirtualBox 4.2.18 GUI I have clicked on "Windows XP" virtual machine Settings.
4. In Display tab I have set "Video Memory" to 80 MB and "Monitor Count" to 2.
5. Started Windows XP virtual machine. VirtualBox guest additions are installed.
6. Control Panel | Display | Settings tab.
7. From Display drop down window I see there are two monitor adapters recognized both have the same name "(Multiple Monitors) on VirtualBox Graphics Adapter". In "Drag the monitor..." I see monitor "1" in blue and monitor "2" is grayed out. I clicked on monitor "2" and clicked on "Extend my Windows desktop onto this monitor" and clicked on Apply button. Nothing really happened on both monitors I still have the same image. If I click on Identify button on both it is displayed big white number "1".

Am I missing something? Should I set something else?

Re: How to setup dual monitor using VirtualBox?

Posted: 7. Oct 2013, 16:08
by mpack
You do understand that this is a virtual machine, and hence the virtual monitors are unrelated to your physical monitors? If you specify two monitors in your VM recipe then two VM windows will be created. One of these can certainly be dragged to your second physical monitor for those that have one. I'm not sure that installing the GAs is necessary for the fundamental feature to work, but will certainly be necessary in order to get good performance.

All that should be required is to add more than one monitor to the VM recipe, and make sure VBox isn't giving you any warnings about low graphics RAM.

Re: How to setup dual monitor using VirtualBox?

Posted: 8. Oct 2013, 12:57
by abcuser
mpack wrote:You do understand that this is a virtual machine, and hence the virtual monitors are unrelated to your physical monitors?
Thanks a lot, now I understand, I have to configure dual monitor on my host first BEFORE playing around with virtual machine settings and virtual machine operating system display settings.
Thanks a lot.

Re: How to setup dual monitor using VirtualBox?

Posted: 8. Oct 2013, 13:00
by abcuser
BELLOW ARE STEP BY STEP INSTRUCTIONS HOW I SOLVED THE PROBLEM IF ANYONE NEEDS MORE INFO:
1. My environment:
- physical PC supports two video card graphical outputs (VGA and DVI port)
- host operating system Ubuntu 8.04 (yes I know an old one and I should migrate)
- virtual environment VirtualBox 4.2.18
- virtual machine using Windows XP (name of this virtual machine in my case is "WindowsXP")

2. Turn off your computer (for safety reasons) and physically plug in both monitors to single computer. In my case first monitor to VGA port and second to DVI port. My monitors on desk are in the same order first is VGA attached and second to the right is DVI attached.

3. Turn on computer and on Ubuntu host execute the following command to query the monitor adapters names and screen resolution supported:

Code: Select all

xrandr -q
Note: Output of command in my case are monitor adapters: VGA and TMDS-1 and look for maximum supported mode in my case 1680x1050 for both monitors.

4. On Ubuntu 8.04 host open file /etc/X11/xorg.conf and inside "Screen" section add Display section:

Note: I was talking to my friend, who is using the latest version of Ubuntu and settings in this step 4 are no longer required. Ubuntu in newer versions tries to avoid this file when dealing with X-window. So maybe this step is no longer needed in your case, so skip step 4 if using newer Ubuntu version.

Note: If following this step 4 I strongly suggest to create a backup file in case if something goes wrong:

Code: Select all

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old
With text editor open bellow file:

Code: Select all

gksudo gedit /etc/X11/xorg.conf
In Screen section add Display subsection, so in my case from:

Code: Select all

Section "Screen"
	Identifier "Default Screen"
	Monitor    "Configured Monitor"
	Device     "Configured Video Device"
EndSection
change to and save the file:

Code: Select all

Section "Screen"
	Identifier "Default Screen"
	Monitor    "Configured Monitor"
	Device     "Configured Video Device"
        SubSection "Display"
               Depth 24
               Modes "1680x1050" "1680x1050"
               Virtual 3360 1050
        EndSubSection
EndSection
Note: In Modes there are first and second monitor in my case both have the same maximum screen resolution of 1680x1050 (see step 3 how to get this info). In Virtual data "3360" is the sum of width of modes 1680 + 1680. Virtual data "1050" is the max high size of both modes in my case "1050".

5. Restart Ubuntu (or just restart X).

6. On Ubuntu host execute command, to get your host into two dual monitor state:

Code: Select all

xrandr --auto --output TMDS-1 --mode 1680x1050 --right-of VGA
Executing above command and host monitor should now go into dual monitor (one screen spreading both monitors).

Note: Settings TMDS-1, VGA and mode 1680x1050 are the settings from step 3 (xrandr -q).

6. VirtualBox GUI:
a) Click on virtual machine (in my case WindowsXP) and Settings button from toolbar.
b) Display tab | Video tab | Video Memory set as much as possible in my case: 128 MB
c) Display tab | Video tab | Monitor Count: 2

7. On host run virtual machine from VirtualBox GUI.

8. Login into virtual machine Windows XP.

9. If not already installed, install VirtualBox Guest Additions inside virtual machine.

10. Inside Windows XP virtual machine
a) Control Panel | Display | Settings tab | Click on first monitor and set Screen resolution.
b) Control Panel | Display | Settings tab | Click on second monitor and set Screen resolution and check "Extend my Windows desktop onto this monitor" checkbox.

10. Execute full screen VirtualBox keyboard shortcut, by default it is: Right_Ctrl + F.
That is all. Dual monitor should appear spreading both monitors with single virtual machine image.

Useful additional info that made me possible to configure above settings:
http://www.maketecheasier.com/how-to-se ... th-xrandr/
http://superuser.com/questions/109485/v ... l-monitors
http://draptik.wordpress.com/2011/01/01 ... -monitors/