Show a running VB

Discussions related to using VirtualBox on Windows hosts.
Post Reply
MarcelMedis
Posts: 5
Joined: 24. Jan 2022, 12:23

Show a running VB

Post by MarcelMedis »

Hello,

Using the VirtualBox in our Jenkins pipeline we can do a lot of tests. And that is great. But when the Virtual Box Manager (GUI) is closed the Virtual Machine is also not shown.

And than sometime the test got stuck and only in the Preview you see a tiny thumbnail with a Message Box you can not read. And it does not occur when you restart the test with an open GUI.

Is it possible, and if so how, to show a running but hidden Virtual Box session?

Regards,

Marcel
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Show a running VB

Post by mpack »

To clarify, are you discussing a headless VM?

I'm not aware of any standard VirtualBox feature which previews the desktop of a headless VM, other than the one in the manager. It may be possible to write your own preview script that calls VBoxManage controlvm <vm> screenshotpng.
MarcelMedis
Posts: 5
Joined: 24. Jan 2022, 12:23

Re: Show a running VB

Post by MarcelMedis »

It is not headless.

But it will not show itself when started via scripts without the GUI VM VirtualBox Manager be open.

When the manager is open the window will popup (but not always, sometimes it looses that option. No idea why). But it is not headless.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Show a running VB

Post by scottgus1 »

Are you referring to a Detachable or '--type separate' VM?

And are you saying that the previous methods to show the VM after the VM window has been detached no longer work?

Please post your methods and the portion of your script which shows the VM window.
MarcelMedis
Posts: 5
Joined: 24. Jan 2022, 12:23

Re: Show a running VB

Post by MarcelMedis »

Scripts in a next post.

We run the VB on several systems that do have a graphic card but no monitor. Default access via RDP.

That setup causes the Virtual Machine not to be shown when: Not logged in via RDP and Virtual Box Manager to be closed.

So not headless in the sense of VitualBox.

We also make sure that we do not use a headless setup as some of the apps do not work than.

But sometimes in Jenkins the test stage takes ages. Than you rdp to the machine where teh VM resides and you are unable to access the VM directly and analyse it directly on the system. See attached screenshot.
Virtual Box Manager
Virtual Box Manager
2022-01-24 15_19_08-Window.png (99.53 KiB) Viewed 1954 times
It would be nice if you could show the actual VM box and analyse the cause of your testfailure.

Regards,

Marcel
MarcelMedis
Posts: 5
Joined: 24. Jan 2022, 12:23

Re: Show a running VB

Post by MarcelMedis »

Script:

VBoxManage.exe snapshot Windows_10_x64_Jenkins restorecurrent
VBoxManage.exe" startvm Windows_10_x64_Jenkins
... check and wait for started
VBoxManage.exe" guestcontrol Windows_10_x64_Jenkins run --exe C:\machine\jenkins\PrepareEnvironment.cmd -- C:\machine\jenkins\PrepareEnvironment.cmd
VBoxManage.exe" guestcontrol Windows_10_x64_Jenkins run --timeout 3600000 --exe UnitTest78.exe ...
. . .
VBoxManage.exe" guestcontrol Windows_10_x64_Jenkins run --timeout 3600000 --exe UnitTest78.exe ... another one
. . .

VBoxManage.exe" list runningvms
"Windows_10_x64_Jenkins"

VBoxManage.exe" controlvm Windows_10_x64_Jenkins acpipowerbutton

Works fine on several machines but this is the idea. Timeout is added not so long ago.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Show a running VB

Post by fth0 »

MarcelMedis wrote:But when the Virtual Box Manager (GUI) is closed the Virtual Machine is also not shown.
MarcelMedis wrote:But it will not show itself when started via scripts without the GUI VM VirtualBox Manager be open.
That's unexpected (at least for me), because you should be able to do anything with a VM without using the VirtualBox Manager at all. Can you provide a (zipped) VBox.log file from such a VM run?
MarcelMedis wrote:We run the VB on several systems that do have a graphic card but no monitor. Default access via RDP.
From the screenshot, I can see that you're not using VirtualBox RDP. Do you RDP into the guest or into the host?
MarcelMedis wrote:We also make sure that we do not use a headless setup as some of the apps do not work than.
Even VBoxHeadless usually creates the screen contents, so that the programs inside the guest OS shouldn't know if there is a monitor attached or not. VBoxHeadless just doesn't output the screen contents anywhere, except when a RDP client connects to the VirtualBox RDP server (VBoxHeadless and VBoxRDP are aliases, BTW). Do you have any idea why your apps do not work with a VM started with VBoxHeadless?
MarcelMedis
Posts: 5
Joined: 24. Jan 2022, 12:23

Re: Show a running VB

Post by MarcelMedis »

I added the compressed logfile.
Windows_10_x64_Jenkins-2022-01-25-08-14-40.zip
Compressed logfile
(28.08 KiB) Downloaded 2 times
The RDP works fine. Thanks, never thought of that although I RDP to the buld machine where also the VMs run.

Not sure why headless is an issue. I think we had almost the same issue as with jenkins agent headless. That dependes on whether the agent was started before or after the windows desktop was started (before or after login). But that is a wild guess. No need to check that for now.

Thanks for the RDP advice. That works already.

Marcel
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Show a running VB

Post by fth0 »

Windows_10_x64_Jenkins-2022-01-25-08-14-40.log wrote:
00:00:49.295780 VMMDev: Guest Log: VBoxDispIfResizeDisplayWin7: VBoxTray:(WDDM) pfnSetDisplayConfig Failed to VALIDATE winEr 87.
[...]
00:00:49.296044 VMMDev: Guest Log: VBoxDispIfResizeDisplayWin7: VBoxTray:(WDDM) pfnSetDisplayConfig Failed to SET, winEr 87.
The log file shows an error that was reported by the VIrtualBox WDDM graphics driver, which is part of the VirtualBox Guest Additions. Later on, the VBoxService is stopped and restarted several times, and the virtual monitor is blanked and unblanked twice. I'd suggest to create a ticket in the Bugtracker.
Post Reply