Creating a dock icon

Discussions related to using VirtualBox on Mac OS X hosts.

Creating a dock icon

Postby Burak » 5. Apr 2009, 08:14

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!!!
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

Postby tkwm » 5. Apr 2009, 12:03

viewtopic.php?f=8&t=9562&start=0&hilit=applescript
and, remember - you can search the forum!
tkwm
Volunteer
 
Posts: 147
Joined: 3. Mar 2008, 17:56

Re: Creating a dock icon

Postby Burak » 6. Apr 2009, 00:26

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

do shell script "vboxmanage startvm NAMEOFYOURVIRTUALMACHINE"
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

Postby tkwm » 6. Apr 2009, 09:21

You should replace "NAMEOFYOURVIRTUALMACHINE" with the name of your virtual-machine.
tkwm
Volunteer
 
Posts: 147
Joined: 3. Mar 2008, 17:56

Re: Creating a dock icon

Postby Burak » 7. Apr 2009, 03:08

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

do shell script "vboxmanage startvm Windows XP"
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

Postby tkwm » 7. Apr 2009, 09:47

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   Expand viewCollapse view
    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
tkwm
Volunteer
 
Posts: 147
Joined: 3. Mar 2008, 17:56

Re: Creating a dock icon

Postby SlaunchaMan » 8. Apr 2009, 04:55

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   Expand viewCollapse view
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   Expand viewCollapse view
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   Expand viewCollapse view
do shell script "/usr/bin/vboxmanage startvm d149b343-998f-4298-a136-1b17638107fc"


Either method will fix your problem.
SlaunchaMan
 
Posts: 65
Joined: 6. Apr 2009, 22:28
Location: Detroit, MI
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04


Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: No registered users and 24 guests