P.S. For using tinygo to generate Linux executables, see: https://tinygo.org/getting-started/install/linux/ https://tinygo.org/docs/guides/linux/
But I couldn't find the minimum kernel version requirements. On Saturday, 14 January 2023 at 11:41:21 UTC Brian Candler wrote: > On Friday, 13 January 2023 at 20:42:28 UTC mi...@newclarity.net wrote: > I SSHed into the ESXi server, used wget to pull down the Golang tarball, > used tar to extract it from within the ESXi shell, and then used `go run > hello.go` in the ESXi shell and got a runtime error of "epollwait on fd 4 > failed with 38." > > That error is basically the same error from this ticket for an unsupported > older version of CentOS: https://github.com/golang/go/issues/24980 > > From there I realized it was beyond my skills to pursue and so I dropped > it. > > I wonder if anyone on the list can speak to the difference between what > you (Anthony) did and what I did, and Anthony's worked and mine didn't? > > Anthony wrote a very simple "Hello world" program. You tried to run an > extremely large and complex program (the Go compiler). > > Further, I wonder if other runtime errors are waiting as soon as other > packages are pulled in that need greater access to the O/S? > > I think that's exactly right. You can build simple binaries for Linux and > they'll run under ESXi, but because it's running on an ancient Linux kernel > which is below the minimum required by Go, anything sophisticated will fail. > > Finally, I wonder if someone on the list would be able to help me get > around that error and continue exploring the compilation and execution of > Go programs on an ESXi server from within the ESXi SSH shell? > > Not directly, no. The Go team themselves have dropped support for ancient > Linux kernels, and adding that back would be a major undertaking (which > nobody wants to do). > > I should ask though: what is the actual problem that you're trying to > solve, i.e. what is your ultimate goal? Is it that you want to write admin > tools for managing your ESXi server? And your preference is that these > tools run directly on the ESXi host, *and* that they are written in Go? > > This doesn't require having a Go compiler which runs *on* the ESXi host, > because you could do the compilation elsewhere. But it does require a > compiler which generates binaries which run on this host. There are other > Go compilers, like tinygo <https://tinygo.org/>, that you could try. > These are designed to generate code for older/smaller machines so might > work. > > Next thought: would you be happy to have admin tools that don't run on the > ESXi host itself, but instead talk to the ESXi API? Are you using vcenter > or standalone ESXi hosts? That would be the "cleanest" way to administer > them. > > Finally: at worst you can write a Go program which runs on a different > host, and simply ssh's to the ESXi server to run the ESXi command line > tools there. Go includes an ssh client library: > https://pkg.go.dev/golang.org/x/crypto/ssh > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/15de16db-7e1f-4739-b855-3eb0bf615de2n%40googlegroups.com.