I have the command below in a windows batch file, whenever I run the above batch (ipconfig.bat) to get the ip of my linux vm, it outputs the ip fine but doesn't ends the batch file, I have to press control + c and then press "y" to end the batch file. Even after adding @exit
it doesn't exits.
VBoxManage --nologo guestcontrol execute "nixvm" "/root/scripts/ipconfig.sh" --username root --password mypassword --verbose --wait-for stdout
@exit
Any suggestions ?
The Bash Script (which gets executed by a windows batch file)
#!/bin/bash
echo "IP Address of "LinuxVM"
ifconfig eth0 | egrep '(inet addr|RX bytes|TX bytes)'
sleep 1s
#echo "MySQL Service Status"
service mysql status
chkconfig mysql --list
sleep 1s
#echo "Displaying MySQL DBs"
mysqlshow -uroot -pmypassword
Windows Batch File
VBoxManage --nologo guestcontrol execute "LinuxVM" "/root/scripts/ipconfig.sh" --username root --password password --verbose --wait-for stdout
You can use
--timeout
to supply a time out in milliseconds which tells VBoxManage how long to wait for the script to exit.