Creating a dock icon

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
Burak
Posts: 3
Joined: 5. Apr 2009, 08:09
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows XP

Creating a dock icon

Post by Burak »

Hello board,


Thank you for all contribute to this real great project and those who take questions. I had bunch of hick-ups but I was able locate answers via search which worked but I can't seem to find a "working" solution for what I'm trying to do.

I have created a virtual box called Windows XP on Mac OS X 10.5.6 and I'm using Virtual Box 2.1.4

I want to create a dock icon with a windows XP logo to launch this virtual machine and I was able locate some scripting which would do this but the scripts I located are giving an error without launching a thing.

How can I do this?

Thanks in advance!!!
tkwm
Volunteer
Posts: 147
Joined: 3. Mar 2008, 17:56

Re: Creating a dock icon

Post by tkwm »

http://forums.virtualbox.org/viewtopic. ... pplescript
and, remember - you can search the forum!
Burak
Posts: 3
Joined: 5. Apr 2009, 08:09
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows XP

Re: Creating a dock icon

Post by Burak »

I did find that tread and creating a script with the item below gives a scripting error

do shell script "vboxmanage startvm NAMEOFYOURVIRTUALMACHINE"
tkwm
Volunteer
Posts: 147
Joined: 3. Mar 2008, 17:56

Re: Creating a dock icon

Post by tkwm »

You should replace "NAMEOFYOURVIRTUALMACHINE" with the name of your virtual-machine.
Burak
Posts: 3
Joined: 5. Apr 2009, 08:09
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows XP

Re: Creating a dock icon

Post by Burak »

This is exactly what I created which gave me the scripting error.

do shell script "vboxmanage startvm Windows XP"
tkwm
Volunteer
Posts: 147
Joined: 3. Mar 2008, 17:56

Re: Creating a dock icon

Post by tkwm »

Your VMs name should be exactly the same you choosed in the virtualbox-properties and the name is case-sensitive.

But maybe this peace of code works:

Code: Select all

    set VB_GUEST to "Windows XP"

    set VB_PATH to "/usr/bin/"

    set VB_VM to quoted form of VB_GUEST
    do shell script VB_PATH & "VBoxManage startvm " & VB_VM
SlaunchaMan
Posts: 65
Joined: 6. Apr 2009, 22:28
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04
Location: Detroit, MI
Contact:

Re: Creating a dock icon

Post by SlaunchaMan »

Burak wrote:This is exactly what I created which gave me the scripting error.

do shell script "vboxmanage startvm Windows XP"
The problem is that there's a space in the name of the VM. vboxmanage interprets the name as two separate command-line parameters. There are two options here: either surround the name of the VM with escaped quotes or use the VM's UUID instead of its name. This will work:

Code: Select all

do shell script "/usr/bin/vboxmanage startvm \"Windows XP\""
Or you could use the vboxmanage list vms command to find your VM's UUID. In my case, here's the output of that command:

Code: Select all

aristotle:~ slauncha$ vboxmanage list vms
VirtualBox Command Line Management Interface Version 2.2.0_BETA2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

"Ubuntu 9.04 Beta" {d149b343-998f-4298-a136-1b17638107fc}
So I'd put this in an AppleScript:

Code: Select all

do shell script "/usr/bin/vboxmanage startvm d149b343-998f-4298-a136-1b17638107fc"
Either method will fix your problem.
Post Reply