Launch an application in Windows from the Ubuntu desktop












12















I'd like a write a shell script in Ubuntu that does the following:




  1. Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already.


  2. 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.










share|improve this question





























    12















    I'd like a write a shell script in Ubuntu that does the following:




    1. Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already.


    2. 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.










    share|improve this question



























      12












      12








      12


      13






      I'd like a write a shell script in Ubuntu that does the following:




      1. Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already.


      2. 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.










      share|improve this question
















      I'd like a write a shell script in Ubuntu that does the following:




      1. Boot up a Windows 7 guest OS in Virtualbox, if it isn't running already.


      2. 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.







      windows launcher virtualbox scripts command-line






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 29 '12 at 0:30







      Anderson Green

















      asked Jun 21 '12 at 0:05









      Anderson GreenAnderson Green

      96051633




      96051633






















          4 Answers
          4






          active

          oldest

          votes


















          13














          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:




          • Start VirtualBox Manager

          • Log in to windows with you user and password

          • Switch to seamless mode Host + L

          • In seamless mode save the machine's state


          Now we can get full command line control over the virtual machine with the following commands:





          • Start the virtual machine from seamless save state



            VBoxManage startvm "<Name_of_VM>"


            or (for the Qt frontend)



            VirtualBox --startvm "<Name_of_VM>"



          • Run an application in the VM



            VBoxManage --nologo guestcontrol "<Name_of_VM>" run --exe "C:\full\path\to\program.exe" --username windowsuser --password password --wait-stdout



          • Terminate VM in save state



            VBoxManage controlvm "Name_of_VM" savestate



          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.




          Also, to use accounts without or with an empty password, the guest's group policy must be changed. To do so, open the group policy editor on the command line by typing gpedit.msc, open the key Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options and change the value of Accounts: Limit local account use of blank passwords to console logon only to Disabled.




          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_MACHINESYSTEMCurrentControlSetControlLsalimitblankpassworduse and setting it to zero will achieve the same effect, according to this answer.






          share|improve this answer


























          • Should each of these commands be run from the Windows command line or the Ubuntu command line?

            – Anderson Green
            Jun 21 '12 at 16:50











          • Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

            – Marty Fried
            Jun 21 '12 at 17:39













          • Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

            – Anderson Green
            Dec 23 '12 at 19:20











          • It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

            – Takkat
            Dec 23 '12 at 19:24













          • Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

            – William
            Sep 10 '18 at 1:13



















          3














          This is more a hint than an answer, but it's too big for a comment.



          You should probably look at this. According to the docs, this command, run from the host OS (I' assuming an Ubuntu host and Windows guest):



          VBoxManage guestcontrol "Windows XP Pro" execute --image "cmd.exe" --username javier --verbose "/c" "regedit.exe"


          Should open regedit in Windows (the guest), but I have never been able to make it work.



          You can also use



          VBoxManage showvminfo "Windows XP Pro" | grep State


          to check if a VM is running or not.






          share|improve this answer


























          • Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

            – Marty Fried
            Jun 21 '12 at 16:30











          • I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

            – Marty Fried
            Jun 21 '12 at 16:50













          • Maybe my problem is that I use a password less account.

            – Javier Rivera
            Jun 21 '12 at 17:14











          • Probably... I just changed the command I ran to use your format and it did indeed run regedit.

            – Marty Fried
            Jun 21 '12 at 17:28











          • Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

            – Javier Rivera
            Jun 21 '12 at 17:30



















          2














          I deleted the original idea when I realized that it won't work because Linux won't be able to access the windows partition in a VM if it's not running already. There may be a more complex way to do it, but I don't know if it's really worth it.



          It may be feasible to have a common shared directory, and a script in Windows would always check this directory to see if it is empty or not. If not, it would run the scripts in the directory, which would be put there by the Ubuntu system before running the VM.



          You could have a 2nd script that deletes the 1st one so it doesn't run the next time.






          share|improve this answer


























          • I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

            – Anderson Green
            Jun 21 '12 at 0:24













          • I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

            – Anderson Green
            Jun 21 '12 at 0:28













          • Could the inverse be done using guest additions, then?

            – Anderson Green
            Jun 21 '12 at 0:35











          • Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

            – Anderson Green
            Jun 21 '12 at 0:36











          • Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

            – Marty Fried
            Jun 21 '12 at 0:42





















          1














          I wanted the same thing and ended up solving it without using guestcontrol. On my MacOS X host I have a folder (named Windows) that my vbox client running a Win7 has mapped as Z:. I use dummy-files to communicate between host and my clients like this:



          On the Mac host:
          - created one shell-script complete with an icon for each windows application I wanted to start in the Win-client. What they basically do is makes sure that the VirtualBox hasn't been started before and then creates a "start this particular application"-file in the shared folder that Windows can read after startup. Example of what such a script looks like is this:



          #!/bin/bash

          # bail if vbox is already started/running windoze...
          ps ax | grep -v grep | grep 'Windows 7' > /dev/null
          if [ $? -eq 0 ]; then
          echo "Sorry, Windows is already running."
          exit 0
          fi

          # send a message to Windoze which program to start...
          touch /Users/urban/Documents/Windows/START_TS2000I.TXT

          # startup Windoze in seamless mode
          vboxmanage setextradata 'Windows 7' GUI/Seamless on
          vboxmanage startvm 'Windows 7' &

          exit 0


          Then on the windows client I have a matching script (BAT-file) in the Startup-folder that looks like this:



          @echo off
          pushd "C:Program FilesOmega ResearchProgram"
          if exist Z:start_ts2000i.txt start ORTrade.exe
          if exist Z:start_ts2000i.txt del Z:start_ts2000i.txt
          .
          .
          .
          exit 0


          This way, any time I want to add a new client-startup icon on my Mac I copy the shell script, invent a new dummy file and add the matching startup lines in the BAT-script on the client. Works great and I think it is in line with Martys idea in the previous post.






          share|improve this answer


























          • Have you tested this in an Ubuntu host?

            – user68186
            Nov 4 '14 at 19:12











          • No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

            – Urban
            Nov 4 '14 at 19:16











          • It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

            – muru
            Nov 4 '14 at 19:33













          • Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

            – Urban
            Nov 4 '14 at 20:31













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f153894%2flaunch-an-application-in-windows-from-the-ubuntu-desktop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          13














          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:




          • Start VirtualBox Manager

          • Log in to windows with you user and password

          • Switch to seamless mode Host + L

          • In seamless mode save the machine's state


          Now we can get full command line control over the virtual machine with the following commands:





          • Start the virtual machine from seamless save state



            VBoxManage startvm "<Name_of_VM>"


            or (for the Qt frontend)



            VirtualBox --startvm "<Name_of_VM>"



          • Run an application in the VM



            VBoxManage --nologo guestcontrol "<Name_of_VM>" run --exe "C:\full\path\to\program.exe" --username windowsuser --password password --wait-stdout



          • Terminate VM in save state



            VBoxManage controlvm "Name_of_VM" savestate



          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.




          Also, to use accounts without or with an empty password, the guest's group policy must be changed. To do so, open the group policy editor on the command line by typing gpedit.msc, open the key Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options and change the value of Accounts: Limit local account use of blank passwords to console logon only to Disabled.




          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_MACHINESYSTEMCurrentControlSetControlLsalimitblankpassworduse and setting it to zero will achieve the same effect, according to this answer.






          share|improve this answer


























          • Should each of these commands be run from the Windows command line or the Ubuntu command line?

            – Anderson Green
            Jun 21 '12 at 16:50











          • Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

            – Marty Fried
            Jun 21 '12 at 17:39













          • Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

            – Anderson Green
            Dec 23 '12 at 19:20











          • It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

            – Takkat
            Dec 23 '12 at 19:24













          • Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

            – William
            Sep 10 '18 at 1:13
















          13














          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:




          • Start VirtualBox Manager

          • Log in to windows with you user and password

          • Switch to seamless mode Host + L

          • In seamless mode save the machine's state


          Now we can get full command line control over the virtual machine with the following commands:





          • Start the virtual machine from seamless save state



            VBoxManage startvm "<Name_of_VM>"


            or (for the Qt frontend)



            VirtualBox --startvm "<Name_of_VM>"



          • Run an application in the VM



            VBoxManage --nologo guestcontrol "<Name_of_VM>" run --exe "C:\full\path\to\program.exe" --username windowsuser --password password --wait-stdout



          • Terminate VM in save state



            VBoxManage controlvm "Name_of_VM" savestate



          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.




          Also, to use accounts without or with an empty password, the guest's group policy must be changed. To do so, open the group policy editor on the command line by typing gpedit.msc, open the key Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options and change the value of Accounts: Limit local account use of blank passwords to console logon only to Disabled.




          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_MACHINESYSTEMCurrentControlSetControlLsalimitblankpassworduse and setting it to zero will achieve the same effect, according to this answer.






          share|improve this answer


























          • Should each of these commands be run from the Windows command line or the Ubuntu command line?

            – Anderson Green
            Jun 21 '12 at 16:50











          • Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

            – Marty Fried
            Jun 21 '12 at 17:39













          • Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

            – Anderson Green
            Dec 23 '12 at 19:20











          • It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

            – Takkat
            Dec 23 '12 at 19:24













          • Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

            – William
            Sep 10 '18 at 1:13














          13












          13








          13







          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:




          • Start VirtualBox Manager

          • Log in to windows with you user and password

          • Switch to seamless mode Host + L

          • In seamless mode save the machine's state


          Now we can get full command line control over the virtual machine with the following commands:





          • Start the virtual machine from seamless save state



            VBoxManage startvm "<Name_of_VM>"


            or (for the Qt frontend)



            VirtualBox --startvm "<Name_of_VM>"



          • Run an application in the VM



            VBoxManage --nologo guestcontrol "<Name_of_VM>" run --exe "C:\full\path\to\program.exe" --username windowsuser --password password --wait-stdout



          • Terminate VM in save state



            VBoxManage controlvm "Name_of_VM" savestate



          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.




          Also, to use accounts without or with an empty password, the guest's group policy must be changed. To do so, open the group policy editor on the command line by typing gpedit.msc, open the key Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options and change the value of Accounts: Limit local account use of blank passwords to console logon only to Disabled.




          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_MACHINESYSTEMCurrentControlSetControlLsalimitblankpassworduse and setting it to zero will achieve the same effect, according to this answer.






          share|improve this 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:




          • Start VirtualBox Manager

          • Log in to windows with you user and password

          • Switch to seamless mode Host + L

          • In seamless mode save the machine's state


          Now we can get full command line control over the virtual machine with the following commands:





          • Start the virtual machine from seamless save state



            VBoxManage startvm "<Name_of_VM>"


            or (for the Qt frontend)



            VirtualBox --startvm "<Name_of_VM>"



          • Run an application in the VM



            VBoxManage --nologo guestcontrol "<Name_of_VM>" run --exe "C:\full\path\to\program.exe" --username windowsuser --password password --wait-stdout



          • Terminate VM in save state



            VBoxManage controlvm "Name_of_VM" savestate



          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.




          Also, to use accounts without or with an empty password, the guest's group policy must be changed. To do so, open the group policy editor on the command line by typing gpedit.msc, open the key Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options and change the value of Accounts: Limit local account use of blank passwords to console logon only to Disabled.




          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_MACHINESYSTEMCurrentControlSetControlLsalimitblankpassworduse and setting it to zero will achieve the same effect, according to this answer.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 2 hours ago









          user7214865

          1034




          1034










          answered Jun 21 '12 at 16:41









          TakkatTakkat

          108k37249377




          108k37249377













          • Should each of these commands be run from the Windows command line or the Ubuntu command line?

            – Anderson Green
            Jun 21 '12 at 16:50











          • Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

            – Marty Fried
            Jun 21 '12 at 17:39













          • Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

            – Anderson Green
            Dec 23 '12 at 19:20











          • It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

            – Takkat
            Dec 23 '12 at 19:24













          • Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

            – William
            Sep 10 '18 at 1:13



















          • Should each of these commands be run from the Windows command line or the Ubuntu command line?

            – Anderson Green
            Jun 21 '12 at 16:50











          • Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

            – Marty Fried
            Jun 21 '12 at 17:39













          • Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

            – Anderson Green
            Dec 23 '12 at 19:20











          • It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

            – Takkat
            Dec 23 '12 at 19:24













          • Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

            – William
            Sep 10 '18 at 1:13

















          Should each of these commands be run from the Windows command line or the Ubuntu command line?

          – Anderson Green
          Jun 21 '12 at 16:50





          Should each of these commands be run from the Windows command line or the Ubuntu command line?

          – Anderson Green
          Jun 21 '12 at 16:50













          Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

          – Marty Fried
          Jun 21 '12 at 17:39







          Pretty nice concept, although I've never really liked the seamless mode for some reason - probably because it gets confusing about keyboard navigation. But I'm tempted to try some of this out for my few Windows programs I still use, like Quicken and iTunes. @AndersonGreen: this is run from the Ubuntu commandline, and can easily be entered in a terminal for testing, then made into a script.

          – Marty Fried
          Jun 21 '12 at 17:39















          Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

          – Anderson Green
          Dec 23 '12 at 19:20





          Should the password (being entered in the script) be the Windows login password, or the Ubuntu login password?

          – Anderson Green
          Dec 23 '12 at 19:20













          It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

          – Takkat
          Dec 23 '12 at 19:24







          It is the windows password you need as you are likely logged in to Ubuntu, and starting a VM should not require root access. Note that you need a Windows password and login for this to work.

          – Takkat
          Dec 23 '12 at 19:24















          Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

          – William
          Sep 10 '18 at 1:13





          Should this work in the opposite manor(running Windows as main OS and linux as virtual machine)

          – William
          Sep 10 '18 at 1:13













          3














          This is more a hint than an answer, but it's too big for a comment.



          You should probably look at this. According to the docs, this command, run from the host OS (I' assuming an Ubuntu host and Windows guest):



          VBoxManage guestcontrol "Windows XP Pro" execute --image "cmd.exe" --username javier --verbose "/c" "regedit.exe"


          Should open regedit in Windows (the guest), but I have never been able to make it work.



          You can also use



          VBoxManage showvminfo "Windows XP Pro" | grep State


          to check if a VM is running or not.






          share|improve this answer


























          • Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

            – Marty Fried
            Jun 21 '12 at 16:30











          • I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

            – Marty Fried
            Jun 21 '12 at 16:50













          • Maybe my problem is that I use a password less account.

            – Javier Rivera
            Jun 21 '12 at 17:14











          • Probably... I just changed the command I ran to use your format and it did indeed run regedit.

            – Marty Fried
            Jun 21 '12 at 17:28











          • Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

            – Javier Rivera
            Jun 21 '12 at 17:30
















          3














          This is more a hint than an answer, but it's too big for a comment.



          You should probably look at this. According to the docs, this command, run from the host OS (I' assuming an Ubuntu host and Windows guest):



          VBoxManage guestcontrol "Windows XP Pro" execute --image "cmd.exe" --username javier --verbose "/c" "regedit.exe"


          Should open regedit in Windows (the guest), but I have never been able to make it work.



          You can also use



          VBoxManage showvminfo "Windows XP Pro" | grep State


          to check if a VM is running or not.






          share|improve this answer


























          • Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

            – Marty Fried
            Jun 21 '12 at 16:30











          • I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

            – Marty Fried
            Jun 21 '12 at 16:50













          • Maybe my problem is that I use a password less account.

            – Javier Rivera
            Jun 21 '12 at 17:14











          • Probably... I just changed the command I ran to use your format and it did indeed run regedit.

            – Marty Fried
            Jun 21 '12 at 17:28











          • Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

            – Javier Rivera
            Jun 21 '12 at 17:30














          3












          3








          3







          This is more a hint than an answer, but it's too big for a comment.



          You should probably look at this. According to the docs, this command, run from the host OS (I' assuming an Ubuntu host and Windows guest):



          VBoxManage guestcontrol "Windows XP Pro" execute --image "cmd.exe" --username javier --verbose "/c" "regedit.exe"


          Should open regedit in Windows (the guest), but I have never been able to make it work.



          You can also use



          VBoxManage showvminfo "Windows XP Pro" | grep State


          to check if a VM is running or not.






          share|improve this answer















          This is more a hint than an answer, but it's too big for a comment.



          You should probably look at this. According to the docs, this command, run from the host OS (I' assuming an Ubuntu host and Windows guest):



          VBoxManage guestcontrol "Windows XP Pro" execute --image "cmd.exe" --username javier --verbose "/c" "regedit.exe"


          Should open regedit in Windows (the guest), but I have never been able to make it work.



          You can also use



          VBoxManage showvminfo "Windows XP Pro" | grep State


          to check if a VM is running or not.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 21 '12 at 14:38

























          answered Jun 21 '12 at 13:51









          Javier RiveraJavier Rivera

          30k978101




          30k978101













          • Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

            – Marty Fried
            Jun 21 '12 at 16:30











          • I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

            – Marty Fried
            Jun 21 '12 at 16:50













          • Maybe my problem is that I use a password less account.

            – Javier Rivera
            Jun 21 '12 at 17:14











          • Probably... I just changed the command I ran to use your format and it did indeed run regedit.

            – Marty Fried
            Jun 21 '12 at 17:28











          • Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

            – Javier Rivera
            Jun 21 '12 at 17:30



















          • Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

            – Marty Fried
            Jun 21 '12 at 16:30











          • I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

            – Marty Fried
            Jun 21 '12 at 16:50













          • Maybe my problem is that I use a password less account.

            – Javier Rivera
            Jun 21 '12 at 17:14











          • Probably... I just changed the command I ran to use your format and it did indeed run regedit.

            – Marty Fried
            Jun 21 '12 at 17:28











          • Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

            – Javier Rivera
            Jun 21 '12 at 17:30

















          Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

          – Marty Fried
          Jun 21 '12 at 16:30





          Interesting ideas, and I think it could be used as another way to accomplish the task. The guest could be launched from the host, then when it's running, the command could probably be made to work to run a command. For a programmer, it may be an easier way than my idea; it involves using "sleep" in a loop to wait for the VM to be up, but it can all be done from the host, with a single script.

          – Marty Fried
          Jun 21 '12 at 16:30













          I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

          – Marty Fried
          Jun 21 '12 at 16:50







          I just tried out your first execute command and was able to run Quicken on my first attempt from an already running Windows XP VM, named "Windows XP" using this command from a Ubuntu terminal commandline: VBoxManage guestcontrol Windows XP exec --image c:\program files\quicken\qw.exe --username XXXXX --password XXXXX, where XXXXX was my username and password.

          – Marty Fried
          Jun 21 '12 at 16:50















          Maybe my problem is that I use a password less account.

          – Javier Rivera
          Jun 21 '12 at 17:14





          Maybe my problem is that I use a password less account.

          – Javier Rivera
          Jun 21 '12 at 17:14













          Probably... I just changed the command I ran to use your format and it did indeed run regedit.

          – Marty Fried
          Jun 21 '12 at 17:28





          Probably... I just changed the command I ran to use your format and it did indeed run regedit.

          – Marty Fried
          Jun 21 '12 at 17:28













          Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

          – Javier Rivera
          Jun 21 '12 at 17:30





          Takkat have said that it doesn't work in passwordless accounts like mine. That explains why I had never been able to did it ;).

          – Javier Rivera
          Jun 21 '12 at 17:30











          2














          I deleted the original idea when I realized that it won't work because Linux won't be able to access the windows partition in a VM if it's not running already. There may be a more complex way to do it, but I don't know if it's really worth it.



          It may be feasible to have a common shared directory, and a script in Windows would always check this directory to see if it is empty or not. If not, it would run the scripts in the directory, which would be put there by the Ubuntu system before running the VM.



          You could have a 2nd script that deletes the 1st one so it doesn't run the next time.






          share|improve this answer


























          • I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

            – Anderson Green
            Jun 21 '12 at 0:24













          • I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

            – Anderson Green
            Jun 21 '12 at 0:28













          • Could the inverse be done using guest additions, then?

            – Anderson Green
            Jun 21 '12 at 0:35











          • Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

            – Anderson Green
            Jun 21 '12 at 0:36











          • Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

            – Marty Fried
            Jun 21 '12 at 0:42


















          2














          I deleted the original idea when I realized that it won't work because Linux won't be able to access the windows partition in a VM if it's not running already. There may be a more complex way to do it, but I don't know if it's really worth it.



          It may be feasible to have a common shared directory, and a script in Windows would always check this directory to see if it is empty or not. If not, it would run the scripts in the directory, which would be put there by the Ubuntu system before running the VM.



          You could have a 2nd script that deletes the 1st one so it doesn't run the next time.






          share|improve this answer


























          • I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

            – Anderson Green
            Jun 21 '12 at 0:24













          • I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

            – Anderson Green
            Jun 21 '12 at 0:28













          • Could the inverse be done using guest additions, then?

            – Anderson Green
            Jun 21 '12 at 0:35











          • Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

            – Anderson Green
            Jun 21 '12 at 0:36











          • Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

            – Marty Fried
            Jun 21 '12 at 0:42
















          2












          2








          2







          I deleted the original idea when I realized that it won't work because Linux won't be able to access the windows partition in a VM if it's not running already. There may be a more complex way to do it, but I don't know if it's really worth it.



          It may be feasible to have a common shared directory, and a script in Windows would always check this directory to see if it is empty or not. If not, it would run the scripts in the directory, which would be put there by the Ubuntu system before running the VM.



          You could have a 2nd script that deletes the 1st one so it doesn't run the next time.






          share|improve this answer















          I deleted the original idea when I realized that it won't work because Linux won't be able to access the windows partition in a VM if it's not running already. There may be a more complex way to do it, but I don't know if it's really worth it.



          It may be feasible to have a common shared directory, and a script in Windows would always check this directory to see if it is empty or not. If not, it would run the scripts in the directory, which would be put there by the Ubuntu system before running the VM.



          You could have a 2nd script that deletes the 1st one so it doesn't run the next time.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 21 '12 at 0:41

























          answered Jun 21 '12 at 0:20









          Marty FriedMarty Fried

          13.7k53947




          13.7k53947













          • I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

            – Anderson Green
            Jun 21 '12 at 0:24













          • I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

            – Anderson Green
            Jun 21 '12 at 0:28













          • Could the inverse be done using guest additions, then?

            – Anderson Green
            Jun 21 '12 at 0:35











          • Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

            – Anderson Green
            Jun 21 '12 at 0:36











          • Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

            – Marty Fried
            Jun 21 '12 at 0:42





















          • I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

            – Anderson Green
            Jun 21 '12 at 0:24













          • I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

            – Anderson Green
            Jun 21 '12 at 0:28













          • Could the inverse be done using guest additions, then?

            – Anderson Green
            Jun 21 '12 at 0:35











          • Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

            – Anderson Green
            Jun 21 '12 at 0:36











          • Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

            – Marty Fried
            Jun 21 '12 at 0:42



















          I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

          – Anderson Green
          Jun 21 '12 at 0:24







          I'd like to create a shortcut for Visual Studio and a shortcut for Internet Explorer that can be invoked from the Ubuntu desktop(so that they run in the virtual machine). Can this be done using the method you described?

          – Anderson Green
          Jun 21 '12 at 0:24















          I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

          – Anderson Green
          Jun 21 '12 at 0:28







          I'd like to know whether the inverse could also be done - launching a host application (such as Kolourpaint) from the guest operating system.

          – Anderson Green
          Jun 21 '12 at 0:28















          Could the inverse be done using guest additions, then?

          – Anderson Green
          Jun 21 '12 at 0:35





          Could the inverse be done using guest additions, then?

          – Anderson Green
          Jun 21 '12 at 0:35













          Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

          – Anderson Green
          Jun 21 '12 at 0:36





          Also, are you referring to the Windows startup folder or the Ubuntu startup applications list?

          – Anderson Green
          Jun 21 '12 at 0:36













          Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

          – Marty Fried
          Jun 21 '12 at 0:42







          Sorry, I realized my first idea was flawed, because the windows folder doesn't exist until the VM is running. I revised my answer completely, and I hope it's not too confusing.

          – Marty Fried
          Jun 21 '12 at 0:42













          1














          I wanted the same thing and ended up solving it without using guestcontrol. On my MacOS X host I have a folder (named Windows) that my vbox client running a Win7 has mapped as Z:. I use dummy-files to communicate between host and my clients like this:



          On the Mac host:
          - created one shell-script complete with an icon for each windows application I wanted to start in the Win-client. What they basically do is makes sure that the VirtualBox hasn't been started before and then creates a "start this particular application"-file in the shared folder that Windows can read after startup. Example of what such a script looks like is this:



          #!/bin/bash

          # bail if vbox is already started/running windoze...
          ps ax | grep -v grep | grep 'Windows 7' > /dev/null
          if [ $? -eq 0 ]; then
          echo "Sorry, Windows is already running."
          exit 0
          fi

          # send a message to Windoze which program to start...
          touch /Users/urban/Documents/Windows/START_TS2000I.TXT

          # startup Windoze in seamless mode
          vboxmanage setextradata 'Windows 7' GUI/Seamless on
          vboxmanage startvm 'Windows 7' &

          exit 0


          Then on the windows client I have a matching script (BAT-file) in the Startup-folder that looks like this:



          @echo off
          pushd "C:Program FilesOmega ResearchProgram"
          if exist Z:start_ts2000i.txt start ORTrade.exe
          if exist Z:start_ts2000i.txt del Z:start_ts2000i.txt
          .
          .
          .
          exit 0


          This way, any time I want to add a new client-startup icon on my Mac I copy the shell script, invent a new dummy file and add the matching startup lines in the BAT-script on the client. Works great and I think it is in line with Martys idea in the previous post.






          share|improve this answer


























          • Have you tested this in an Ubuntu host?

            – user68186
            Nov 4 '14 at 19:12











          • No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

            – Urban
            Nov 4 '14 at 19:16











          • It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

            – muru
            Nov 4 '14 at 19:33













          • Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

            – Urban
            Nov 4 '14 at 20:31


















          1














          I wanted the same thing and ended up solving it without using guestcontrol. On my MacOS X host I have a folder (named Windows) that my vbox client running a Win7 has mapped as Z:. I use dummy-files to communicate between host and my clients like this:



          On the Mac host:
          - created one shell-script complete with an icon for each windows application I wanted to start in the Win-client. What they basically do is makes sure that the VirtualBox hasn't been started before and then creates a "start this particular application"-file in the shared folder that Windows can read after startup. Example of what such a script looks like is this:



          #!/bin/bash

          # bail if vbox is already started/running windoze...
          ps ax | grep -v grep | grep 'Windows 7' > /dev/null
          if [ $? -eq 0 ]; then
          echo "Sorry, Windows is already running."
          exit 0
          fi

          # send a message to Windoze which program to start...
          touch /Users/urban/Documents/Windows/START_TS2000I.TXT

          # startup Windoze in seamless mode
          vboxmanage setextradata 'Windows 7' GUI/Seamless on
          vboxmanage startvm 'Windows 7' &

          exit 0


          Then on the windows client I have a matching script (BAT-file) in the Startup-folder that looks like this:



          @echo off
          pushd "C:Program FilesOmega ResearchProgram"
          if exist Z:start_ts2000i.txt start ORTrade.exe
          if exist Z:start_ts2000i.txt del Z:start_ts2000i.txt
          .
          .
          .
          exit 0


          This way, any time I want to add a new client-startup icon on my Mac I copy the shell script, invent a new dummy file and add the matching startup lines in the BAT-script on the client. Works great and I think it is in line with Martys idea in the previous post.






          share|improve this answer


























          • Have you tested this in an Ubuntu host?

            – user68186
            Nov 4 '14 at 19:12











          • No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

            – Urban
            Nov 4 '14 at 19:16











          • It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

            – muru
            Nov 4 '14 at 19:33













          • Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

            – Urban
            Nov 4 '14 at 20:31
















          1












          1








          1







          I wanted the same thing and ended up solving it without using guestcontrol. On my MacOS X host I have a folder (named Windows) that my vbox client running a Win7 has mapped as Z:. I use dummy-files to communicate between host and my clients like this:



          On the Mac host:
          - created one shell-script complete with an icon for each windows application I wanted to start in the Win-client. What they basically do is makes sure that the VirtualBox hasn't been started before and then creates a "start this particular application"-file in the shared folder that Windows can read after startup. Example of what such a script looks like is this:



          #!/bin/bash

          # bail if vbox is already started/running windoze...
          ps ax | grep -v grep | grep 'Windows 7' > /dev/null
          if [ $? -eq 0 ]; then
          echo "Sorry, Windows is already running."
          exit 0
          fi

          # send a message to Windoze which program to start...
          touch /Users/urban/Documents/Windows/START_TS2000I.TXT

          # startup Windoze in seamless mode
          vboxmanage setextradata 'Windows 7' GUI/Seamless on
          vboxmanage startvm 'Windows 7' &

          exit 0


          Then on the windows client I have a matching script (BAT-file) in the Startup-folder that looks like this:



          @echo off
          pushd "C:Program FilesOmega ResearchProgram"
          if exist Z:start_ts2000i.txt start ORTrade.exe
          if exist Z:start_ts2000i.txt del Z:start_ts2000i.txt
          .
          .
          .
          exit 0


          This way, any time I want to add a new client-startup icon on my Mac I copy the shell script, invent a new dummy file and add the matching startup lines in the BAT-script on the client. Works great and I think it is in line with Martys idea in the previous post.






          share|improve this answer















          I wanted the same thing and ended up solving it without using guestcontrol. On my MacOS X host I have a folder (named Windows) that my vbox client running a Win7 has mapped as Z:. I use dummy-files to communicate between host and my clients like this:



          On the Mac host:
          - created one shell-script complete with an icon for each windows application I wanted to start in the Win-client. What they basically do is makes sure that the VirtualBox hasn't been started before and then creates a "start this particular application"-file in the shared folder that Windows can read after startup. Example of what such a script looks like is this:



          #!/bin/bash

          # bail if vbox is already started/running windoze...
          ps ax | grep -v grep | grep 'Windows 7' > /dev/null
          if [ $? -eq 0 ]; then
          echo "Sorry, Windows is already running."
          exit 0
          fi

          # send a message to Windoze which program to start...
          touch /Users/urban/Documents/Windows/START_TS2000I.TXT

          # startup Windoze in seamless mode
          vboxmanage setextradata 'Windows 7' GUI/Seamless on
          vboxmanage startvm 'Windows 7' &

          exit 0


          Then on the windows client I have a matching script (BAT-file) in the Startup-folder that looks like this:



          @echo off
          pushd "C:Program FilesOmega ResearchProgram"
          if exist Z:start_ts2000i.txt start ORTrade.exe
          if exist Z:start_ts2000i.txt del Z:start_ts2000i.txt
          .
          .
          .
          exit 0


          This way, any time I want to add a new client-startup icon on my Mac I copy the shell script, invent a new dummy file and add the matching startup lines in the BAT-script on the client. Works great and I think it is in line with Martys idea in the previous post.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 5 '14 at 8:30

























          answered Nov 4 '14 at 18:41









          UrbanUrban

          112




          112













          • Have you tested this in an Ubuntu host?

            – user68186
            Nov 4 '14 at 19:12











          • No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

            – Urban
            Nov 4 '14 at 19:16











          • It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

            – muru
            Nov 4 '14 at 19:33













          • Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

            – Urban
            Nov 4 '14 at 20:31





















          • Have you tested this in an Ubuntu host?

            – user68186
            Nov 4 '14 at 19:12











          • No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

            – Urban
            Nov 4 '14 at 19:16











          • It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

            – muru
            Nov 4 '14 at 19:33













          • Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

            – Urban
            Nov 4 '14 at 20:31



















          Have you tested this in an Ubuntu host?

          – user68186
          Nov 4 '14 at 19:12





          Have you tested this in an Ubuntu host?

          – user68186
          Nov 4 '14 at 19:12













          No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

          – Urban
          Nov 4 '14 at 19:16





          No, but I'm pretty sure it would work without glitches. The vbox commands are the same and so is bash.

          – Urban
          Nov 4 '14 at 19:16













          It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

          – muru
          Nov 4 '14 at 19:33







          It's safer to use pgrep instead of ps | grep. The latter runs the risk of matching itself.

          – muru
          Nov 4 '14 at 19:33















          Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

          – Urban
          Nov 4 '14 at 20:31







          Yes, you're right. I believe fixed it above using ps by adding an extra grep -v to filter away the self-match problem. I couldn't figure out how to use pgrep as you suggested in this case since the VBox name 'Windows 7' in my case is a comment argument to the process, like this: MacMini:~ urban$ ps ax | grep -v grep | grep 'Windows 7' 10874 ?? R 4:38.49 /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM --comment Windows 7 --startvm 24507412-789d-42ed-9c79-b4faf0c2d130 --no-startvm-errormsgbox but maybe you have a suggestion on this?

          – Urban
          Nov 4 '14 at 20:31




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f153894%2flaunch-an-application-in-windows-from-the-ubuntu-desktop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          香粉寮

          GameSpot