I would like my VM to have a ton of screen space. I'm fine with having to scroll to see the entire desktop, but I want a desktop in the VM much larger than the size of my current monitor. For example, if I have 1920x1080 monitor, I want to have a 2560x1600 desktop.
I know it's technically possible, because sometimes from strange resizing and what-not, I end up getting a VirtualBox window that is smaller than the guest OS's resolution, and scroll bars appear.
Having a similar need, I've searched and found the following: http://flink.formula9.net/?p=229
I've successfully performed the following using a OS X 10.10.3 host and Windows 8.1 guest (adapted to example by Andersson):
close the VirtualBox Manager
in the shell, run:
VBoxManage setextradata global GUI/MaxGuestResolution any
start the guest
in the shell, run:
VBoxManage controlvm "Windows 8 VM" setvideomodehint 3200 1800 32
Using Windows as host and VM target I have managed to achieve this the following way:
Close VirtualBox if open.
Open a command prompt and cd to the virtualbox installation dir
Run: VBoxManage.exe setextradata "NAME OF VM" CustomVideoMode1 WxHxD
Where "NAME OF VM" is the name of the virtual machine, W is width, H is height, D is depth.
e.g. To make 2560x1600 available for my VM with the name "Windows 8 VM" i would:
..VirtualBox> VBoxManage.exe setextradata "Windows 8 VM" CustomVideoMode1 2560x1600x32
The next time I boot up the "Windows 8 VM" I'm able to see the new custom resolution in the list together with the default resolutions (i.e. right click on desktop->Screen resolution).
Not sure if this method works on other hosts/targets than Windows.
Just use "Scale Factor", VirtualBox"6.1.32" Max “Scale Factor” could up to "300%".
You know,
"Guest Resolution" * "Scale Factor" == "Host Display size".
Or
"Max Guest Screen size" * "Scale Factor" >= "Host Display size".
e.g:
"1024*640" * "250%" == "2560*1600";
"1280*800" * "200%" == "2560*1600";
"2560*1600" * "100%" == "2560*1600";
Just use your default "1920×1080 monitor" for an example:
"1920×1080" * "100%" == "1920×1080" < "2560*1600`";
"1920×1080" * "200%" == "3840×2160" > "2560*1600";
"1920×1080" * "250%" == "4800×2700" > "2560*1600";
"1920×1080" * "300%" == "5760×3240" > "2560*1600";
Now, change your VM "Scale Factor", VM "Max Guest Screen Size",
Guest-General Display "Scale Factor" and Guest-Settings Display
"Resolution".
Notices:
Guest-Settings Display "Resolution" should be the same as VM "Max Guest Screen Size".
VM "Scale Factor" should be the same as Guest-General Display "Scale Factor".
Just use Virtual box for an example:
e.g: "1280*800" * "200%" == "2560*1600";
1.VM scale factor and max screen size:
click VirtualBox APP, then you see "Oracle Vm VirtualBox Manager",
move your mouse to top menu, found out VirtualBoxlogo, select
"Preference", then enter "VirtualBox – General", click Display,
Choose "Maximum screen size" to "Hint" with Width "1280" and
Height "800", and adjust "Scale Factor" to "200%", then click
"OK".
Guest scale factor:
When you enter VirtualBox APP, then you see "Oracle Vm VirtualBox Manager",
found out your guest machine name button, as mine is "linux_debian_11",
you will see "Power Off" under the name of your guest machine.
Please found out your guest machine "Menu Box Button", that is at the right
of your guest machine name, right-click your "Menu Box" or single click your
"Guest Machine Box", choose "Settings", then you will enter your guest
machine's "General", mine is "linux_debian_11 – General", then click
"Display", and adjust "Scale Factor" to "200%"(the same as Scale Factor
On virtual machine's "General").
Guest Resolution:
My guest machine is "Debian". So, just use "Debian" for an example here.
Click my guest machine "Debian"'s “Settings”, then found out "Display",
and, also, choose "Resolution" to "1280*800(16:10)".
No matter your Debian version is "8", or even "11", the upstairs settings
Is OK.
Are you ok? Said, Lei Jun.
Reboot Host Machine:
Now, it's your time to show!
Please restart my Mac/Windows.
Related
I need to install USB CDC driver (com port) to customers pc so my c++ mfc application works correctly. On windows 8 & 10 the driver is pre-installed, the problem is older verions of windows.
I have the driver from silabs, there is .cat, .inf and .exe files. After opening the installer - it just says "Silicon Laboratories. Inc. (usbser) Ports (03/26/2014 6.1.7601.17514) - Ready to use" after confirming the terms, nothing else.
I tried this but there is no usbser.sys or something like that in the list. And also this but nothing like "USB\VID_1BA4&PID_0002" (which I found in .inf file) wasn't found. I also tried to search for ClassGUID (4D36E978-E325-11CE-BFC1-08002BE10318) & class=ports in regedit. It's always found the same things, that's probably not what I'm looking for.
What should I look for? What parameter is important? Thanks.
.inf file
[Version]
Signature="$WINDOWS NT$"
Class=Ports
ClassGUID={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%SILICONLABS%
DriverVer=03/26/2014,6.1.7601.17514
CatalogFile=SiLabs-CDC.cat
[Manufacturer]
%SILICONLABS%=DeviceList, NT, NTAMD64, NTIA64
;------------------------------------------------------------------------------
[DeviceList]
%CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
%CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
%CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
%CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
%CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
[DeviceList.NT]
%CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
%CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
%CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
%CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
%CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
[DeviceList.NTAMD64]
%CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
%CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
%CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
%CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
%CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
[DeviceList.NTIA64]
%CDCDEVICE_1BA4_0002%=DriverInstall,USB\VID_1BA4&PID_0002
%CDCDEVICE_2544_0003%=DriverInstall,USB\VID_2544&PID_0003
%CDCDEVICE_10C4_0003%=DriverInstall,USB\VID_10C4&PID_0003
%CDCDEVICE_2544_0008_02%=DriverInstall,USB\VID_2544&PID_0008&MI_02
%CDCDEVICE_10C4_0008_02%=DriverInstall,USB\VID_10C4&PID_0008&MI_02
;------------------------------------------------------------------------------
[DriverInstall]
Include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=SerialPropPageAddReg
[DriverInstall.Services]
Include=mdmcpq.inf
AddService = usbser, 0x00000002, DriverServiceInst
[DriverServiceInst]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys
[SerialPropPageAddReg]
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
;------------------------------------------------------------------------------
[Strings]
SILICONLABS = "Silicon Laboratories, Inc."
CDCDEVICE_1BA4_0002 = "Silicon Labs CDC Serial port"
CDCDEVICE_2544_0003 = "Silicon Labs CDC Serial port"
CDCDEVICE_10C4_0003 = "Silicon Labs CDC Serial port"
CDCDEVICE_2544_0008_02 = "Silicon Labs CDC Serial port"
CDCDEVICE_10C4_0008_02 = "Silicon Labs CDC Serial port"
SERVICE = "USB CDC Serial Port Driver"
The code sample you use is Enumerating All Device Drivers in the System(loaded drivers).
I test with a FTDI USB-to-UART device. With the device attached to PC (driver loaded in memory) I can list related drivers like below, otherwise I can't.
So trying to attach the USB CDC device and try again.
Update based on comment: "But where I can find if the driver is already signed or not, that's the question."
Right click the *.sys file of the driver and check the digital signatures tab.
We have production machines running RedHat RHEL 5.11 / X.org version 7.1.1. The supplier of these machines provides a VirtualBox VM to allow software development on conventional computers, i.e. away from the production floor.
I would like to configure this VM for dual head / dual monitor / dual screen usage.
Step 1: The VM in VirtualBox Manager is configured for maximum video memory and 2 monitors.
Step 2: VirtualBox GuestAdditions are installed, version corresponding to the Virtual Box application.
Step 3: /etc/X11/xorg.conf is modified to support 2 devices, 2 screens and 2 monitors, all configured for the vboxvideo driver. The content is shown below:
# Xorg configuration created by system-config-display
Section "ServerLayout"
Identifier "Multihead layout"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "LCD Panel 1600x1200"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "LCD Panel 1600x1200"
EndSection
Section "Device"
Identifier "Videocard0"
Driver "vboxvideo"
BusID "PCI:0:2:0"
Screen 0
EndSection
Section "Device"
Identifier "Videocard1"
Driver "vboxvideo"
BusID "PCI:0:2:1"
Screen 1
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1600x1200" "1280x1024" "1280x960" "1280x800" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Device "Videocard1"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1600x1200" "1280x1024" "1280x960" "1280x800" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Step 4: reboot the system
I expect now that the system is set-up and ready to show two screens on my computer. Alas, it only shows Screen0.
Observations:
/var/log/Xorg.0.log shows no errors, but a couple of warnings:
(WW) VBoxVideo(0): Failed to set up write-combining range (0xe0000000,0x8000000)
In the same log file, only the instance VBoxVideo(0) is mentioned; there is no reference to VBoxVideo(1)
lspci also shows only one instance of the VBox video driver:
00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter
In VB Manager -> View only Virtual Screen 0 is said to be enabled; the other screen is available, but an "enable" option is presented, that appears to do nothing when selected.
Everything else I have seen seems to be consistent: the second screen is nowhere found on my RHEL VM.
Questions:
What is the importance of the warning on write-combining? Is this related to this problem?
Is vboxvideo driver / pseudo card a dual head card or should I instantiate a second card? What are the correct magic numbers for the BusID of the second "Device"?
Any other recommendation to get this configuration up-n-running?
I'm running Virtualbox 5.1.14 r112924 on a Windows 7 Professional machine. I have installed a Debian Testing guest. Several days ago I tried to save the machine, unfortunately I do not recall the exact circumstances, but I think it had to do with the guest having no network any more after the host came back from suspend-to-RAM.
Anyway, I now have a saved machine with which I cannot do anything: I cannot start it, I cannot delete the saved state, I cannnot clone it and I cannot even delete the entire machine. All these options are greyed out in the VB Manager window. Also, I don't get any errors, so I'm rather clueless what to do.
I include below parts of the most recent log file which I thought are relevant, I didn't want to paste the whole thing.
What sort of witchcraft can bring my machine back to life?
Many thanks, and best regards,
Enno
02:37:32.316550 Changing the VM state from 'RUNNING' to 'SUSPENDING'
02:37:32.319680 AIOMgr: Endpoint for file 'D:\Users\EnnoMiddelberg\VirtualBox VMs\Debian_Testing\Debian_Testing.vdi' (flags 000c0781) created successfully
02:38:32.373466 PDMR3Suspend: 60 056 883 803 ns run time
02:38:32.373494 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'
02:38:32.373520 Console: Machine state changed to 'Paused'
02:38:32.373700 VMR3Suspend:
02:38:32.393131 RUNNING -> SUSPENDING, RUNNING_LS -> SUSPENDING_EXT_LS failed, because the VM state is actually SUSPENDED
02:38:32.393177 VMSetError: F:\tinderbox\win-5.1\src\VBox\VMM\VMMR3\VM.cpp(3619) int __cdecl vmR3TrySetState(struct VM *,const char *,unsigned int,...); rc=VERR_VM_INVALID_VM_STATE
02:38:32.452926 VMSetError: VMR3Suspend failed because the current VM state, SUSPENDED, was not found in the state transition table (old state RUNNING_LS)
02:38:32.501235 ERROR [COM]: aRC=VBOX_E_VM_ERROR (0x80bb0003) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Could not suspend the machine execution (VERR_VM_INVALID_VM_STATE)}, preserve=false aResultDetail=0
02:38:32.605107 Console: Machine state changed to 'Saving'
02:38:32.635604 Changing the VM state from 'SUSPENDED' to 'SAVING'
02:38:32.747945 VUSB: Detached 'HidMouse' from port 1
02:38:40.213749 SSM: Footer at 0x23d179e4 (600930788), 34 directory entries.
02:38:40.213777 VUSB: Attached 'HidMouse' to port 1
02:38:40.231560 SSM: Successfully saved the VM state to 'D:\Users\EnnoMiddelberg\VirtualBox VMs\Debian_Testing\Snapshots\2017-05-23T14-48-18-411341300Z.sav'
02:38:40.231578 Changing the VM state from 'SAVING' to 'SUSPENDED'
02:38:40.316839 Console::powerDown(): A request to power off the VM has been issued (mMachineState=Saving, InUninit=0)
02:38:40.342613 Display::handleDisplayResize: uScreenId=0 pvVRAM=000000000c0a0000 w=1920 h=1106 bpp=32 cbLine=0x1E00 flags=0x1
02:38:40.342664 GUI: UIFrameBufferPrivate::NotifyChange: Screen=0, Origin=0x0, Size=1920x1106, Sending to async-handler
02:38:40.350656 Changing the VM state from 'SUSPENDED' to 'POWERING_OFF'
02:38:40.356473 ****************** Guest state at power off for VCpu 0 ******************
...
...
...
02:38:40.406031 ************** End of Guest state at power off ***************
02:38:41.753488 PDMR3PowerOff: Driver 'AUDIO'/0 on LUN#0 of device 'ichac97'/0 took 1 344 979 632 ns to power off
02:38:41.753791 PDMR3PowerOff: 1 347 726 353 ns run time
02:38:41.762544 Changing the VM state from 'POWERING_OFF' to 'OFF'
02:38:41.983956 Changing the VM state from 'OFF' to 'DESTROYING'
02:38:41.984097 ************************* Statistics *************************
...
...
...
02:38:41.990221 ********************* End of statistics **********************
02:38:41.997747 VUSB: Detached 'HidMouse' from port 1
02:38:42.377555 NAT: Zone(nm:mbuf_cluster, used:90)
02:38:42.378711 NAT: Zone(nm:mbuf_packet, used:90)
02:38:42.378737 NAT: Zone(nm:mbuf, used:90)
02:38:42.378763 NAT: Zone(nm:mbuf_jumbo_pagesize, used:0)
02:38:42.379768 NAT: Zone(nm:mbuf_jumbo_9k, used:0)
02:38:42.380260 NAT: Zone(nm:mbuf_jumbo_16k, used:0)
02:38:42.380639 NAT: Zone(nm:mbuf_ext_refcnt, used:0)
02:39:42.706185 GIM: KVM: Resetting MSRs
02:39:42.720224 Changing the VM state from 'DESTROYING' to 'TERMINATED'
02:39:42.723143 Console: Machine state changed to 'Saved'
02:39:42.723504 GUI: Request to close Runtime UI because VM is powered off already.
02:39:42.888614 GUI: Passing request to close Runtime UI from machine-logic to UI session.
Ok, so I got the machine back up by removing the *.sav file in the guest's "Snapshots" subdirectory. It had to sort out its file system when booting, but everything is running as it should now.
Thanks for listening, anyway...
I'd like to access the Structure Sensor (https://structure.io) via OpenNI 2 (https://github.com/occipital/openni2) from an UWP App running on a Windows 10 Desktop.
The Setup
For this very reason I created a Windows Runtime Component (Universal Windows) in C++ besides my actual UWP App. This component exports several functions basically miming the initialization behavior of one of the samples in above OpenNI Github repo.
I extended the code to also iterate through all available devices:
// Initialize OpenNI
Status rc = OpenNI::initialize();
if (rc != STATUS_OK)
{
logError("Initialize failed + " + std::string(OpenNI::getExtendedError()));
return false;
}
// Get all attached sensors supported by OpenNI
Array<DeviceInfo> deviceList;
OpenNI::enumerateDevices(&deviceList);
for (int i = 0; i < deviceList.getSize(); i++) {
logInfo(deviceList[i].getName());
logInfo(deviceList[i].getUri());
}
// Actual open device
Device device;
rc = device.open(deviceList[0].getUri());
if (rc != STATUS_OK)
{
logError("Error = " + to_string(rc));
logError("Couldn't open device " + std::string(OpenNI::getExtendedError()));
return false;
}
The Problem
Calling above code from my UWP app through the Windows Runtime Component is successful when initializing OpenNI and enumerating over all available devices:
[INFO] PS1080
[INFO] \\?\usb#vid_1d27&pid_0600#13261#{c3b5f022-5a42-1980-1909-ea72095601b1}
Actually Opening the device via device.open is the actual problem (Error 1 = STATUS_ERROR)
[ERROR] Error = 1
[ERROR] Couldn't open device Could not open "\\?\usb#vid_1d27&pid_0600#13261#{c3b5f022-5a42-1980-1909-ea72095601b1}": USB device not found!
I'm also under the impression that above error message is a bit misleading, as the actual message when having no device attached is:
[ERROR] Error = 1
[ERROR] Couldn't open device DeviceOpen using default: no devices found
I already tried to add a USB device capability to the package mainifest without any success.
<DeviceCapability Name="usb">
<Device Id="vidpid:1D27 0600">
<!--<Function Type="classId:ff * *" />-->
<Function Type="name:vendorSpecific"/>
</Device>
</DeviceCapability>
I also verified that above code is working when directly building a classic C++ program without targeting UWP at all.
I would be very happy for any direction/hint you can provide me with
The Solution
Microsoft's UWP policy simply doesn't allow access to USB devices. But you can workaround that by grant the UWP AppContainer Process access to the Structure IO sensor.
Some manual work is required though:
Open the registry editor and go to the USB entry of the Structure IO sensor HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\VID_1D27&PID_0600
Uncollapse this node and right click on the node below this one and copy the whole key in to clipboard. The last digit is very important here and differs from machine to machine (e.g. HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\VID_1D27&PID_0600\13261)
Copy this key into following registry file where the brackets are. The following registry modification basically allows every UWP app access to the structure I/O sensor.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USB\VID_1D27&PID_0600\13261]
"Security"=hex:1,0,4,90,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,2,0,60,0,4,0,0,0,0,0,14,0,0,0,0,10,1,1,0,0,0,0,0,5,12,0,0,0,0,0,18,0,0,0,0,10,1,2,0,0,0,0,0,5,20,0,0,0,20,2,0,0,0,0,14,0,0,0,0,10,1,1,0,0,0,0,0,5,B,0,0,0,0,0,18,0,0,0,0,10,1,2,0,0,0,0,0,F,2,0,0,0,1,0,0,0
Modify the following batch script to point to the full path(!) of above registry file. This script is needed to modify the registry with the security string. This is only allowed by Window's SYSTEM account. That's why we need to create a task for that.
call schtasks /create /RU SYSTEM /SC ONCE /TN DeviceAC /TR "reg import c:\full\path\to\registry\file.reg" /ST 00:00
call schtasks /run /tn DeviceAC
call schtasks /delete /tn DeviceAC /f
Run the above batch script with Administrator privileges
After successfully executing the script, make sure there's a new entry called "Security" below you node from 2.
If the sensor is already connected to your PC you'll need to reconnect it.
Now the code from my Question above should work :)
You'll find a detailed read on how to solve this problem here:
https://developer.microsoft.com/en-us/windows/iot/Samples/CustomDeviceAccessor
Tried https://stackoverflow.com/a/30138664/533237 and able to capture screen.
But I want to capture screen from an application running in session 0 or another user.Introduced a 10 sec sleep before capturing and switched to another user.
Also tried PsExec.exe -h -s E:\sc.exe. Both throws error
C:\Users\unity\Documents\Visual Studio 2015\Projects\ConsoleApplication2\Debug>sc.exe
FAILURE 0x8876086C (-2005530516)
line: 60 file: 'c:\users\unity\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp'
expr: 'd3d->GetAdapterDisplayMode(adapter, &mode)'
C:\Users\unity\Documents\Visual Studio 2015\Projects\ConsoleApplication2\Debug>PsExec.exe -h -s E:\sc.exe -w E:\
PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com
FAILURE 0x8876086C (-2005530516)
line: 60 file: 'c:\users\unity\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp'
expr: 'd3d->GetAdapterDisplayMode(adapter, &mode)'
Commented out GetAdapterDisplayMode and hardcoded height and width but CreateDevice failed
FAILURE 0x8876086A (-2005530518)
line: 76 file: 'c:\users\unity\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp'
expr: 'd3d->CreateDevice(adapter, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, ¶meters, &device)'
Edited:
Idea is to have a single app running in background and capture anything getting displayed irrespective of the user logged in or even if no one is logged in (lock/login screen)
There are two levels of problems with this.
On one level, while a lot of GDI will work, session 0 is not linked to a functional display device, certainly not one that is capable of D3D.
On another level, while things like the DWM have been introduced, the Windows API has always presented a display model where invisible screen pixels simply don't exist. The entire windows display model is built around getting windows to co-operative paint to a shared display surface, and any parts of a window that are uncovered are repainted on demand by the desktop composition system.
This means, in a very fundamental way, you cannot screen capture anything from session 0 as, in order to do so, session 0 would have to be attached to the active display device.