Page 1 of 2 12 LastLast

  1. Joined : Apr 2014
    Space coast of Florida
    Posts : 4,351
    Windows 10 Pro X64 14393.576
       08 Oct 2014 #1

    Hyper-V & Win10 #2


    Is there a way to create a Desktop shortcut to the Hyper-V Windows 10 Client so when I double click it I launch Windows 10 under Hyper-V?

    I've seen suggestions for Powershell and VB scripts, none of which I could get to work.
      My System SpecsSystem Spec


  2. Joined : Nov 2013
    Posts : 804
    10 Pro Preview x64
       08 Oct 2014 #2

    I use this - change the name of the VM and save it somewhere as something.ps1

    Code:
    $vmToStart="CentOS_7_minimal"
     
    if ((Get-VMIntegrationService $vmToStart | ?{$_.name -eq "Heartbeat"}).PrimaryStatusDescription -ne "OK") 
    {
     Write-Host "Starting server..." -foregroundcolor "blue"
     start-vm $vmToStart
     do {Start-Sleep -milliseconds 100} 
     until ((Get-VMIntegrationService $vmToStart | ?{$_.name -eq "Heartbeat"}).PrimaryStatusDescription -eq "OK")
     Write-Host "Server started." -foregroundcolor "yellow"
    }
    Then you need to make a shortcut with the target like this (but change the path) - the important bit is in bold or it will fail unless you enable all Powershell scripts which you do not want to do.

    Code:
    %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -File"C:\Users\adam\OneDrive\Windows Software\Powershell\Something.ps1"
    Like this your Powershell window will stay open and wait until the VM is responding.

    Otherwise start-vm whatever_the_name would be sufficient as long as your shortcut is OK.
    Last edited by adamf; 08 Oct 2014 at 19:25.
      My System SpecsSystem Spec


  3. Joined : Apr 2014
    Space coast of Florida
    Posts : 4,351
    Windows 10 Pro X64 14393.576
       08 Oct 2014 #3

    Doesn't work. I created "D:\tools\Windows 10 TP.ps1" as follows:

    Code:
    $vmToStart="Windows 10"
     
    if ((Get-VMIntegrationService $vmToStart | ?{$_.name -eq "Heartbeat"}).PrimaryStatusDescription -ne "OK") 
    {
     Write-Host "Starting server..." -foregroundcolor "blue"
     start-vm $vmToStart
     do {Start-Sleep -milliseconds 100} 
     until ((Get-VMIntegrationService $vmToStart | ?{$_.name -eq "Heartbeat"}).PrimaryStatusDescription -eq "OK")
     Write-Host "Server started." -foregroundcolor "yellow"
    }
    Created a shortcut as follows:

    Code:
    %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -File "D:\tools\Windows 10 TP.ps1"
    When I double click the shortcut, a windows opens for about a second:

    Click image for larger version. 

Name:	HypVWin.jpg 
Views:	379 
Size:	25.8 KB 
ID:	6535

    No Windows 10 Hyper-V client starts.

    This is the Hyper-V manager window:

    Click image for larger version. 

