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
Show a running VB
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: Show a running VB
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.
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.
-
- Posts: 5
- Joined: 24. Jan 2022, 12:23
Re: Show a running VB
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.
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.
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Show a running VB
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.
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.
-
- Posts: 5
- Joined: 24. Jan 2022, 12:23
Re: Show a running VB
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.
It would be nice if you could show the actual VM box and analyse the cause of your testfailure.
Regards,
Marcel
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.
It would be nice if you could show the actual VM box and analyse the cause of your testfailure.
Regards,
Marcel
-
- Posts: 5
- Joined: 24. Jan 2022, 12:23
Re: Show a running VB
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.
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.
-
- Volunteer
- Posts: 5677
- 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
MarcelMedis wrote:But when the Virtual Box Manager (GUI) is closed the Virtual Machine is also not shown.
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:But it will not show itself when started via scripts without the GUI VM VirtualBox Manager be open.
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 run the VB on several systems that do have a graphic card but no monitor. Default access via RDP.
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 wrote:We also make sure that we do not use a headless setup as some of the apps do not work than.
-
- Posts: 5
- Joined: 24. Jan 2022, 12:23
Re: Show a running VB
I added the compressed logfile.
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
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
-
- Volunteer
- Posts: 5677
- 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
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.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.