Effectively using Virtualbox with Dual-Monitor-Host

This is for discussing general topics about how to use VirtualBox.
SigiAlpha
Posts: 1
Joined: 9. May 2009, 02:36
Primary OS: Debian Lenny
VBox Version: PUEL
Guest OSses: WinXP

Effectively using Virtualbox with Dual-Monitor-Host

Post by SigiAlpha »

Hi!

The goal is to replace my .NET development machine with a Linux host running WinXP and Visual Studio 2008 in Virtualbox.
So far so good... The performance is pretty good and VS2008/WPF runs much better in Virtualbox than I had expected. The only annoyance is the fact, that Virtualbox is restricted to a single monitor. I'm used to run Visual Studio with the code editor on the primary and the output panels on the secondary monitor. There seems to be no chance to have Vbox run fullscren on both monitors. All I can do is manually resize the VirtualBox Window to span both monitors. Seemless mode too runs only on one monitor. I played around with running vbox headless and using two rdesktop windows - one for each monitor, but this is just too awkward to handle.

Is there any better solution for effectively using Virtualbox with a dual-monitor-host?

Siegmar
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by Perryg »

Good evening Siegmar,

Check the links below: Some good, some not good but it will give you some direction I hope.

http://www.google.com/search?q=virtualb ... =firefox-a
sorrydaijin
Posts: 7
Joined: 19. May 2009, 04:02
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: XPx2

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by sorrydaijin »

This thread was a wealth of info for getting my setup running:
http://forums.virtualbox.org/viewtopic.php?p=23604

My final solution was to do this, assuming VM name is BOX (Incidentally I run an XP guest on a Ubuntu 9.04 host with two 1280*1024 monitors)

# Set up 2 monitors
VBoxManage modifyvm BOX -vrdpmulticon on
VBoxManage modifyvm BOX -monitorcount 2

# Run VM in headless mode and set a resolution that fits your screen with gnome taskbars
VBoxHeadless -s BOX &
VBoxManage controlvm BOX setvideomodehint 1280 975 32 0

# Login Using rdesktop and enable second monitor then enable 2nd monitor before powering down
rdesktop localhost &


I then made the following bash script (my first ever!)

Code: Select all

#!/bin/bash

# Run VM in headless mode
VBoxHeadless -s BOX &

# Set Video size
VBoxManage controlvm BOX setvideomodehint 1280 975 32 0

# Wait for 20 seconds
sleep 10

# Run first screen
rdesktop -d @1 -D -T screen1 -k ja localhost &

# Run second screen
rdesktop -d @2 -D -T screen2 -k ja localhost &

#Run devilspie to position screens
devilspie &

screen1 resolution is 1280*975*32 and screen2 resolution is 1280*1024*32

I then installed devilspie and set it up to place screen1 on the lower left quarter of my workspace and screen2 on the lower right by placing these files in ~/.devilspie/

screen1.ds

Code: Select all

(if
(is (application_name) "screen1")
(begin
(geometry "+0+1024")
(maximize)
)
)
screen2

Code: Select all

(if
(is (application_name) "screen2")
(begin
(geometry "+1280+1024")
(maximize)
)
)
I hope all that makes sense. I will brush it up to be a little more coherent if anyone is interested.
Last edited by sorrydaijin on 20. May 2009, 03:36, edited 1 time in total.
HolgerB
Posts: 58
Joined: 28. Jul 2008, 23:36

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by HolgerB »

Hi sorrydaijin,

wow, this is a complete guide how to set up a multi-head VM environment :D

Thanks for that.

There is one thing wondering me:
Is it possible to use an RDP client on a second PC simply representing a "monitor" while completely using the input devices from a main PC ?

Consider my scenario:
I have two PCs. One is my Linux workstation and one my WinXP PC. I have two LCD monitors (one 15" and one 17"). The main monitor (17") as well as mouse and keyboard are connected to both PCs. So I can switch between them both. The second monitor (15") is connected to the WinXP PC only. I mainly use the Linux Box as VBox Host since it has more RAM. It would be very cool if I could start up an RDP client on the WinXP machine connecting to a WinXP VBox running on the Linux machine as representation of the second display. Main display and controls (keyboard & mouse) would be physically connected to the Linux host though. The problem I had while quickly checking this scenario with my Linux box at work:
Each RDP client had different inputs. Both were showing a single mouse. I think using Cinergy could help but I "simply" want some "screen output only" RDP client for Windows *ggg*

When running both RDP sessions on one phyisical host this problem doesn´t exist though since you have only one pair of input devices.

Any ideas on this ?

TIA,
Holger
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by vbox4me2 »

Why not, you can rdp from the Host and move the screen elsewhere.
sorrydaijin
Posts: 7
Joined: 19. May 2009, 04:02
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: XPx2

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by sorrydaijin »

I am not sure you can do that HolgerB as it is my understanding that the mouse cursor input is taken from the RDP client (rdesktop in this case) window and will simply stop at the edge of the 17" screen when you try to drag it over to the 15" screen.

As my tinkering has been limited to my very specific needs, I am afraid my knowledge is a little to limited to be of much assistance beyond cases very similar to my own. I will post again if I think of anything.


Oh, and I am adding a line to the end of my VM startup script.

Code: Select all

devilspie &
HolgerB
Posts: 58
Joined: 28. Jul 2008, 23:36

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by HolgerB »

@vbox4me2:
Why not, you can rdp from the Host and move the screen elsewhere.
Hm, not really....
The more I think about it, the more I´m afraid that it will not work :)

