From 8bc2f6cd8486c893c292da3aa64965d10cd8ffe8 Mon Sep 17 00:00:00 2001 From: Burt Holzman Date: Wed, 23 Mar 2022 10:42:05 -0500 Subject: Explicitly use IPv4 to check if podman-machine VM is listening When starting a VM that has been configured with volume mounts, the podman client attempts to connect via TCP to localhost, which runs gvproxy to proxy an ephemeral port to the VM's ssh port. Previously, gvproxy was listening on all interfaces and IP addresses, but this behavior has changed to listening only on the IPv4 loopback address. Without this change, if a newer build of gvproxy is used, a podman machine configured with volume mounts will hang forever after "podman machine start" with "Waiting for VM ...". [NO NEW TESTS NEEDED] Signed-off-by: Burt Holzman --- pkg/machine/qemu/machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/machine/qemu') diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index d30e51215..d4a2cffac 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -778,7 +778,7 @@ func (v *MachineVM) isRunning() (bool, error) { func (v *MachineVM) isListening() bool { // Check if we can dial it - conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", "localhost", v.Port), 10*time.Millisecond) + conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", "127.0.0.1", v.Port), 10*time.Millisecond) if err != nil { return false } -- cgit v1.2.3-54-g00ecf