You are not logged in.

#1 2012-10-07 16:04:17

mtszyk
Member
Registered: 2012-10-07
Posts: 2

VirtualBox XOrg Dual Monitor

I'm attempting to set up an arch install with Awesomewm in VirtualBox with a windows host. I have a dual monitor setup, which is appropriately set up within VBox. I can get the second monitor to clone the first with default xorg settings, and I can get it to work correctly with an xrandr command, but I would like it to be default. I have installed and set up the three VBox kernel modules.

DevBox% xrandr -q
Screen 0: minimum 64 x 64, current 1440 x 900, maximum 32000 x 32000
VBOX0 connected 1440x900+0+0 0mm x 0mm
   1440x900       60.0*+
   1024x768       60.0
   800x600        60.0
   640x480        60.0
VBOX1 connected 1440x900+0+0 0mm x 0mm
   1440x900       60.0*+
   1024x768       60.0
   800x600        60.0
   640x480        60.0

DevBox% lspci | grep VGA
00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter

The command that works to set the screens up appropriately is:

DevBox% xrandr --output VBOX1 --mode 1440x900 --right-of VBOX0

And finally, the part I would like to get to work is the xorg conf file below, but it doesn't. I'm not really sure what I'm doing, I've just taken bits from archwiki xorg, archwiki multihead, and awesomewiki multihead, and mashed them together. I have tried with/without the position options and various other things, but I'm sure it's something basic I'm missing if that xrandr command works.

Section "Monitor"
    Identifier	"VBox0"
    Option          "Primary" "True"
    Option          "PreferredMode" "1440x900"
    Option          "Position" "0 0"
EndSection

Section "Monitor"
    Identifier	"VBox1"
    Option          "RightOf" "VBox0"
    Option          "Primary" "False"
    Option          "PreferredMode" "1440x900"
    Option          "Position" "1440 0"
EndSection

Section "Device"
    Identifier	"Device0"
     # BusID          "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier		"Screen0"
    Device			"Device0"
    Monitor			"VBox0"
    DefaultDepth		24
    SubSection		"Display"
  	    Depth		24
  	    Modes		"1440x900"
  	    Virtual		2880 900
    EndSubSection
EndSection

Disclaimer: I've never had multi monitors for linux before, so I'm really just flailing around here. Are xorg confs sensitive to tabs vs spaces?

Offline

#2 2012-10-07 19:22:47

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: VirtualBox XOrg Dual Monitor

It doesn't matter if you use tabs or a spaces to align the text. Same goes for fstab (/etc/fstab) and pretty much any configuration file.


If you can move windows from one monitor to the other, use an AutoHotkey script to start and resize the VirtualBox window to 2880x900 (double width), so that it covers both monitors.

Untested script:

; Hide the task bar:
WinHide, ahk_class Shell_TrayWnd

Run, C:\Program Files\VirtualBox\VirtualBox.exe -startvm "Arch Linux"
Sleep 1200
WinActivate, A
WinMove, A, , 0, 0, 2880, 900

; Remove the border and the window title:
WinSet, Style, -0xC40000, A

WinWaitClose, A
WinShow, ahk_class Shell_TrayWnd
ExitApp
Return

(you may need to replace the "A" instances with the actual name of the virtual machine window, because it may resize the VboxManager window instead)

Last edited by DSpider (2012-10-07 19:30:37)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-10-07 20:33:02

mtszyk
Member
Registered: 2012-10-07
Posts: 2

Re: VirtualBox XOrg Dual Monitor

Clever solution, though that isn't quite what I'm looking for. The main reason is that I use a tiling WM with automatic scaling, so I'd prefer to avoid windows split in between the two monitors.

If it was not clear (sorry!), I have two virtual monitors from VirtualBox (which in the host are simply two windows), and xrandr reports them as VBOX1 and VBOX0. So they are detected and displaying properly, but with the default Xorg setup simply clones one monitor to the other. I can resolve this with the command above (xrandr with rightof stuff), but I'd prefer to have a "system wide" solution instead of slapping that command in my xinitrc, which I am currently doing.

Thanks for your time, though!

Offline

Board footer

Powered by FluxBB