Page 1 of 1

Guest sends message when ready

Posted: 20. Jun 2021, 17:00
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.

Re: Guest sends message when ready

Posted: 20. Jun 2021, 20:41
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.

Re: Guest sends message when ready

Posted: 20. Jun 2021, 22:18
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.

Re: Guest sends message when ready

Posted: 21. Jun 2021, 00:23
by scottgus1
Not a problem, come on back when you're ready!