Vagrant Error on Windows 10 with Hyper-V - vagrant

After upgrading to windows 10 then running:
$ vagrant up
We get the following error message
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.
Script: get_vm_status.ps1
Error:
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 : Unable to
find type [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException].
At line:1 char:1
+ &('C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\prov ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Hyper...FailedException:TypeName) [get_vm_status.ps1], Ru
ntimeException
+ FullyQualifiedErrorId : TypeNotFound,get_vm_status.ps1
With Vagrant 1.7.4.
Any ideas?

I had the same problem on a fresh install of Vagrant 1.7.4 on Windows 10 Enteprise (first time using Vagrant).
It looks like the type VirtualizationOperationFailedException has been replaced with VirtualizationException in the latest version of PowerShell.
I changed line 15 of C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 from:
} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {
to
} catch [Microsoft.HyperV.PowerShell.VirtualizationException] {
Now I'm able to use vagrant up and vagrant status without errors. This is obviously not a long term solution but got things working again. There may be other scripts that are broken as well but I haven't run in to them yet.

I had the same error after destroying then recreating a VM.
I removed the .vagrant/machines/hyperv folder and all went ok.

If a solution by #jeff-r doesn't work for you, you can try changing:
} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {
to:
} catch [Exception] {
Be careful, it may also cause some side-effects.

on win 10 you must disable "Hyper-V" to run vagrant/virtualbox

Related

Authentication_Unauthorized while fetching list of applications in AAD

I am trying to get list of applications registered in AAD via PowerShell.
I got into my tenant successfully using Connect-AzureAD. But when I'm running Get-AzureADApplication, I'm getting error like below:
Get-AzureADApplication : Error occurred while executing GetApplications
Code: Authentication_Unauthorized
Message: User was not found.
RequestId: 28b83872-c29b-423a-9870-ed2ad714f597
DateTimeStamp: Sat, 25 Jun 2022 1:35:23 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
At line:1 char:1
+ Get-AzureADApplication
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureADApplication], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetApplication
What does User was not found message mean?
I have Global Admin role and I tried elevating my access too that gives me access to all. But still I'm facing the same error.
Can anyone help me out what am I missing here?
The error 'User not found' usually occurs if you are trying to retrieve info of one tenant by connecting wrong(different) tenant or tenant that does not exist.
Please check the TenantDomain you are getting in the response while executing Connect-AzureAD cmdlet.
I tried to reproduce the same in my environment and got below results:
When I ran Connect-AzureAD cmdlet and logged in with personal Microsoft account, I got blank under TenantDomain that means it does not exist.
I got the same error when I executed Get-AzureADApplication after that like below:
To resolve the error, try running Connect-AzAccount first and include TenantId that you got in response while executing Connect-AzureAD cmdlet like below:
Connect-AzAccount
Connect-AzureAD -TenantId 'your_tenant_id'
Get-AzureADApplication
I got the list of Azure AD applications successfully after running above script like below:
Reference:
powershell - Authentication_Unauthorized, User Not Found - answered by JoyWang

Error: Failed to install provider while installing AWS provider

Here's my provider block
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
Here's the full error message
Error while installing hashicorp/aws v4.12.1: chmod
│ .terraform/providers/registry.terraform.io/hashicorp/aws/4.12.1/linux_amd64/terraform-provider-aws_v4.12.1_x5: operation not permitted
This is my first time trying to run Terraform using WSL(Windows Subsystem for Linux) and I've never received this error before when using powershell. Couldn't find any answers or fixes online.
I had the same issue recently. WSL restart helped. Win + R →
wsl --shutdown

Vagrant unable to mount SMB after upgrade to 1.7.4

