Guest sends message when ready

Discussions about using Linux guests in VirtualBox.
Post Reply
MacNala
Posts: 176
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 7, 10, 11 & Ubuntu 20.04 & 22.04
Location: UK
Contact:

Guest sends message when ready

Post by MacNala »

I run VirtualBox on a Windows 10 Host. I have a Linux server (Ubuntu 20.04) installed and can successfully start, save and stop the VM headless using VBoxManage.
There is obviously a delay from starting the VM until it is ready to accept connections (about 30-40 seconds) what I would like to know if there is any way that the Guest VM can message the host that it is ready to accept connections.
I realise this may mot be possible within VB, but need something in the Guest to message the host. But if anyone has a suggestion I am listening.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest sends message when ready

Post by scottgus1 »

If you have Guest Additions installed in the VM, you can use a script in the VM's startup which monitors the VM OS's network connectivity (a successful ping?) then uses 'vboxcontrol guestproperty set' to set a custom guest property (see the manual, https://www.virtualbox.org/manual/ch08. ... stproperty)

On the host, the script that starts the VM with vboxmanage can use 'vboxmanage guestproperty set' to clear the guest property, start the VM, then loop with a small sleep-like delay of a few seconds, running 'vboxmanage guestproperty get' to monitor when the guestproperty resets.

If you can't run Guest Additions you can use a similar script setup to make a 'flag file' in a shared folder and check for its deletion, or delete and check for its restoration. The make/check/delete-the-'flag file' process would be OS commands, not vboxmanage/vboxcontrol.

Finally, if GAs and shared folders aren't options, have the startup script just try to make a connection and keep looping until the connection succeeds, then report success.
MacNala
Posts: 176
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 7, 10, 11 & Ubuntu 20.04 & 22.04
Location: UK
Contact:

Re: Guest sends message when ready

Post by MacNala »

Thanks scottgus1, I will look into your suggestions. I do have guest additions installed in the Ubuntu Server. I will read about the guest property in the manual. I may have to ask additional questions about that, I hope you will not mind.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest sends message when ready

Post by scottgus1 »

Not a problem, come on back when you're ready!
Post Reply