From 2a8e6acecbd69c60d702ea68b2c44b6fe8782daf Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 29 Aug 2023 08:15:30 -0500 Subject: [PATCH 1/2] Set remote username earlier for hyperv the remote username was being set too "late" for hyperv and the username for ssh connections was blank. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude --- pkg/machine/hyperv/machine.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/machine/hyperv/machine.go b/pkg/machine/hyperv/machine.go index 3bf71f17e2..48bb0bf4e2 100644 --- a/pkg/machine/hyperv/machine.go +++ b/pkg/machine/hyperv/machine.go @@ -215,6 +215,7 @@ func (m *HyperVMachine) Init(opts machine.InitOptions) (bool, error) { } m.Port = sshPort + m.RemoteUsername = opts.Username err = machine.AddSSHConnectionsToPodmanSocket( m.UID, m.Port, @@ -256,16 +257,8 @@ func (m *HyperVMachine) Init(opts machine.InitOptions) (bool, error) { return false, err } - // c/common sets the default machine user for "windows" to be "user"; this - // is meant for the WSL implementation that does not use FCOS. For FCOS, - // however, we want to use the DefaultIgnitionUserName which is currently - // "core" - user := opts.Username - if user == "user" { - user = machine.DefaultIgnitionUserName - } // Write the ignition file - if err := m.writeIgnitionConfigFile(opts, user, key); err != nil { + if err := m.writeIgnitionConfigFile(opts, m.RemoteUsername, key); err != nil { return false, err } // The ignition file has been written. We now need to From 1085177feeecbca096408d1e67bc1872f08b92d4 Mon Sep 17 00:00:00 2001 From: Brent Baude Date: Tue, 29 Aug 2023 08:20:31 -0500 Subject: [PATCH 2/2] hyperv ignition: use gvforwarder instead of vm in gvisor-vsock-tap upstream, there is a binary called 'vm' which is used for routing traffic from a tap over something like vsock. In Fedora, the binary is named 'gvforwarder'. [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude --- pkg/machine/hyperv/machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/machine/hyperv/machine.go b/pkg/machine/hyperv/machine.go index 48bb0bf4e2..668cad27c1 100644 --- a/pkg/machine/hyperv/machine.go +++ b/pkg/machine/hyperv/machine.go @@ -131,7 +131,7 @@ Description=vsock_network After=NetworkManager.service [Service] -ExecStart=/usr/libexec/podman/vm -preexisting -iface vsock0 -url vsock://2:%d/connect +ExecStart=/usr/libexec/podman/gvforwader -preexisting -iface vsock0 -url vsock://2:%d/connect ExecStartPost=/usr/bin/nmcli c up vsock0 [Install]