I'm using vagrant on windows 8, with the hyper-v provider starting a windows server 2012 box.
Before I updated to vagrant 1.7.4 I was on version 1.7.2, and everything worked.
But after updating I am getting an error when it is trying to mount the shared folder:
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
cmdkey /add:xxx.xxx.xxx.xxx /user:DOMAIN\user /pass:Password
Stdout from the command:
Stderr from the command:
Exception calling "RegisterTaskDefinition" with "7" argument(s): "The user
name or password is incorrect. (Exception from HRESULT: 0x8007052E)"
At C:\tmp\vagrant-elevated-shell.ps1:58 char:1
+ $folder.RegisterTaskDefinition($task_name, $task, 6, $username, $password,
1, $n ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
I have replaced the details from the line:
cmdkey /add:xxx.xxx.xxx.xxx /user:DOMAIN\user /pass:Password
With placeholders for obvious reasons. I did try and run the command above in the VM and I get the following output:
CMDKEY: Credential added successfully.
So I assume it is working correctly. Has something changed or broken in 1.7.4?
I have figured out a fix for this.
Our password contained dollar signs ($), these were being stripped out in the vagrant-elevated-shell.ps1 script.
I have forked the vagrant repo and made the change and made a pull request - https://github.com/mitchellh/vagrant/pull/6452
To patch your local environment, you can find the communicator.rb file on your local machine at:
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\communicators\winrm\communicator.rb
(provided you used the default setting in the installer)

Unable to connect to Visual Studio Local Host Webserver

I got this error when I tried to run(F5) my project solution using Visual Studio,then I did the following steps.......
I just did copy from other server which have visual studio installed then paste it in my local(c:\windows\microsoft.net\framework\v2.0.50727) webdev.webserver.exe then I tried to run
In Cmd Prompt:
c:\windows\microsoft.net\framework\v2.0.50727\WebDev.WebServer /?.
cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727--->aspnet_regiis -i
then iisrest
Result:
nothing is worked.Still I got Same Error...
Error:
How ever when I tried to run aspnet_regiis -i I got some error like
set up has detected some error and ask me to check log file ...from log file I got some failure status like:
C:\Inetpub\wwwroot\wss\VirtualDirectories\47223\aspnet_client
2012-06-29 12:58:20 Failure Creating directory: C:\Inetpub\wwwroot\wss\VirtualDirectories\47223\aspnet_client: CreateDirectoryInternal failed with HRESULT 80070003: 'The system cannot find the path specified. '
2012-06-29 12:58:20 Failure Creating list of client site scripts dirs: CreateSiteClientScriptDir failed with HRESULT 80070003: 'The system cannot find the path specified. '
Could you please instruct me on this......
Thank you
After all above attemps I just repair my .Net Framework 2.0 and restart the system.Now its working so Good.Thanks

Firefox 4 and 5: invalid 'in' operand this._sandBox - resource://gre/components/nsProxyAutoConfig.js

This error drives me insane:
invalid 'in' operand this._sandBox - resource://gre/components/nsProxyAutoConfig.js line:91
in firefox 4 and 5. It started to malfunction when i did the upgrade from 3.6 to 4.
I have search the internet about the error but seems to be an old one, it first occur in Firefox 2.8 and fixed in 3.x and above.
What i have done to try to fix this:
- Upgrade from 4 to 5 - no effect
- Uninstall Firefox and reinstall it - no effect
- Removing caches - no effect
- Modified the resource://gre/components/nsProxyAutoConfig.js, by unpacking it's archive omni.jar (which is actually a zip file), fix the error with a try{} catch(e){} statement - clear cache again - NO EFFECT
It seems to be there is a compiled or cached version of nsProxyAutoConfig.js because the error is refering to the same line, and there is a comment of my fix!
// Fix by EH, returning error in FF <- This is now line 91
try {
if (!("FindProxyForURL" in this._sandBox))
return null;
} catch (e) { return null; }
I need to get rid of this error because there is no fix for it and it stops debugging the scripts of any website so i cannot see the error when there is a error in the javascript. That is very anoying.
Please, does somebody have a solution to this?
Thank you!
Alright, tried a new upgrade again from 3.6 to Firefox 6, same error. #Nickolay was right, it has something to do with the proxy configuration, but, i didn't touch it!
To get rid from this message go to menu:
Extra|Options|Advanced|Network Tab and open connection settings.
Set Proxy to "No Proxy"
Error is gone.

Resources