User Tools

Site Tools


tips:accessing_dev_mem_for_host_from_lxc_container

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tips:accessing_dev_mem_for_host_from_lxc_container [2021/07/14 17:04] navaneethtips:accessing_dev_mem_for_host_from_lxc_container [2021/07/14 18:40] veera
Line 1: Line 1:
-====== DMIDECODE 3.1 ======+====== Problem getting machineid on LXC/LXD container ======
  
  
-To Access /dev/mem for Host from container,+When you install Trisul packages like the probe or  hub on a LXC/LXD linux container you might face an error where Trisul is unable to get the machineID of the container. 
 + 
 +The error could be something like the following ; when you try to get the machineID from the hub or probe node from the admin panel. 
 + 
 +{{:tips:trisul_network_analytics_14-07-2021_18-36-20.png?400|}} 
 + 
 + 
 +===== Fix this error to allow LXC nodes to get the machineID ===== 
 + 
 +Essentially you need to set the container permissions to allow access to the /dev/mem device from the host which is used as part of dmidecode.  Do the following steps.
  
-Please run the following commands. 
  
 <code> <code>
 lxc stop <container_name> lxc stop <container_name>
 lxc config set <container_name> security.privileged true lxc config set <container_name> security.privileged true
-lxc config set <container_name> raw.lxc 'lxc.cap.drop=' 
-lxc config set <container_name> raw.lxc 'lxc.cap.keep=' 
 lxc config device add <container_name> devmem unix-char source=/dev/mem lxc config device add <container_name> devmem unix-char source=/dev/mem
 +lxc restart <container_name>
 +</code>
 +
 +To test if it works do
 +<code>
 lxc exec <container_name> dmidecode lxc exec <container_name> dmidecode
-lxc start <container_name> 
 </code> </code>
  
-You can run these commands when you find the following errors.  
  
-<note warning>/dev/mem: Operation not permitted</note>+If that does not work add the following commands and retry 
 + 
 +<code> 
 +lxc config set <container_name> raw.lxc 'lxc.cap.drop=' 
 +lxc config set <container_name> raw.lxc 'lxc.cap.keep=' 
 +</code> 
  
  
  
tips/accessing_dev_mem_for_host_from_lxc_container.txt · Last modified: 2021/07/14 18:40 by veera