Not really, no. You can use systemd-detect-virt which is systemd specific but should work as a regular user, otherwise you can try to add some specialized checks like looking if /dev in the mount table is devtmpfs or not.
Not really, no. You can use systemd-detect-virt which is systemd specific but should work as a regular user, otherwise you can try to add some specialized checks like looking if /dev in the mount table is devtmpfs or not.