# Vagrant fails when creating a HyperV box from init file

**URL:** <https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793>\
**Category:** Vagrant\
**Created:** [March 8, 2021, 11:10am UTC](https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793 "2021-03-08T11:10:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenrikBach1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/henrikbach1/32/17819_2.png) [@HenrikBach1](https://discuss.hashicorp.com/u/HenrikBach1)\
**Post date:** [March 8, 2021, 11:10am UTC](https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793/1 "2021-03-08T11:10:21Z")

</div>

Hi

Vagrant fails when creating a HyperV box from init file:

```auto
henri@DESKTOP-VC184G4 ~/Projects/Virtualization/Vagrant/Cows/HyperV/cow1
$ vagrant up --provider hyperv
Traceback (most recent call last):
        29: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/bin/vagrant:168:in `<main>'
        28: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/bin/vagrant:168:in `new'
        27: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:178:in `ini
tialize'
        26: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:983:in `pro
cess_configured_plugins'
        25: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:956:in `fin
d_configured_plugins'
        24: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:956:in `eac
h'
        23: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:958:in `blo
ck in find_configured_plugins'
        22: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/vagrantfile.rb:237:in `mac
hine_config'
        21: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/vagrantfile.rb:201:in `blo
ck in machine_config'
        20: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:280:in `
find'
        19: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:456:in `
with_collection_lock'
        18: from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
        17: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:457:in `
block in with_collection_lock'
        16: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:304:in `
block in find'
        15: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:304:in `
each'
        14: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:311:in `
block (2 levels) in find'
        13: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:311:in `
each'
        12: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:321:in `
block (3 levels) in find'
        11: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/box_collection.rb:321:in `
call'
        10: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:525:in `hoo
k'
         9: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/action/runner.rb:34:in `ru
n'
         8: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:205:in `blo
ck in action_runner'
         7: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:542:in `hos
t'
         6: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:542:in `new
'
         5: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/host.rb:13:in `initialize'

         4: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/capability_host.rb:36:in `
initialize_capabilities!'
         3: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/capability_host.rb:117:in
`autodetect_capability_host'
         2: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/capability_host.rb:117:in
`inspect'
         1: from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:193:in `ins
pect'
C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:193:in `encode': U+00F8 to I
BM437 in conversion from Windows-1252 to UTF-8 to IBM437 (Encoding::UndefinedConversionError)

```

What am I doing wrong.

Thanks in advance.

/Henrik[Vagrantfile.txt](https://discuss.hashicorp.com/uploads/short-url/nAVctvrp9v9bErbx6lR9cJUWuP5.txt) (146 Bytes)

---

<div class="post-metadata">

**Author:** ![soapy1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/soapy1/32/5509_2.png) [@soapy1](https://discuss.hashicorp.com/u/soapy1)\
**Post date:** [March 8, 2021, 10:29pm UTC](https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793/2 "2021-03-08T22:29:18Z")

</div>

Hey there,  
It looks like the problem lies in some encoding issues. However, sharing your Vagrantfile might reveal some other clues about what is going wrong here.

---

<div class="post-metadata">

**Author:** ![HenrikBach1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/henrikbach1/32/17819_2.png) [@HenrikBach1](https://discuss.hashicorp.com/u/HenrikBach1)\
**Post date:** [March 9, 2021, 6:11am UTC](https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793/3 "2021-03-09T06:11:26Z")

</div>

Hi @soapy1

I’ve now attached the Vagrant file in the original post (above).

Thank you.

---

<div class="post-metadata">

**Author:** ![soapy1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/soapy1/32/5509_2.png) [@soapy1](https://discuss.hashicorp.com/u/soapy1)\
**Post date:** [March 9, 2021, 3:48pm UTC](https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793/4 "2021-03-09T15:48:22Z")

</div>

So, I found an issue that looks similar to what you are bumping into here

> <https://github.com/hashicorp/vagrant/issues/11431>
>
> Vagrant version
> Vagrant 2.2.7
> Host operating system
> Windows 10 Pro N
> Expected behavior
> Vagrant should work with special characters in Windows username.
> Actual behavior
> It doesn't. It throws...

It seems like the issue also has a workaround; setting VAGRANT\_HOME to a path that does not have special characters in it.

---

<div class="post-metadata">

**Author:** ![HenrikBach1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/henrikbach1/32/17819_2.png) [@HenrikBach1](https://discuss.hashicorp.com/u/HenrikBach1)\
**Post date:** [March 10, 2021, 11:22am UTC](https://discuss.hashicorp.com/t/vagrant-fails-when-creating-a-hyperv-box-from-init-file/21793/5 "2021-03-10T11:22:03Z")

</div>

Thank you for your suggestion.

The workaround with the VAGRANT\_HOME seemed not to work in my case. It seemed that it was the project path, with special char’s embedded, that caused the troubles.

/Henrik
