crc-org / vfkit

Apache License 2.0
123 stars 24 forks source link

command generation with unixgram and gvproxy fails #54

Closed baude closed 1 year ago

baude commented 1 year ago

When creating a vfkit network device and then creating the vfkit command using .Cmd(), an error is kicked out stating the network device requires an fd or NAT to be enabled.

According to the commit log, this should not be required.

    term1$ gvproxy  --listen unix:///tmp/gvproxy-http.sock --listen-vfkit unixgram:///tmp/gvproxy.sock
    term2$ vfkit --device virtio-net,unixSocketPath=/tmp/gvproxy.sock,mac=5a:94:ef:e4:0c:ee [...]

The code I used is:

    netDevice, err := vfConfig.VirtioNetNew("5a:94:ef:e4:0c:ee")
    if err != nil {
        return err
    }
    // Set user networking with gvproxy
    netDevice.SetUnixSocketPath(m.GvProxySock.GetPath())
jakecorrenti commented 1 year ago

/assign

baude commented 1 year ago

I think this may have been user error? I am not able to reproduce ...

cfergeau commented 1 year ago

The only error messages in v0.1.1 containing nat are :

pkg/config/virtio.go:                           return fmt.Errorf("Unexpected value for virtio-net 'nat' option: %s", option.value)
pkg/config/virtio.go:           return fmt.Errorf("'nat' and 'unixSocketPath' cannot be set at the same time")
pkg/config/virtio.go:           return fmt.Errorf("'nat' and 'fd' cannot be set at the same time")
pkg/config/virtio.go:           return fmt.Errorf("One of 'nat' or 'fd' or 'unixSocketPath' must be set")

The one you mention in the issue description seems to be from before commit cdb7c81:

    return fmt.Errorf("One of 'nat' or 'fd' must be set")

I agree this looks like a user error, and an older version being involved.