LXD proxy on Ubuntu 20.04 alpha

Hello Linux Containers community,

I’m trying to set-up an LXC server on Ubuntu and I have an issue with LXC proxy.

My inputs:

  • Ubuntu 20.04 last daily live image (alpha)

  • LXD’s network is initialized with the following parameters:

    networks:

    • name: lxdbr0
      description: “”
      type: bridge
      managed: false
      config:
      ipv4.address: 10.0.1.1/24
      ipv4.nat: “true”
      ipv6.address: none

    profiles:

    • name: default
      description: “Default LXD profile”
      devices:
      eth0:
      name: eth0
      nictype: bridged
      parent: lxdbr0
      type: nic
  • LXD container’s network is initialized with the following commands:

    lxc network attach lxdbr0 lxc-c7 eth0 eth0
    lxc config device set lxc-c7 eth0 ipv4.address 10.0.1.100
    lxc config set lxc-c7 volatile.eth0.host_name veth-c7

  • And finally, the SSH proxy is configured with the following command:

    lxc config device add lxc-c7 ssh proxy listen=tcp:0.0.0.0:2222 connect=tcp:127.0.0.1:22

But the LXC proxy looks stopped.
No LXD service is listed with the lsof -i -n command.

Should have I to add an additional daemon?

Regards.

Hi!

If the LXD proxy did not get created, you will see in in the logs, at /var/snap/lxd/common/lxd/logs/lxc-c7/. There is a file there for the proxy device.

If you do not see any error in the logfile for the proxy device, then the proxy device is likely running.
Use ss -tuna to check that the port is in LISTEN mode. I noticed that lsof does not show open ports in some cases.

Hi,

I definitely have a issue with proxy:

# cat proxy.ssh.log
Error: remove 0.0.0.0:2222: read-only file system
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5a3398]

goroutine 1 [running]:
os.(*File).Name(...)
        /snap/go/4098/src/os/file.go:50
net.FileListener(0x0, 0x0, 0x0, 0x0, 0x0)
        /snap/go/4098/src/net/file.go:36 +0x88
main.(*cmdForkproxy).Run(0xc000010260, 0xc0002d9b80, 0xc00014b800, 0x6, 0x6, 0x0, 0x0)
        /build/lxd/parts/lxd/go/src/github.com/lxc/lxd/lxd/main_forkproxy.go:352 +0x2de
github.com/spf13/cobra.(*Command).execute(0xc0002d9b80, 0xc00014b6e0, 0x6, 0x6, 0xc0002d9b80, 0xc00014b6e0)
        /build/lxd/parts/lxd/go/src/github.com/spf13/cobra/command.go:826 +0x465
github.com/spf13/cobra.(*Command).ExecuteC(0xc000260f00, 0xc000257f60, 0x1, 0x1)
        /build/lxd/parts/lxd/go/src/github.com/spf13/cobra/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
        /build/lxd/parts/lxd/go/src/github.com/spf13/cobra/command.go:864
main.main()
        /build/lxd/parts/lxd/go/src/github.com/lxc/lxd/lxd/main.go:164 +0xd32

More context:

  • LXC version

    lxd --version

    3.0.4

    lxc --version

    3.0.4

  • UFW rules

    ufw status

    Status: active

    To Action From


    22/tcp ALLOW Anywhere
    2222/tcp ALLOW Anywhere

  • ZFS RFS

I’m sorry; I don’t know the Go language so it will be difficult for me to debug it. :confused:

Thanks for your help!

Hmm, you shouldn’t really be using 3.0.4 on 20.04.

You may want to switch over to the current release with snap refresh lxd --channel=latest

And the snap refresh --channel=3.23 lxd makes it work!
Thanks to both of you. :+1:

More generally, thanks Stéphane for your work on LXD and all your community support (I have seen so many messages from you on many Internet boards about virtualization)
I really appreciate your work. :heart: