Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 11672  / 1 Year ago, sun, january 15, 2023, 11:51:46

Refer to : Launch an application in Windows from the Ubuntu desktop



I was wondering if Takkat could elaborate on the actual execution i.e. howto in the script file.



This will be greatly helpful. Thanks in advance



my script file InternetExplorerVM.sh looks like this, execution is



/path/to/InternetExplorerVM.sh "C:Program FilesInternet Exploreriexplore.exe"

#!/bin/bash

# start Internet Explorer inside of a Windows7 Ultimate VM
echo "Starting 'Internet Explorer' browser inside Windows7 virtual machine"
echo ""
sleep 1
echo "Please be patient"

VBoxManage startvm b307622e-6b5e-4e47-a427-84760cf2312b

sleep 15

echo ""
echo "Now starting 'Internet Explorer'"
##VBoxManage --nologo guestcontrol b307622e-6b5e-4e47-a427-84760cf2312b execute --image "$1" --username RailroadGuest --password bnsf1234

VBoxManage --nologo guestcontrol b307622e-6b5e-4e47-a427-84760cf2312b execute --image "C:Program/ FilesInternet/ Exploreriexplore.exe" --username RailroadGuest --password bnsf1234 --wait-exit --wait-stdout

echo ""
echo "Saving the VM's state now"
VBoxManage controlvm b307622e-6b5e-4e47-a427-84760cf2312b savestate

sleep 2

#Check VM state
echo ""
echo "Check the VM state"
VBoxManage showvminfo b307622e-6b5e-4e47-a427-84760cf2312b | grep State

exit


My apologies for any mistakes, this is my first time posting on askubuntu.Thanks a ton in advance. This has been very helpful. Need this for BNSF guests, their Mainframe emulator works exclusively on Java enabled Internet Explorer.


More From » virtualbox

 Answers
4

He's basically saying you can do this:




  1. Create a Virtual Machine, like a Windows virtual machine.

  2. Login to the virtual machine.

  3. Switch the virtual machine into "seamless" mode

  4. Save the state of the virtual machine in the main Virtual Box window.

  5. Create a bash script with the VBoxManage commands, so that you can do something like ./runinwindows "C:somepathexecutable.exe"



For example:



#!/bin/bash
# Start the VM
VBoxManage startvm "<Name_of_VM>"

# Run the executable
VBoxManage --nologo guestcontrol "<Name_of_VM>" execute --image "$1" --username windowsuser --password password --wait-exit --wait-stdout

# Save the current machine state for the next time you run the script.
VBoxManage controlvm "Name_of_VM" savestate


Then you could run a Windows executable (in this case) in your terminal, but it would actually be running in a virtual machine.


[#35205] Tuesday, January 17, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
humbire

Total Points: 55
Total Questions: 93
Total Answers: 113

Location: Oman
Member since Fri, Dec 23, 2022
1 Year ago
humbire questions
Thu, May 13, 21, 02:28, 3 Years ago
Sun, Oct 24, 21, 14:23, 3 Years ago
Wed, May 17, 23, 22:16, 1 Year ago
;