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.
Guest sends message when ready
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Guest sends message when ready
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.
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.
-
- 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
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.
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Guest sends message when ready
Not a problem, come on back when you're ready!