none
Is it possible to make a shortcut to a Hyper-V VM?

    Question

  • I want to make a shortcut on my desktop to launch a vm created by Hyper-V. Is there any way to do it? maybe through Command Prompt?
    Monday, December 14, 2009 6:34 PM

Answers

All replies

  • You could do this with a powershell script.  Using the SCVMM cmdlets will look something like this...


    get-vmmserver servername
    start-vm vmname

    If this post is helpful, please mark it as such.
    Tuesday, December 15, 2009 8:14 PM
  • You could do this with a powershell script.  Using the SCVMM cmdlets will look something like this...


    get-vmmserver servername
    start-vm vmname

    If this post is helpful, please mark it as such.

    And how do I make a shortcut to a PS commands script? (compared to *.bat in DOS)
    Wednesday, December 16, 2009 12:42 AM
  • First you will need to ensure that you can execute scripts (by default powershell does not let you).

    set-executionpolicy RemoteSigned
    Then create your script (named with a .ps1 extension) and call it with powershell (or in this case the SCVMM PowerShell cli).

    cli.psc1 -command "& 'MyScript.ps1' "

    cli.psc1 is located in the bin directory where SCVMM is installed, so you will need to use the "Start In" field of the shortcut to define this or use the full path to the cli.psc1 file in order to find it.

    -matt


    If this post is helpful, please mark it as such.
    Wednesday, December 16, 2009 4:21 AM
  • As you get you should use PowerShell for this. So here is the Library of PowerShell scripts .

    Regards.

    StarWind Software Developer.
    www.starwindsoftware.com
    Wednesday, December 23, 2009 3:53 PM
  • One more example in VB (by Paul Weterings):

    Dim WMIService
    Dim VMList
    Dim VMName
    
    'Specify the name of the virtual machine that I want to start
    
    VMName = "TestVM"
    
    
    'Get instance of 'virtualization' WMI service on the local computer
    
    Set WMIService = GetObject("winmgmts:\\.\root\virtualization")
    
    'Query for the specific virtual machine that I want to start
    
    Set VMList = WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem
    WHERE ElementName='" & VMName & "'")
    
    ' Request a state change on the first VM that is returned
    ' 2 = start, 3 = stop and 32769 = save state
    
    VMList.ItemIndex(0).RequestStateChange(2)
    ---
    Paul Svirin
    StarWind Software developer ( http://www.starwindsoftware.com )
    Wednesday, December 23, 2009 4:12 PM
  • I'm not sure if you found a solution to this but you can use vmconnect if your vm isn't clustered. vmconnect is part of remote administration tools which is used when you click connect from Hyper-V manager. The Syntax below can be used as a shortcut.

    "c:\program files\hyper-v\vmconnect.exe" SERVER VMNAME

    • Proposed as answer by Norm Allen Thursday, March 25, 2010 9:19 PM
    Monday, March 22, 2010 12:01 PM
  • saying that there is a scrip and pointing to a website where this script "might" be is NOT an answer.

    ANSWER:

    Right click on your desktop and select New -> Shortcut

    In the ‘Type the location of the item:’ box, enter the following:

    "c:\program files\hyper-v\vmconnect.exe" VMHOSTSERVERNAME VMNAME

    VMHOSTSERVERNAME is the name of the Hyper V server
    VMNAME is the full name of the Virtual Machine

    Click OK and you're good to go!

    PS: in 2012 server the path is:

    "c:\program files\hyper-v\6.2\vmconnect6.2.exe"

    Wednesday, July 23, 2014 12:02 AM
  • "This version of Virtual Machine Connection can only be used to manage servers running Hyper-V in Windows Server 2012"

    Is there an alternate version for Windows 10?

    Monday, December 28, 2015 7:28 PM
  • This link has information on how to create a shortcut to connect to a VM directly in Windows 8/10.

    http://www.tenforums.com/tutorials/2371-hyper-v-virtual-machine-create-shortcut-windows.html

    Edit: Inserted HREF to link text

    • Edited by John Wruck Friday, January 01, 2016 8:34 PM
    Friday, January 01, 2016 8:32 PM
  • john Wruck has the easiest way to do it.  Oracle VirtualBox has a menu to create a desktop shortcut.  You would think that MS would have something like that.


    ~george


    • Edited by Ge0rg3 Friday, August 26, 2016 7:35 PM
    Friday, August 26, 2016 7:34 PM