none
Unable to launch notepad in hyper v VM from remotely from host machine. RRS feed

  • Question

  • Unable to launch notepad in hyper v VM from remotely from host machine. When below command is given from host machine- Invoke-Command -Session $s -ScriptBlock {C:\Windows\notepad.exe}, New line appers but notepad does not open in VM.

    i have tried opening through bat file as well, contents of the the bat file are read bu note pad never get open. and powershell hangs.

    Friday, July 12, 2019 6:38 AM

All replies

  • Hi SwatiAg,

    Please answer the below questions to assist you better.

    1. Is the issue specific to that particular software?

    2. Have you installed any third party antivirus in the system?

    Follow the below method and check if it helps.

    Perform a clean boot to check if any third party application is causing the issue, as clean boot helps in eliminating software conflicts.

    How to troubleshoot problem by performing clean boot in Windows: https://support.microsoft.com/en-us/kb/929135

    Note:  Refer "How to reset the computer to start normally after clean boot troubleshooting" to reset the computer to start as normal after troubleshooting

    Best regards,

    Strive


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, July 12, 2019 9:01 AM
  • Issue is not specific to particular software. I am not able to any exe file inside hyper v VM from power-shell remoting. 

    I want to run exe in hyper v VM by passing powershell command from host/Base machine.

    Please help with this.


    • Edited by SwatiAg Thursday, July 18, 2019 5:09 AM
    Thursday, July 18, 2019 5:09 AM
  • Hi,

    To create a PowerShell Direct session on a virtual machine,

    • The virtual machine must be running locally on the host and booted.

    • You must be logged into the host computer as a Hyper-V administrator.

    • You must supply valid user credentials for the virtual machine.

    • The host operating system must run at least Windows 10 or Windows Server 2016.

    • The virtual machine must run at least Windows 10 or Windows Server 2016.

    You can use the Get-VM cmdlet to check that the credentials you're using have the Hyper-V administrator role and to get a list of the virtual machines running locally on the host and booted.

    Then you can use PSSession cmdlets to create and exit a PowerShell Direct session.

    1. On the Hyper-V host, open Windows PowerShell as Administrator.

    2. Use the Enter-PSSession cmdlet to connect to the virtual machine. Run one of the following commands to create a session by using the virtual machine name or GUID:

      Type your credentials for the virtual machine.

    3. Run whatever commands you need to. These commands run on the virtual machine that you created the session with.

    4. When you're done, use the Exit-PSSession to close the session.

      Exit-PSSession  

    For more details ,please refer official document.

    Best regards,

    Strive


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 18, 2019 8:48 AM