VMware Communities
kriemer
Enthusiast
Enthusiast
Jump to solution

Workstation - Bat File to start multiple Virtual Machines

I am currently using the following bat file to start multiple virtual machines:

     start ""/b "C:\Users\Abe\Desktop\Virtual machine 1.lnk"

     start ""/b "C:\Users\Abe\Desktop\Virtual machine 2.lnk"

My problem is that this start each machine in is own instance of VMware.  Is there any way to build a script (.bat or otherwise) that will start the virtual machines in a single instance of VMware Workstation.

Regards and thanks in advance

k

Reply
0 Kudos
1 Solution

Accepted Solutions
vmroyale
Immortal
Immortal
Jump to solution

You could create a batch file like this:

vmrun start "C:\VM\VM1.vmx"

vmrun start "C:\VM\VM21.vmx"

This would open both VMs in the same GUI - at least that is the way it works on my Windows 7 host with Workstation 9.

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com

View solution in original post

Reply
0 Kudos
7 Replies
vmroyale
Immortal
Immortal
Jump to solution

The vmrun command is what you want here.

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
kriemer
Enthusiast
Enthusiast
Jump to solution

Not wanting to appear obtuse but I have gone through the guide and do not quite see how to apply a solution.

Thanks

k

Reply
0 Kudos
vmroyale
Immortal
Immortal
Jump to solution

You could create a batch file like this:

vmrun start "C:\VM\VM1.vmx"

vmrun start "C:\VM\VM21.vmx"

This would open both VMs in the same GUI - at least that is the way it works on my Windows 7 host with Workstation 9.

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
Reply
0 Kudos
kriemer
Enthusiast
Enthusiast
Jump to solution

Many thanks vmroyale; that pretty much does it. 

One odd thing occurres though when starting up the vm's they did not auto detect and use the host computer display setting, i.e., did not open to full screen as per the .vmx file setting.  Any thought as to what might cause that?

Thanks again and regards

k

Reply
0 Kudos
TomHowarth
Leadership
Leadership
Jump to solution

have a read of the following PDF from VMware regarding the vmrun command

www.vmware.com/pdf/vix162_vmrun_command.pdf

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
Scorpion99
Enthusiast
Enthusiast
Jump to solution

You can auto start your VMs by doing the following without the need to create any batch file:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200558...

Reply
0 Kudos
WoodyZ
Immortal
Immortal
Jump to solution

Just to add to what Scorpion99 mentioned, Running VMware Workstation as a server with shared virtual machines (2005585), be aware that using this method the VM's are running Headless and you would then access them via RDC or by other Services configured to be available as well as WSX.  They do not appear in the VMware workstation GUI like when starting normally.

Reply
0 Kudos