I'd like a write a shell script in Ubuntu that does the following:
-
Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already.
-
Run a shell script in Windows, where the shell script is invoked from the Ubuntu host operating system.
My goal is to create an application launcher on the Ubuntu host desktop for an application on the guest OS. For example, I could create a shortcut for Visual Studio on the Ubuntu desktop that launches Visual Studio in Windows. I've always wanted to be able to launch Windows applications directly from the Ubuntu desktop instead of waiting for Windows to start up before clicking an application shortcut.
Best Answer
There are some limitation from the Windows guests but to run a guest application in seamless mode from a script that can be put in a launcher we tested the following procedure:
Now we can get full command line control over the virtual machine with the following commands:
Start the virtual machine from seamless save state
or (for the Qt frontend)
Run an application in the VM
Terminate VM in save state
Put these in a script to enjoy seamless Windows application windows on your Ubuntu desktop.
In case you have set up a passwordless Windows logon this will not work. See in the Virtual Box Manual for limitations and how to configure Windows to get it working.
On operating systems without the Group Policy Editor (gpedit.msc), such as Home editions of Windows, creating a DWORD at the registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\limitblankpassworduse
and setting it to zero will achieve the same effect, according to this answer.