ainuke

Need help scripting unattended bootloader entry on VM

3 posts in this topic

Hi,

I'm running a VM with VMware Player, that requires a boot flag entry in the bootloader in order to load the OS. This needs to start and get to the OS unattended, in session 0 (I'm using AlwaysUp to launch the VM and any needed scripts).

Ideally, I'd like to have the bootloader not need additional flags to complete, but haven't been able to make that happen. AutoIT is my Plan B.

This is my first attempt at scripting, and I haven't even been able to get a working script using VM on the desktop (much less Session 0). I'm assuming that a potential issue is that the 'active window' I'm trying to reach is classified as a VMPlayerFrame?

Here's what I've got so far. Again, I'm new; please be gentle...

WinActivate("OS X - AMD - VMware Player (Non-commercial use only)")
WinWaitActive("OS X - AMD - VMware Player (Non-commercial use only)") ; VMware Player called - wait for active
Sleep(10000) ; pause to allow bootloader to get to input point
Send("/amd64{enter}") ; enter boot flag

Any help would be appreciated.

Erik

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I happened to have an old VMware Win98 buried somewhere so I thought I'd give it a go.

I can reproduce your issue. But I can also "fix" it. The issue seems to be that even though you activate the window (you can see it's actually activated by the WinActivate and found by the WinWaitActive), it only accepts the Send() stuff when your mouse is hovering over the client area of the VMware player (i.e. not the window or the toolbar but actually the area where the VMware display is running). This works for me:

ConsoleWrite("Activating window" & @CRLF)
WinActivate("Windows 98 - VMware Player (Non-commercial use only)")
Sleep(1000)
ConsoleWrite("Waiting for active" & @CRLF)
WinWaitActive("Windows 98 - VMware Player (Non-commercial use only)")
Sleep(1000)
ConsoleWrite("Moving mouse" & @CRLF)
$aPos = WinGetPos("Windows 98 - VMware Player (Non-commercial use only)")
MouseMove($aPos[0] + 50, $aPos[1] + 150, 1) ; move to somewhere in client area of window
Sleep(1000)
ConsoleWrite("Sending stuff" & @CRLF)
Send("/amd64{enter}") ; enter boot flag
ConsoleWrite("All done!" & @CRLF)

It isn't pretty, but it works :) It's probably something to do with the host/client mouse pointer/clipboard/IO integration.

/edit: to be complete, my results are that I had a notepad window open on the W98 machine and this script sends "/amd64{enter}" to that notepad window and I see it appear in there. But only after I added the MouseMove.

/edit 2: welcome to the forum!

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
5 hours ago, SadBunny said:

I happened to have an old VMware Win98 buried somewhere so I thought I'd give it a go.

I can reproduce your issue. But I can also "fix" it. The issue seems to be that even though you activate the window (you can see it's actually activated by the WinActivate and found by the WinWaitActive), it only accepts the Send() stuff when your mouse is hovering over the client area of the VMware player (i.e. not the window or the toolbar but actually the area where the VMware display is running). This works for me:

ConsoleWrite("Activating window" & @CRLF)
WinActivate("Windows 98 - VMware Player (Non-commercial use only)")
Sleep(1000)
ConsoleWrite("Waiting for active" & @CRLF)
WinWaitActive("Windows 98 - VMware Player (Non-commercial use only)")
Sleep(1000)
ConsoleWrite("Moving mouse" & @CRLF)
$aPos = WinGetPos("Windows 98 - VMware Player (Non-commercial use only)")
MouseMove($aPos[0] + 50, $aPos[1] + 150, 1) ; move to somewhere in client area of window
Sleep(1000)
ConsoleWrite("Sending stuff" & @CRLF)
Send("/amd64{enter}") ; enter boot flag
ConsoleWrite("All done!" & @CRLF)

It isn't pretty, but it works :) It's probably something to do with the host/client mouse pointer/clipboard/IO integration.

/edit: to be complete, my results are that I had a notepad window open on the W98 machine and this script sends "/amd64{enter}" to that notepad window and I see it appear in there. But only after I added the MouseMove.

/edit 2: welcome to the forum!

Thanks, SadBunny!

I'll give that a whirl.

Erik

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now