Name:	HypVWindow.jpg 
Views:	187 
Size:	231.9 KB 
ID:	6536
    Last edited by Ztruker; 08 Oct 2014 at 20:28.
      My System SpecsSystem Spec


  4. Joined : Nov 2013
    Posts : 804
    10 Pro Preview x64
       08 Oct 2014 #4

    I'll have to test it tomorrow Rich unless someone else can help out - I'm going to bed.

    EDIT - if you put the -noexit switch in the shortcut you'll see the error

    The exact code that works for me is this - in case I left out a bracket before as I left out some extra bits as I then wait for a service to start and show a web page.

    I also forgot to say you have to run as administrator - I know you don't use UAC but it might be worth changing the shortcut anyway just in case.
    Code:
    $vmToStart="CentOS_7_minimal"
    $url="http://"+$vmToStart+":9091/" 
     
    if ((Get-VMIntegrationService $vmToStart | ?{$_.name -eq "Heartbeat"}).PrimaryStatusDescription -ne "OK") 
    {
     Write-Host "Starting Transmission server..." -foregroundcolor "blue"
     start-vm $vmToStart
     do {Start-Sleep -milliseconds 100} 
      until ((Get-VMIntegrationService $vmToStart | ?{$_.name -eq "Heartbeat"}).PrimaryStatusDescription -eq "OK")
     
     Write-Host "Transmission server started." -foregroundcolor "yellow"
      Write-Host "Starting Transmission service..." -foregroundcolor "blue"
     $webClient = New-Object System.Net.WebClient
    
     Do 
     {
      Start-Sleep -Seconds 1
      try { $content = $webClient.DownloadString($url) }
      catch { Write-Host "Page not yet retrieved . . ."}
     } While ( $content -eq $null)
    }
    Start-Process $url

    Shortcut:

    Target: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit -noprofile -executionpolicy bypass -File "C:\Users\adam\OneDrive\Windows Software\Powershell\StartTransmission.ps1"

    Start in: %windir%
    Last edited by adamf; 08 Oct 2014 at 20:42.
      My System SpecsSystem Spec


  5. Joined : Oct 2014
    Posts : 21
    Windows 10
       09 Oct 2014 #5

    Go into program files\Hyper-v
    Go into the 6.3 folder and find the vmconnect.exe and right click and send to desktop. It will create a short cut on your desktop.
    Right click the shortcut on your desktop.
    at the end of the target path line add the servername and the vmname

    "C:\Program Files\Hyper-V\6.3\vmconnect6.3.exe" hvserver vmmachinename

    save your short cut and you should be good to go.

    If you need more help let me know.
      My System SpecsSystem Spec


  6. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,564
    Windows 10 Pro
       09 Oct 2014 #6

    EvilJenius said: View Post
    Go into program files\Hyper-v
    Go into the 6.3 folder and find the vmconnect.exe and right click and send to desktop. It will create a short cut on your desktop.
    Right click the shortcut on your desktop.
    at the end of the target path line add the servername and the vmname

    "C:\Program Files\Hyper-V\6.3\vmconnect6.3.exe" hvserver vmmachinename

    save your short cut and you should be good to go.

    If you need more help let me know.
    To clarify this, talking about native Hyper-V in Windows 10 Technical Preview:

    1. By default the standalone Virtual Machine Connection (VMC) has to be run elevated (if user's role is not changed in authorization management), so from shortcut's Advanced Properties, enable Run as administrator
    2. The correct address for the standalone VMC in Windows 10 Tech Preview is %windir%\system32\vmconnect6.3.exe. The executable in C:\Program Files\Hyper-V\6.3 does not run in Win 10 Tech preview


    Elevated VMC run from C:\Program Files\Hyper-V\6.3:

    Click image for larger version. 

Name:	2014-10-09_20h13_54.png 
Views:	380 
Size:	24.0 KB 
ID:	6635

    Elevated VMC run from C:\Windows\system32\:

    Click image for larger version. 

Name:	2014-10-09_20h12_52.png 
Views:	375 
Size:	23.4 KB 
ID:	6634

    Kari
    Last edited by Kari; 09 Oct 2014 at 13:16.
      My System SpecsSystem Spec


  7. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,564
    Windows 10 Pro
       09 Oct 2014 #7

    The above made me think that we might need a tutorial for this, so here it is: Hyper-V Virtual Machine - Create Shortcut in Windows
      My System SpecsSystem Spec


  8. Joined : Apr 2014
    Space coast of Florida
    Posts : 4,351
    Windows 10 Pro X64 14393.576
       09 Oct 2014 #8

    Worked perfectly Kari, thanks, and thanks to all of you for your assistance and ideas.
      My System SpecsSystem Spec


  9. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,564
    Windows 10 Pro
       09 Oct 2014 #9

    You are welcome .
      My System SpecsSystem Spec


  10. Joined : Oct 2014
    Posts : 21
    Windows 10
       10 Oct 2014 #10

    Kari said: View Post
    To clarify this, talking about native Hyper-V in Windows 10 Technical Preview:

    1. By default the standalone Virtual Machine Connection (VMC) has to be run elevated (if user's role is not changed in authorization management), so from shortcut's Advanced Properties, enable Run as administrator
    2. The correct address for the standalone VMC in Windows 10 Tech Preview is %windir%\system32\vmconnect6.3.exe. The executable in C:\Program Files\Hyper-V\6.3 does not run in Win 10 Tech preview


    Elevated VMC run from C:\Program Files\Hyper-V\6.3:

    Click image for larger version. 

Name:	2014-10-09_20h13_54.png 
Views:	380 
Size:	24.0 KB 
ID:	6635

    Elevated VMC run from C:\Windows\system32\:

    Click image for larger version. 

Name:	2014-10-09_20h12_52.png 
Views:	375 
Size:	23.4 KB 
ID:	6634

    Kari
    I get what your saying. True I am running it from a Server vs. Local.

    He still should be able to flag it and launch directly into the VM with out having to select from the drop down.
    Last edited by EvilJenius; 10 Oct 2014 at 12:41.
      My System SpecsSystem Spec


 
Page 1 of 2 12 LastLast


Similar Threads
Thread Forum
Solved Hyper-V
Hi, As anyone tried Hyper-V yet, as isn't it suppose to be an emulator so we can play old games like Silver etc...
Gaming
Solved Audio in hyper-v
So how do I get my headset which is usb to work in hyper-v?
Virtualization
Solved Hyper-V no sound
Is there anyway to get sound with the various VM's that I have created in Hyper-V ? I am currently using it in 8.1 Pro. Larry
Virtualization
Compact a Hyper-V VHD
I have Hyper-V VM with the Windows 10 Pro Technical Preview Build 9926 as the guest, and Windows 8.1 Pro as the host OS. I've been running it for 3 months now, with at least 2 build updates. But I can't compact the VHD. The used drive space on the...
Virtualization
Solved Hyper-V & Win10
I decided to install Win10 in a Virtual Machine and settled on Hyper-V. I'm using the setup now to create this thread. There were a few hurdles to get over. 1) Hyper-V needed to be added to my Win8 install Program & Features-> Turn on Windows...
Installation and Setup
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:00.
Find Us
Twitter Facebook Google+



Windows 10 Forums