Skip to content

Commit

Permalink
Explicitly use IPv4 to check if podman-machine VM is listening
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
holzman committed Mar 23, 2022
1 parent f049cba commit cdda192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit cdda192

Please sign in to comment.