ppggff / vagrant-qemu

Use Vagrant to manage machines using QEMU. Test with Apple Silicon / M1 and CentOS aarch64 image
MIT License
408 stars 32 forks source link

vagrant halt fails on macos #17

Closed ctrath closed 1 year ago

ctrath commented 1 year ago

The problem is here: https://github.com/ppggff/vagrant-qemu/blob/578658498f867aae342f57ec2ab1cef77464a116/lib/vagrant-qemu/driver.rb#L97

Basically, if using brew to install netcat, the non-bsd version is installed, so there is no -U option.

I end up getting an error like this:

A command executed by Vagrant didn't complete successfully!
The command run along with the output from the command is shown
below.

Command: ["nc", "-w", "5", "-U", "/Users/ctrath/.vagrant.d/tmp/vagrant-qemu/2zoYl_JOiFE/qemu_socket", {:notify=>[:stdout, :stderr, :stdin]}]

Stderr: nc: invalid option -- U
Try `/opt/homebrew/bin/nc --help' for more information.

That said, socat can be used to perform the same action, but I'm not sure how compatible this is across OSs:

socat - UNIX-CLIENT:/Users/ctrath/.vagrant.d/tmp/vagrant-qemu/2zoYl_JOiFE/qemu_socket
ppggff commented 1 year ago

I will try to use the ruby's build-in socket support to replace nc soon.

ppggff commented 1 year ago

Please try v0.3.0 I will reopen this issue if there still problem