Lỗi encountered an error while attemping to install them

I don't know why I am getting this error suddenly whilst using vs code. Please help me, Thanks in advance.

P.S[I don't think files can be created in an exe right? I'm not sure after seeing this. Maybe do I have to specify where the file should be created and if yes, please tell me how. Else I'm looking for another answer]

[Edit]: I tried downloading the system installation instead of the user installation. The system installer installs for all users on the system and needs administrator privileges unlike the user installer which install vs code only the particular user installing it.

Thanks, Codestrip

error

asked Apr 14, 2022 at 6:57

8

my solution for this was to set it to always start as administrator, I don't feel like reinstalling vscode [newly installed] It's not a great solution for those who have multiple users, but I got rid of the error.

Ah, I saw that was a problem within User Permission, there were only 2 options checked. //prnt.sc/uV-bF_q52Y3Y

I hope my solution will help you.

answered May 11, 2022 at 4:50

0

If you run your "vscode" as admin then you won't see this error anymore.
  1. Go to your "vscode" install location If not sure then open the start menu. Write vscode. Right click on the icon and click "Open File Location". In a new window there will be again an icon for the "vscode" right click on the icon Again and click "open file location". In another window, there will be an actual vscode's "exe" file.
1. Right-click on this file and go to the "send" > "send on desktop" option.
  • On the Desktop right-click on the icon and go to the properties
  • Click on Advance Option and Check the "Run as Admin" Option
  • Click Apply and Ok.
  • Now if you want Right Click on this icon again and select "pin to taskbar".
  • Hopefully, you won't see this error again.

    answered Jun 25, 2022 at 20:31

    UniquedesignUniquedesign

    4331 gold badge7 silver badges24 bronze badges

    I also encountered this error. I tried remove the folder Microsoft VS Code inside C:\Users\\AppData\Local\Programs, and problem seems resloved

    Hardware virtualization is enabled. Desktop is running with high end specifications with 32gb of RAM.

    Thanks!

    Regards, Yousuf.

    The text was updated successfully, but these errors were encountered:

    Any updates? I'm encountering the very same issue too

    Any resolution found for this issue?

    Guessing this is still not resolved...

    This worked for me.

    1. Open "Window Security"
    2. Open "App & Browser control"
    3. Click "Exploit protection settings" at the bottom
    4. Switch to "Program settings" tab
    5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
    6. Click "Edit"
    7. Scroll down to "Code flow guard [CFG]" and uncheck "Override system settings"
    8. Start vmcompute from powershell as administrator net start vmcompute
    9. Restart

    Start Hyper-V Manager as administrator

    wilka, vinothsundararajan, happylmnop, uosjead, On-The-Offensive, yousufctec, smx-smx, menasbeshay, Tehami, Kushagra8888, and 10 more reacted with thumbs up emoji vinothsundararajan reacted with laugh emoji prafful-panwar reacted with hooray emoji prafful-panwar reacted with heart emoji prafful-panwar, riccardocastana, and rosywaruku reacted with rocket emoji

    All reactions

    • 👍20 reactions
    • 😄1 reaction
    • 🎉1 reaction
    • ❤️1 reaction
    • 🚀3 reactions

    @henskjold73 Your solution which is worked for me thanks for the step by step procedure.

    Worked for me as well. Thank you:]

    Worked for me too!!! Thank you, Morgan Henskjold

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

    Seemed to happen after I installed the HPE ProLiant Support Pack!

    AquinoN, TheTsoo, fagnercarvalho, moesoha, Isaurio07, yardenshafir, FireEmerald, jebrossard, mfld-fr, jinendrapatel, and 8 more reacted with thumbs up emoji moesoha and jebrossard reacted with hooray emoji

    All reactions

    • 👍18 reactions
    • 🎉2 reactions

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this..... Seemed to happen after I installed the HPE ProLiant Support Pack!

    Worked for me, too. The code flow guard fix did not. THanks for the mofcomp solution. Running Windows 10 1809 - not sure what changed since friday, but I come in on Monday and no-go for Hyper-V. I'm back - thanks. Need to get some testing done.

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....

    I ran into this error today too. I am also not sure what changed on my machine to cause this, but the MOFCOMP command resolved the issue. Code flow guard did not fix it for me.

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this..... I ran into this error today too. I am also not sure what changed on my machine to cause this, but the MOFCOMP command resolved the issue. Code flow guard did not fix it for me.

    Not sure if it is related or not. But once my Hyper-V was working, my docker in my WSL2 distro stopped working. Even though it is configured in docker desktop settings it says it is not activated any more. It was working fine yesterday,

    $ docker images
    The command 'docker' could not be found in this WSL 2 distro.
    We recommend to activate the WSL integration in Docker Desktop settings.
    See //docs.docker.com/docker-for-windows/wsl/ for details.
    

    I have tried cycling the enable integration in for the distro to no avail.

    > I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....
    I ran into this error today too. I am also not sure what changed on my machine to cause this, but the MOFCOMP command resolved the issue. Code flow guard did not fix it for me.

    Not sure if it is related or not. But once my Hyper-V was working, my docker in my WSL2 distro stopped working. Even though it is configured in docker desktop settings it says it is not activated any more. It was working fine yesterday,

    $ docker images The command 'docker' could not be found in this WSL 2 distro. We recommend to activate the WSL integration in Docker Desktop settings. See //docs.docker.com/docker-for-windows/wsl/ for details.

    I have tried cycling the enable integration in for the distro to no avail.

    Finally what worked for me is I had to disable the WSL 2 based engine, wait for docker desktop to recreate/mount the DockerDesktopVM. Once what was done, I re-enabled the WSL 2 based engine, and enabled in my distro and I am back to normal.

    Hopefully this helps anyone else that runs into this issue.

    None of the above solutions work for me. I haven't been able to use Hyper-V since an inside build from summer 2019. How can this still be an issue? Is anyone working on it on Microsoft or have any official roadmap to fixing this?

    @pkarakal

    TL;DR In Hyper-V manager, connect to 'server.local' instead of 'server'

    Verbose Randomly this problem pops up on me after updates, and the same fix rarely seems to fix it.

    I'm running Hyper-V manager on Win10 1607, connecting to Hyper-V Core 1607 without a domain, with a configured workgroup.

    It used to work fine but as of an update, many months ago, on every workstation it has stopped connecting to the server.

    After reading through the related to my setup I decided to confirm connectivity, you know Layer-1 foils and all.

    While pinging the hyper-v server, for no particular reason I pinged both 'server' and 'server.local'. I noticed that 'server' returned an IPv4 response and 'server.local' returned an IPv6 response.

    After modifying the power shell commands with every combination, the Hyper-V manager still wouldn't connect.

    For kicks and grins, I tried connecting to 'server.local' and, why look at that, it comes right up.

    Final config: power shell commands use 'server' Hyper-v connects to 'server.local'

    If anyone has any insight as to why hyper-v requires ipv6 all of a sudden, I'd love to read about it.

    @gwata Thanks for the insight! I had just enabled an IPv6 network at home, and did not connect that to the Hyper-v problem.

    I'm not sure if that was the problem [or the only problem], because I also have another one: a long hostname. I named the machine a long hostname when it was first created, and Windows also created another one, truncated at 15 characters. I'm not sure why Windows sometimes uses one, and sometimes the other. Probably some legacy stuff.

    In my case, it would not connect. My hostname, returned by the hostname command, was resolving to an ipv6 address. And localhost also was. Hyper-v was trying to connect to the hostname that was truncated when I named the machine. So, I added an entry to my hosts file [C:\Windows\System32\drivers\etc\hosts], pointing to 127.0.0.1. After I did that it was working again.

    This also solved the issue on PowerShell. I was getting Get-VM: The computer '' could not be resolved. Make sure you typed the machine name correctly and that you have network access.. The redacted part was the truncated hostname.

    Docker was working fine before, and is still working fine now. But I was already using WSL2.

    I hope this helps someone.

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this..... Seemed to happen after I installed the HPE ProLiant Support Pack!

    This worked for me from upgrading from server 2012 R2 to 2019. I guess best option is to upgrade to 2016 them to 2019 so it wont break hyperv management

    This worked for me.
    1. Open "Window Security"
    2. Open "App & Browser control"
    3. Click "Exploit protection settings" at the bottom
    4. Switch to "Program settings" tab
    5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
    6. Click "Edit"
    7. Scroll down to "Code flow guard [CFG]" and uncheck "Override system settings"
    8. Start vmcompute from powershell as administrator net start vmcompute
    9. Restart
    Start Hyper-V Manager as administrator

    Thank you! Worked for me!

    This worked for me.
    1. Open "Window Security"
    2. Open "App & Browser control"
    3. Click "Exploit protection settings" at the bottom
    4. Switch to "Program settings" tab
    5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
    6. Click "Edit"
    7. Scroll down to "Code flow guard [CFG]" and uncheck "Override system settings"
    8. Start vmcompute from powershell as administrator `net start vmcompute
    9. Restart
    `
    Start Hyper-V Manager as administrator

    谢谢,非常管用。

    This worked for me.
    1. Open "Window Security"
    2. Open "App & Browser control"
    3. Click "Exploit protection settings" at the bottom
    4. Switch to "Program settings" tab
    5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
    6. Click "Edit"
    7. Scroll down to "Code flow guard [CFG]" and uncheck "Override system settings"
    8. Start vmcompute from powershell as administrator net start vmcompute
    9. Restart
    Start Hyper-V Manager as administrator

    Thanks you You just save my day of i3 gen 1 laptop

    This worked for me.
    1. Open "Window Security"
    2. Open "App & Browser control"
    3. Click "Exploit protection settings" at the bottom
    4. Switch to "Program settings" tab
    5. Locate "C:\WINDOWS\System32\vmcompute.exe" in the list and expand it
    6. Click "Edit"
    7. Scroll down to "Code flow guard [CFG]" and uncheck "Override system settings"
    8. Start vmcompute from powershell as administrator net start vmcompute
    9. Restart
    Start Hyper-V Manager as administrator

    did not work for me :[

    I tried everything under the sun. What finally worked was restoring WINRM to default - Type -> winrm invoke Restore winrm/config

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this..... Seemed to happen after I installed the HPE ProLiant Support Pack!

    Worked for me after the broken KB5009624. Thanks @jamiet147 !

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this.....
    Seemed to happen after I installed the HPE ProLiant Support Pack!
    Worked for me after the broken KB5009624. Thanks @jamiet147 !

    did not work for me :[

    I'm having the same problem, only I'm trying to connect o a Hyper-V Server 2019 from a Windows 11 22H2, the first solution didn't work because there is no vmcompute in the list and for the second solution I get WindowsVirtualization.V2.mof doesn't exist, it was working properly before I updated Windows 11 to version 22H2, I even re-installed the Hyper-V Management Tools, but the service to manage Hyper-V Servers is not in services anymore.

    Any ideas?

    Worked for me as well :] 👍

    I had to run 'MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof' from Command Prompt to fix this..... Seemed to happen after I installed the HPE ProLiant Support Pack!

    Confirming cause and solution! 👏👏👏 Fixed on HP ProLiant DL385p Gen8 / Windows Server 2022. 👍

    Appreciate this thread for a puzzling issue. The same happened in my case after running Dell Command Update [some video drivers were updated]. The MOFCOMP command string fixed Hyper-V Manager in my case.

    Chủ Đề