@sorrydaijin:
I am not sure you can do that HolgerB as it is my understanding that the mouse cursor input is taken from the RDP client (rdesktop in this case) window and will simply stop at the edge of the 17" screen when you try to drag it over to the 15" screen.
Exactly that is my problem. One RDP client (the 2nd RDP "screen" on the 15" screen) would need to run on a Windows Host only as dumb display. The other RDP client (rdesktop) would run on the Ubuntu Host which is connected to the 17" screen. The only problem in this scenario is the input. As you´ve described the mouse in the rdesktop session would need to move "to the other" RDP session when moved to the corresponding screen border.
Running Synergy on both the Ubuntu host as well as the WinXP guest (with virtual multihead) would help here much since I can not limit Synergy to the second virtual screen of the VBox.

Hard to explain without drawing a few sketches but I hope you get the picture.

I think I´ll either have to forget dual head VM usage (which would be a nice to have only anyway) or have to find a cheap dual head KVM. Those things are really expensive. Esp. the more "modern" one with dual DVI and USB. :shock:

Thanks again,
Holger
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by fixedwheel »

i dont have the place for two monitors, sorry for offtopic :P but i have some boxes too ...
HolgerB wrote:or have to find a cheap dual head KVM. Those things are really expensive. Esp. the more "modern" one with dual DVI and USB. :shock:
my 19" LCD has two inputs: the one to my main box which has its own keyboard and mouse. A second "space-saving" keyboard and a mouse is connected to a cheap analog 2-port Dlink DKVM-2K. From there i have one connection fixed to a box, the other one is is easy to reach and to change when required ...
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by vbox4me2 »

If the 2 displays are connected to 1 machine with 2 video cards then what gets displayed where is a Host OS issue, not a VBox issue. The Host OS should easely be able, via the default dual monitor software, to move 'a' screen anywhere, once you rdp into a Guest the rdp screen can be moved to the second screen. I have the same here but with 1 video card with 2 outputs and 2x 22" screens, the nvidia drivers allow me to move whatever anywhere, vbox Guest GUI/rdp or not.
HolgerB
Posts: 58
Joined: 28. Jul 2008, 23:36

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by HolgerB »

@vbox4me2:
If the 2 displays are connected to 1 machine with 2 video cards then what gets displayed where is a Host OS issue, not a VBox issue.
True, but if one of the RDP sessions of the VBox VM (read: second virtual screen) is running on another host (= WINXP) than VBox itself this will not work. Of course I can use RDP from my WinXP Host where both monitors are physically connected to but since I often switch back and forth between my Ubuntu Host and the VBox machine the other approach I discribed would be way cooler :)

As I already stated it´s nice to have and will (most likely) not be possible without a special RDP client / configuration.

But hey, isn´t experimenting the stuff we all do every day ? ;)

@fixedwheel:
Thanks for your comment mate. I´m also using two inputs of a single monitor at work where I have a WinXP notebook with two TFTs connected and one TFT also serves as screen for my Linux box. The thing I would require for my two "Home servers" to work nicely with both monitors available to both machines is simlpy a dual DVI KVM switch for which I´m too cheap to buy :lol:

They call my Uncle Scrooge :mrgreen:

Cheers,
Holger
mykes
Posts: 39
Joined: 25. Nov 2008, 22:38

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by mykes »

It sure would be nice to be able to use multiple monitors.

As I've googled for solutions over the past few months, I've come across two things:
1) Use RDP
2) The vbox guys saying they'll fix it in version 1.6. What's up with that?

What I'd like to see is the start bar limited to primary monitor, but windows draggable anywhere, both monitors.

It sure doesn't seem like a difficult thing to do, since the X server is already doing it.
mykes
Posts: 39
Joined: 25. Nov 2008, 22:38

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by mykes »

The competition does it, though it costs $189 ;)

http://store.vmware.com/servlet/Control ... D=84535600

http://www.vmware.com/vmwarestore/dr_pd ... tures.html
Value-added features such as multiple monitor support, DirectX 9.0c with Shader Model 2 3D graphics, Integrated desktop experience with "Unity", plug-and-play USB 2.0 support, multiple snapshots, integrated remote debugging with Eclipse and Visual Studio and virtual machine record and replay.
"Unity" being seamless mode.
peripatew
Posts: 4
Joined: 19. Oct 2009, 23:51
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Win XP

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by peripatew »

I've followed the advice above, and have dual screen working through two rdp sessions.

A few questions, I've got my resolution on the primary screen set to 1280x1005 (19px bottom panel), but no panel on the second screen (for some reason I can't drag them over there). My host is the most recent version of Ubuntu, guest being Win XP SP3. Is there a way to set different resolutions for each screen? I've got some dead space at the top and bottom of my second screen.

Is there a way to span a single background image across both screens?

Is seamless support every going to work on two screens?
gismcieri
Posts: 4
Joined: 20. Nov 2009, 20:48
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: XP64

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by gismcieri »

Hi All,

I have tried all these suggestions but when I try to start the 2nd screen I have to login again and it logs out the first screen. What am I missing?

Thanks for the help,
Matt
gismcieri
Posts: 4
Joined: 20. Nov 2009, 20:48
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: XP64

Re: Effectively using Virtualbox with Dual-Monitor-Host

Post by gismcieri »

Hi,

I got it mostly figured out now I am working on the script. I had to tweek the rdesktop command

rdesktop -u username -d @1 -T screen1 localhost:3389 & rdesktop -u username -d @2 -T screen2 -g 1600x1100x0 localhost:3389 &

Now I need to figure out the devilpie stuff.

Thanks,
Matt
Post Reply