Run "lscpu" in a LXC will always show physical server info, is it norm or abnormal?

lscpu, lsmem… are all show physical server info, any way can I fix it? thanks!

Make sure you have LXCFS installed and working, you should see a bunch of things by doing grep lxcfs /proc/mounts in the container.

Then check that cat /proc/cpuinfo and cat /proc/meminfo shows the expected values.

If that’s the case and tools like lscpu or lsmem still don’t show the correct values, then it’s because they’re not looking at proc files but instead use the sysinfo system call.

On Incus you can have that also be handled by setting security.syscalls.intercept.sysinfo=true.

On pure LXC (not Incus), doing so is possible but would require you writing a privileged daemon that can be hooked up to seccomp events.