rgl / windows-domain-controller-vagrant

Example Windows Domain Controller
140 stars 35 forks source link

The following WinRM command responded with a non-zero exit status. #3

Closed MatthiasHertel closed 3 years ago

MatthiasHertel commented 4 years ago

hi @rgl,

i am on host ubuntu , provider libvirt and i got the following error due running vagrant up --provider=libvirt

The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

ip=$(which ip); ${ip:-/sbin/ip} addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1

Stdout from the command:

Stderr from the command:

At line:1 char:33
+ ip=$(which ip); ${ip:-/sbin/ip} addr show | grep -i 'inet ' | grep -v ...
+                                 ~~~~
Unexpected token 'addr' in expression or statement.
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand

what can i do?

rgl commented 4 years ago

That's an odd error. It seems vagrant is trying to execute a bash command inside windows powershell, which will never work.

With the information you have provided I have no idea how to help.

hoozemans commented 1 year ago

Vagrantfile.txt start.log

I have the same error. Sorry for my Vagrant file - I'm quite new at this. I have been looking for solutions for this problem for a couple of weeks now.

This bit here seems interesting:

DEBUG host: Found cap: nfs_installed in linux INFO host: Execute capability: nfs_installed [#<Vagrant::Environment: /home/nout/git/ibm-ace-toolkit.vagrant/windows11>] (linux)

Looks like it thinks the guest is Linux, even though I explicitly told it (at least I think I did) it's Windoze.

rgl commented 1 year ago

@hoozemans, since you did not explicitly configure the vagrant synced folder type, it tried to use nfs, which does not normally work with a vanilla windows base vagrant box.

In a Ubuntu Linux host, instead of NFS, I normally use SMB. But, to use SMB in my Ubuntu host, I have to patch my vagrant installation. I do it as https://github.com/rgl/my-ubuntu-ansible-playbooks/blob/main/roles/vagrant/tasks/main.yml#L77-L120 which, among other things, requires the patch at https://github.com/rgl/my-ubuntu-ansible-playbooks/blob/main/roles/vagrant/files/vagrant-smb-9948.patch.

Also have a look at how vagrant synced_folder is configured at https://github.com/rgl/windows-domain-controller-vagrant/blob/master/Vagrantfile#L24-L26 (notice this is for the libvirt provider) and in https://github.com/rgl/windows-vagrant/blob/master/example/Vagrantfile.

HTH.