how to get an unique machine ID for lxc

huky

Well-Known Member
Jul 1, 2016
70
2
48
43
Chongqing, China
I want to get an unique machine ID for all host
but the command failed in lxc:

Code:
root@vlan50-62:~# dmidecode --string system-uuid
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory

root@vlan50-62:~# dmidecode | grep -i uuid
/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
root@vlan50-62:~# cat /sys/devices/virtual/dmi/id/product_uuid
cat: /sys/devices/virtual/dmi/id/product_uuid: Permission denied

root@node011:~# pct exec 100 cat /sys/devices/virtual/dmi/id/product_uuid
cat: /sys/devices/virtual/dmi/id/product_uuid: Permission denied

Is there other way?
 
hi,

you could use /etc/machine-id or /var/lib/dbus/machine-id

EDIT: sorry seems like these are also shared within templates.. but i'm guessing it can be modified?

anyway, the reason you get permission denied is that this file is non-namespaced and it's unique to your physical host. [0]

[0]: https://github.com/lxc/lxd/issues/4737
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!