VMware Communities
fastie81
Enthusiast
Enthusiast
Jump to solution

Send Command to guest from host

Hi

I am trying to find out if there is a way I can send a command to the guest os from the host os.

I am trying to create a short cut on my host desktop that would lunch an application in a VM using Unity Mode.

How I think I would do so is to create an icon that will start up the vm in unity that I have done but I then want to send a command in to the vm to launch the application.

Cause think about it you sometimes just need to use one or two application in the vm, so it will make it a lot easier and cleaner.

Can this be done, or has someone tried this before.

Thanks for your help

Chris

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
wila
Immortal
Immortal
Jump to solution

Chris,

Well I don't have access to my box with VMware workstation installed at the moment, but I just looked in my VMware Fusion settings (and they are most likely to be exactly the same) and in the .vmx file of your virtual machine you will see this for a VM when it starts in unity:

gui.fullScreenAtPowerOn = "FALSE"
gui.viewModeAtPowerOn = "unity"

I would expect that to work. I'm currently not aware of a vmrun parameter to switch from one mode or the other, but there's likely to be a programmatic way for doing that too. Would have to look into that when I get back home and check it in the lab (next week)



--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva

View solution in original post

0 Kudos
11 Replies
KevinG
Immortal
Immortal
Jump to solution

Look at vmrun or the VIX API

not sure how this work with Unity but you can luanch a program in the guest from the host with vmrun

Type " vmrun" from the host for more info

wila
Immortal
Immortal
Jump to solution

Hi Chris,

Yes you can do that. Here's a snippet from the help on the vmrun command.

Running a program in a virtual machine with Workstation on a Windows host with Windows guest

   vmrun -T ws -gu guestUser -gp guestPassword runProgramInGuest "c:\my VMs\myVM.vmx" "c:\Program Files\myProgram.exe"

http://www.vmware.com/products/beta/ws/vmrunCommand.pdf

http://www.petri.co.il/virtual_administer_vmware_workstation_from_command_line.htm



--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
fastie81
Enthusiast
Enthusiast
Jump to solution

Hi Guy

Thanks for that..

Do we know if you can get ws to start a vm in unity mode? I got the commands working to start the vm and run the program in the guest but I cant find a way for WS to start in unity mode.

I know Player can but then cant run the commands.

Any Ideas?

Chris

0 Kudos
wila
Immortal
Immortal
Jump to solution

Chris,

Well I don't have access to my box with VMware workstation installed at the moment, but I just looked in my VMware Fusion settings (and they are most likely to be exactly the same) and in the .vmx file of your virtual machine you will see this for a VM when it starts in unity:

gui.fullScreenAtPowerOn = "FALSE"
gui.viewModeAtPowerOn = "unity"

I would expect that to work. I'm currently not aware of a vmrun parameter to switch from one mode or the other, but there's likely to be a programmatic way for doing that too. Would have to look into that when I get back home and check it in the lab (next week)



--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
fastie81
Enthusiast
Enthusiast
Jump to solution

Hi wil

That will be great if you can have a look at that for me.

I just tried adding that to my vmx and it does not look like it starts it in unity mode. Putting it any where in the vmx should do it?

Chris

0 Kudos
wila
Immortal
Immortal
Jump to solution

Yeah, normally you should not have to put it in a special position, but you should shutdown your VM (and likely VMware workstation) before editing the vmx file or your changes to the vmx file will be ignored. Of course it also only works for Workstation 6.5 as that was where unity was added.



--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
fastie81
Enthusiast
Enthusiast
Jump to solution

Yes that is what I did..

Would you mind looking if you can see it in you VM WS vmx files when you get a change?

Thanks

Chris

0 Kudos
wila
Immortal
Immortal
Jump to solution

Sure no problem, but ping me next week by replying to this group (or send me a pm) as I might forget it otherwise (too much other work on my plate) and I'll have a look with what I can come up with.

--

Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos
fastie81
Enthusiast
Enthusiast
Jump to solution

Sweet Thanks

I will try searching for some more info..

Chris

0 Kudos
Krax
Contributor
Contributor
Jump to solution

Hi fastie81,

Any solution to launch an application in a VM using Unity Mode?

I' m looking for a solution to do this in VMWARE WS 6.5 and VMWare Player 2.5 but i can't resolve it....:(

0 Kudos
brun0s
Contributor
Contributor
Jump to solution

Hi there,

I'm not sure if this is what you're trying to achieve, but here's what I do to start...lets say, Internet Explorer:

vmware-unity-helper --run /vmware/vm01/config/Windows\ XP\ Professional.vmx D://Program Files//Internet Explorer//IEXPLORE.EXE

Remember to adjust the path to your VM config file, as well as the location of the program you want to start.

If the VM is down, after running this vmware player powers the VM on, puts it in unity mode, and open your application. If you have WS on but not in Unity mode, it will put it in Unity mode then open your application.

Once you get this working you can even create shortcuts on your gnome or KDE menus to make things easier.

I hope that helps.

0 Kudos