Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had an idea of using my Windows VM (on a Ubuntu host) to open itms:// links (for iTunes) from the host. So, I'm using vboxmanage guestcontrol to make this happen.

I have a script ( that takes a link as the argument, and passes it to the host like this:

vboxmanage guestcontrol "$VM" exec --image 'C:\Windows\System32\cmd.exe' --username "$USER" --password "$PASSWORD" -- /c start "$@"

This works if I copy a link from my browser, and change http to itms. E.g., for, I can do itmss:// and it works fine. The album opens up in iTunes on my VM.

However, when I click a "View in iTunes" link from the iTunes site, it adds an extra parameter to the URI (specifically, the referrer), so it looks something like itmss://

Unfortunately, if I try to run itmss:// it insteads opens up a regular Command Prompt window with the title "itmss://". I don't even know how to set the command prompt window title, so I'm not sure how that's happening.

If I run the command in the guest, it works fine, opening the album in iTunes:

cmd /c start itmss://

I found a VirtualBox bug that seems somewhat related, but not exactly.

It probably doesn't matter, but my host is Ubuntu 12.04, and my guest is Windows 7.

So, any idea if vboxmanage is incorrectly passing the arguments, and if so, is there a way around it?

If I can't figure out the right way to do it, I'll end up having to process each argument, and stripping out any parameters on any URIs.


I tried creating a batch script (out.bat) like this:

echo %1 > %TEMP%/testing.txt

and then running it from the host like this: vboxmanage guestcontrol "$VM" exec --image 'C:\Windows\System32\cmd.exe' --username "$USER" --password "$PASSWORD" -- /c "C:\path\to\out.bat" "itmss://"

It ran as expected, and when I open %TEMP%/testing.txt, it contained:


including the quotes. So, it sort of passed the parameter correctly (not sure why it still had quotes), so maybe the problem is with cmd.exe, or even the start command. I'm stymied.

share|improve this question
Instead of using the shell script try to run the command directly and see what happens. I think the passing the parameters through might be doing something with your values. – Zero Nov 21 '12 at 21:49
@Zero, did that. Running cmd.exe /c ... from the guest works fine, but running the vboxmanage ... command from the host produces the exact same results. So, it's not the script. It's either vboxmanage, or cmd.exe, I think. – Dan Jones Nov 21 '12 at 22:24

Well, I found a work-around. I think the problem was with cmd.exe, but I'm not sure what, because I found a way to get it to work using PowerShell instead.

The script now reads:

vboxmanage guestcontrol "$VM" exec --image 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' --username "$USER" --password "$PASSWORD" -- "% {Start-Process $1}"

Of course, this solution won't work for anyone using Windows XP, but seriously, is anyone still using it (at least in a VM)?

The only problem is that the PowerShell window opens briefly, but that's really no big deal.

I set the script as the default handler for itms and itmss protocols, and so now when I click on a "View in iTunes" link on the iTunes website on my host in Chrome, it launches iTunes in my Windows guest.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .