Guest sends message when ready

Discussions about using Linux guests in VirtualBox.

Guest sends message when ready

Postby MacNala » 20. Jun 2021, 17:00

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.
MacNala
 
Posts: 154
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 7 & 10

Re: Guest sends message when ready

Postby scottgus1 » 20. Jun 2021, 20:41

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.
scottgus1
Site Moderator
 
Posts: 12476
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Guest sends message when ready

Postby MacNala » 20. Jun 2021, 22:18

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.
MacNala
 
Posts: 154
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 7 & 10

Re: Guest sends message when ready

Postby scottgus1 » 21. Jun 2021, 00:23

Not a problem, come on back when you're ready!
scottgus1
Site Moderator
 
Posts: 12476
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 12 guests