OpenVZ Forum


Home » General » Support » /dev/mem: Operation not permitted
icon9.gif  /dev/mem: Operation not permitted [message #35550] Thu, 02 April 2009 21:58 Go to next message
bbhenry is currently offline  bbhenry
Messages: 17
Registered: February 2009
Junior Member
I have an application trying to access the /dev/mem and get the following error:
/dev/mem: Operation not permitted


I have already grand access of the /dev/mem to my container with both of the method I found on the wiki, even though I can see the device being available in my container , but I still get the permission denied error message. Here are the 2 methods I tried

vzctl set 2005 --devnodes mem:rw --save

or
2005 device config file with the following setting:
DEVICES="c:1:1:rw"


Both of them was able to create a /dev/mem inside my container, but I just can't get permission to access it. By the way, I am able to access the /dev/mem from HN using:
cat /dev/mem

but when I do the same thing in container, I get operation not permitted

I am using Centos 5.2 on HN, with OpenVZ kernel 2.6.18-92.1.18.el5.028stab060.2

I also have a question about mknod, what's the difference when /dev is created from mknod and device being passed by vzctl set 2005 --devnodes?



Re: /dev/mem: Operation not permitted [message #35552 is a reply to message #35550] Fri, 03 April 2009 06:05 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

try the following commands
# vzctl set $VEID --devnodes mem:rw --save
# vzctl set $VEID --capability sys_rawio --save


Quote:


I also have a question about mknod, what's the difference when /dev is created from mknod and device being passed by vzctl set 2005 --devnodes?


mknod simply creates device file inside VE but vzctl says to kernel that the particular VE is going to have appropriate permissions.
Re: /dev/mem: Operation not permitted [message #35555 is a reply to message #35552] Fri, 03 April 2009 16:30 Go to previous messageGo to next message
bbhenry is currently offline  bbhenry
Messages: 17
Registered: February 2009
Junior Member
Hi,

thank you for helping out, but here is what I get when I try to do the second command

vzctl set 2005 --capability sys_rawio --save

Invalid syntaxes in sys_rawio: capname:on|off
Bad parameter for --capability: sys_rawio

Re: /dev/mem: Operation not permitted [message #35556 is a reply to message #35555] Fri, 03 April 2009 16:36 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
It was a misprint
# vzctl set 2005 --capability sys_rawio:on --save
icon12.gif  Re: /dev/mem: Operation not permitted SOLVED [message #35557 is a reply to message #35556] Fri, 03 April 2009 17:13 Go to previous message
bbhenry is currently offline  bbhenry
Messages: 17
Registered: February 2009
Junior Member
Thank you , maratrus

It fixed my issue.

Just have one more question about the mknod:

Are the device that is created by mknod just pseudo device? meaning they don't have actual function but just to be there to fake the OS?

And is there a place explaining when to use mknod?
Previous Topic: OpenVZ + ALT Linux Sisyphus (20081222) + WebVZ
Next Topic: CPU-Limit not working?
Goto Forum:
  


Current Time: Mon Jul 29 00:30:07 GMT 2024

Total time taken to generate the page: 0.02786 seconds