summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt Holzman <burt@fnal.gov>2022-03-23 10:42:05 -0500
committerBurt Holzman <burt@fnal.gov>2022-03-23 12:48:17 -0500
commitcdda1924a015fa1dc10a0e1231a9141884972640 (patch)
treeefe0550e18623c34fbec0747c6028316461f07c1
parentf049cba47c31d31a4a8ed9a9180f0e847be3411c (diff)
downloadpodman-cdda1924a015fa1dc10a0e1231a9141884972640.tar.gz
podman-cdda1924a015fa1dc10a0e1231a9141884972640.tar.bz2
podman-cdda1924a015fa1dc10a0e1231a9141884972640.zip
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 <burt@fnal.gov>
-rw-r--r--pkg/machine/qemu/machine.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 1bd9fb51b..3b14572a6 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -782,7 +782,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
}