debian – bcm2835_init: Can not open / dev / gpiomem: No file or directory of this type


I'm using Debian GNU / Linux 9.8 (stretch) as a host on VirtualBox,

Background story:

The code I'm trying to run requires the gpio library bcm2835, so I installed it (with guest additions). The code must be run on a Raspberry Pi, and I just want to be able to run it (with all the necessary libraries on the Linux environment) on my PC, so that when I transfer the code to the Pi, it is ready to use. go without error, and I can not test it completely without this library working properly.

If there is a better approach to test the code in this way, I will be glad to hear your suggestions. It worked for me in the past, but I have since reinstalled VBox, and I am now faced with these mistakes. I looked for the error on Google, but I did not find a valid solution and I ran into a wall.


The code does not run and the terminal returns the error: "bcm2835_init: can not open / dev / gpiomem: no file or directory of this type"

Thank you for your time.