Skip to content

Commit 2930af1

Browse files
authored
fix(ssh): SSH port was not assigned to gvproxy (#94)
1 parent 8aca952 commit 2930af1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/machine/gvproxy/gvproxy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ func Start(ctx context.Context, mc *vmconfig.MachineConfig) error {
3838
if err := mc.GetSSHPort(); err != nil {
3939
return fmt.Errorf("unable to get available ssh port: %w", err)
4040
}
41-
41+
4242
// gvproxy listen a local socks file as Podman API socks (PodmanSocks.InHost)
4343
// and forward to the guest's Podman API socks(PodmanSocks.InGuest).
4444
gvpCmd.AddForwardSock(mc.PodmanSocks.InHost)
4545
gvpCmd.AddForwardDest(mc.PodmanSocks.InGuest)
4646
gvpCmd.AddForwardUser(mc.SSH.RemoteUsername)
4747
gvpCmd.AddForwardIdentity(mc.SSH.PrivateKeyPath)
4848
gvpCmd.PidFile = mc.PIDFiles.GvproxyPidFile
49+
gvpCmd.SSHPort = mc.SSH.Port
4950

5051
// gvproxy endpoint, which provide network backend for vfkit/krunkit
5152
gvpEndPoint := fs.NewFile(mc.GetNetworkStackEndpoint())

pkg/port/port.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
// GetFree returns a free TCP port
1515
func GetFree() (int, error) {
16-
l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", define.LocalHostURL, 0))
16+
l, err := net.Listen("tcp4", fmt.Sprintf("%s:%d", define.LocalHostURL, 0))
1717
if err != nil {
1818
return 0, fmt.Errorf("unable to get free TCP port: %w", err)
1919
}

0 commit comments

Comments
 (0)